Jump to content


Photo
- - - - -

latest product based on date modified rss feed?


3 replies to this topic

#1 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts

Posted 07 November 2013 - 08:13 AM

i found

http://www.opencart....ilter_license=0

and

http://www.opencart....ilter_license=0

both of them can provide rss feed for latest product

but how to change rss feed based on product date modified rather than product date added.

 

i have changed date_added -> date_modified but failed

 

successfully changed latest product in opencart into newest arrival with listing based on date modified

file i used for vqmod attached

 

any help changing one of the free rss extension here to publish latest product feed based on date modified?

Attached Files


  • 0

#2 MaxD

MaxD

    Administrator

  • Administrators
  • 703 posts

Posted 07 November 2013 - 02:59 PM

Try this

<!--
  Copyright (C) 2012 Tri Le <trile7 at gmail dot com>

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>
-->

<modification>
  <id>latest, featured, and special products rss feed</id>
  <version>0.2</version>
  <vqmver>2.1.7</vqmver>
  <author>Tri Le trile7 at gmail dot com</author>

  <file name="catalog/view/theme/*/template/module/featured.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=featured' title='Subscribe to Featured Products'><img src='http://cdn1.iconfinder.com/data/icons/socialnetworking/16/rss.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/latest.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=latest' title='Subscribe to Latest Products'><img src='http://cdn1.iconfinder.com/data/icons/socialnetworking/16/rss.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/special.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=special' title='Subscribe to Special Products'><img src='http://cdn1.iconfinder.com/data/icons/socialnetworking/16/rss.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/bestseller.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=bestseller' title='Subscribe to Bestseller Products'><img src='http://cdn1.iconfinder.com/data/icons/socialnetworking/16/rss.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">protected function index</search>
      <add><![CDATA[
        $rss = isset($this->request->get["rss"]) ? $this->request->get["rss"] : "";
        if ($rss=="latest" || $rss=="featured" || $rss=="special" || $rss=="bestseller") {
          $this->load->model("catalog/product");
          $this->load->model("localisation/currency");
          $this->load->model("tool/image");
          $this->data["products"] = array();

          $limit = 20;
          $image_width = 100;
          $image_height = 100;
          $currency = $this->currency->getCode();

          if ($rss=="latest") {
            $data = array("sort"  => "p.date_modified", "order" => "DESC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProducts($data);
          }
          elseif ($rss=="featured") {
            $featured_products = explode(",", $this->config->get("featured_product"));
            $featured_products = array_slice($featured_products, 0, $limit);
            foreach ($featured_products as $product_id) $products[] = $this->model_catalog_product->getProduct($product_id);
          }
          elseif ($rss=="special") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProductSpecials($data);
          }
          elseif ($rss=="bestseller") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getBestSellerProducts($limit);
          }

          $output = "<?xml version='1.0' encoding='UTF-8' ?>";
          $output .= "<rss version='2.0'>";
          $output .= "<channel>";
          $output .= "<title><![CDATA[" . $this->config->get("config_name") . " - $rss products]]]]><![CDATA[></title>";
          $output .= "<description><![CDATA[" . $this->config->get("config_meta_description") . "]]]]><![CDATA[></description>";
          $output .= "<link><![CDATA[" . HTTP_SERVER . "]]]]><![CDATA[></link>";
          foreach ($products as $product) {
            $title = $product["name"];
            $link = HTTP_SERVER . "?route=product/product&product_id=$product[product_id]";
            $price = $this->config->get("config_customer_price") ? false : $this->currency->format($this->tax->calculate($product["price"], $product["tax_class_id"], $this->config->get("config_tax")));
            $special = ((float)$product["special"]) ? $this->currency->format($this->tax->calculate($product["special"], $product["tax_class_id"], $this->config->get("config_tax"))) : false;
            $image_url = $this->model_tool_image->resize($product["image"], $image_width, $image_height);
            $description = "";
            if ($price) $description .= ($special) ? "<p><strong><span style='color:red; text-decoration:line-through;'>$price</span> $special</strong></p>" : "<p><strong>$price</strong></p>";
            if ($image_url) $description .= "<p><a href='$link'><img src='$image_url' alt=''></a></p>";
            if ($product["description"]) $description .= html_entity_decode($product["description"]);

            if ($rss!="special" || $special) {
              $output .= "<item>";
              $output .= "<title><![CDATA[$title]]]]><![CDATA[></title>";
              $output .= "<link><![CDATA[$link]]]]><![CDATA[></link>";
              $output .= "<description><![CDATA[$description]]]]><![CDATA[></description>";
              $output .= "<guid><![CDATA[$link]]]]><![CDATA[></guid>";
              $output .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($product["date_added"])) . "</pubDate>";
              $output .= "</item>";
            }
          }
          $output .= "</channel>";
          $output .= "</rss>";

          header("Content-Type: application/rss+xml");
          echo "$output";
          die();
        }
      ]]></add>
    </operation>
  </file>

</modification>


  • 0

#3 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts

Posted 07 November 2013 - 03:18 PM

great

how could you born so brilliant? :D

i wish i have a brain like yours XD

mine is sooooo tiny >.<

lol

it works great

how to make this post status answered?

 

time to test with auto post and tweet with http://www.rssgraffiti.com/ or http://twitterfeed.com

or is there another site which can help us auto post from our rss feed?

 

maybe i should change the tittle into new product update rather than newest arrival for my simple and silly vqmod XD so if i update price the rss feed also updated :D

 

thank you so much Max

hope this mod usefull for the other too


Edited by Ivan Pramono Susanto, 07 November 2013 - 03:28 PM.

  • 0

#4 Lisawhip

Lisawhip

    Member

  • Members
  • PipPip
  • 27 posts

Posted 19 September 2018 - 01:46 AM

timberland pro work boots adidas store north face outlet pandora bracelet charms nike outlet online oakley sunglasses for men adidas yeezy boost nike clearance air max 97 silver bullet pandora longchamp nike sneakersferragamo belt ecco shoes for men michael kors handbags christian louboutin shoes yeezy boost moncler outletmoncler jackets birkenstock sandals fitflop pandora jewelry 70 off clearance pandora jewelry red bottom retro 13timberlands mcm backpack timberland outlet adidas nmd fitflops oakley sunglasses birkenstock outlet fitflops adidas running shoes coach outlet air max 270 nike factory nike outlet store nike air max 97 puma tory burch sale pandora charms pandora harden shoes pandora jewelry adidas sneakers uggs clearance moncler jackets adidas store nike outlet store online shopping michael kors outlet red bottoms retro 12 adidas adidas ultra boost canada goose clothing nike shoes outlet mbt shoes canadian goose jacket ugg slippers retro 12 michael kors handbags superstar shoes cheap oakley sunglasses adidas boost adidas nmd timberland boots pandora charms soccer cleats louboutin shoes jordan sneakers nike vapor max flyknit nike outlet online pandora rings official site jordan retro 11 michael kors handbags coach handbags air max 97 south beach adidas shoes adidas store nike uk ralph lauren polo nike outlet store online shopping pandora bracelet pandora charms yeezy adidas ray ban glasses retro 12 nike outlet store onlineray ban sunglasses pandora jewelry official site air max 95 neon pandora jewelry adidas sneakers nike uk birkenstock outlet stores pandora jewelry official site nike vapor max plus nike outlet store online shopping birkenstock sandalsbirkenstock shoes pandora charms yeezy shoes polo ralph lauren outlet north outlet online michael kors outlet onlinefitflops sale clearance tory burch sandals nike shoes for women christian louboutin outlet tory burch outlet ysl handbags adidas superstar shoes soccer cleats jordan 14 pandora christian louboutin adidas yeezy ray ban eyeglassesadidas yeezy boost bottega veneta handbags puma outlet mcm backpack philipp plein nike vapor max flyknittimberland shoes yeezy sneakers adidas yeezy boost oakley eyeglasses kate spade outlet online michael kors handbags valentino nike clearance coach outlet ultra boost air jordan 10 pandora charms jordan 4 curry 5 pandora jewelry official site pandora jewelry official site nike air max 95 pandora jewelry ugg shoes salvatore ferragamo nike air vapormax flyknit nike uk adidas outlet air max 270 balenciaga sneakers nike sneakers retro 11 canada goose outlettimberland timberland yeezy moncler jackets adidas outlet nike air max birkenstock outlet red bottom shoesbirkenstock shoes nike sneakers timberland boots coach outlet kate spade purses birkenstock sandals fit flops oakley eyeglasses yeezy boost nike outlet store timberland pro work boots birkenstock outlet bottega veneta outlet pandora charms sale clearance nike outlet pandora charms sale clearance ecco shoes for women pandora jewelry official siteretro 11 coach outlet store retro 13 yeezy birkenstock sandals pandora bracelet timberland boots curry 5 michael kors outlet online yeezy oakley sunglasses moncler jackets nike shoes philipp plein cleats cheap nike shoes balenciaga nike soccer cleats pandora charms north face jackets clearance red bottom shoes canada goose sale ecco shoes for women timberland outlet nike outlet store nike factory store adidas yeezy louboutin nike store adidas soccer pandora jewelry jordan 10 air vapor max nike factory nike clearance adidas yeezy boost air jordan 14 jordan shoes adidas yeezy north face coats kate spade sale air max 98 harden shoes puma shoes louboutin shoes ultra boost oakleyfitflops nike nike shoes pandora jewelry official site coach outlet ysl handbags ray-ban sunglasses sale adidas outlet online nike air max 270 nike outlet store nike shoes uggs boots women coach factory outlet pandora outlet jordans sneakers moncler jackets nike outlet online fit flops for women kate spade ecco shoes for men retro 11 coach rayban sunglasses michael kors handbags pandora jewellery timberland outlet birkenstock sandals retro 13 uggs official sitered bottom shoes christian louboutin ray ban eyeglasses adidas nmd r1 jordan retro 11 birkenstock sandals jordan 8timberland yeezy shoes adidas shoes for women uggs official site nmd r1 fitflops pandora jewelry timberland boots for men pandora mbt pandora pandora jewelry timberland boots oakley glasses birkenstocks red bottom coach outlet uggs official site fitflops sale kate spade handbags nike roshe air max 2018 nike factory uggs boots nike air max 2018 adidas yeezy pandora jewelry nike air max 270 adidas shoes nike outlet nike outlet store online adidas canada goose jackets pandora cyber monday deals pandora charms cyber monday north face jackets black friday michael kors black friday pandora jewelry black friday coach handbags black friday pandora jewelry black friday deals michael kors black friday deals canada goose clothing pandora jewelry black friday coach cyber monday coach black friday deals north face black friday coach black friday sale 2018 michael kors cyber monday canada goose jacket michael kors cyber monday ugg slippers coach cyber monday canada goose outlet north face cyber monday 2018.0919W


  • 0



Reply to this topic



  



 

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Community Skin by Fredson Nunes Junior