Replicate category pages to show just sale products The 2019 Stack Overflow Developer Survey Results Are InPHP to show sale badge not working correctlyConfigurable Products: Replicate Product View in Custom Product ListCustom URL Rewrites - Deleting after reindexSale on all products won't applyHow get category ID of products on wishlist and compare pagesConfigurable products being sorted after simple products on category pagesMagento - How to show Filters on non-category pagesRemove sale prices on items in storeMagento 1 get only those product collection which are not on sale in a categoryMagento2: How can i get all Special price products. (on sale products)

Why is it "Tumoren" and not "Tumore"?

Falsification in Math vs Science

Is there a name of the flying bionic bird?

Looking for best latin term for a legal document

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Does a dangling wire really electrocute me if I'm standing in water?

Is flight data recorder erased after every flight?

Is this food a bread or a loaf?

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

Springs with some finite mass

Idiomatic way to prevent slicing?

Is bread bad for ducks?

How can I fix this gap between bookcases I made?

It's possible to achieve negative score?

Time travel alters history but people keep saying nothing's changed

Patience, young "Padovan"

If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned?

Could JWST stay at L2 "forever"?

Why do UK politicians seemingly ignore opinion polls on Brexit?

I looked up a future colleague on LinkedIn before I started a job. I told my colleague about it and he seemed surprised. Should I apologize?

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

What is the steepest angle that a canal can be traversable without locks?

Realistic Alternatives to Dust: What Else Could Feed a Plankton Bloom?

On the insanity of kings as an argument against monarchy



Replicate category pages to show just sale products



The 2019 Stack Overflow Developer Survey Results Are InPHP to show sale badge not working correctlyConfigurable Products: Replicate Product View in Custom Product ListCustom URL Rewrites - Deleting after reindexSale on all products won't applyHow get category ID of products on wishlist and compare pagesConfigurable products being sorted after simple products on category pagesMagento - How to show Filters on non-category pagesRemove sale prices on items in storeMagento 1 get only those product collection which are not on sale in a categoryMagento2: How can i get all Special price products. (on sale products)



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















In Magento 1.9.2.x I would like to create a custom module that will show all sale items (anything with a current special price) within a different section of the store but retaining the normal category hierarchy/structure and filtered navigation etc.



Example:



Standard category URLs showing non-sale items:



/books/
/videos/
/games/


New URLs showing only sale items within those same categories:



/sale/books/
/sale/videos/
/sale/games/


Previously we have done this by creating the "Sale" category and replicating the standard category tree beneath that and assigning products to those categories.



This quickly becomes un-manageable for a large catalogue, and when special prices end it is almost impossible to remember to remove the items from the Sale categories. A previous dev tried scripting the removal of products from sale categories but I don't feel that is the right approach either.



This guide from Inchoo looks like it will help me achieve most of what I want. The missing part is how I could implement the normal (/) and sale (/sale/) category URL structure.



Any ideas how I may handle this?










share|improve this question
















bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.





















    1















    In Magento 1.9.2.x I would like to create a custom module that will show all sale items (anything with a current special price) within a different section of the store but retaining the normal category hierarchy/structure and filtered navigation etc.



    Example:



    Standard category URLs showing non-sale items:



    /books/
    /videos/
    /games/


    New URLs showing only sale items within those same categories:



    /sale/books/
    /sale/videos/
    /sale/games/


    Previously we have done this by creating the "Sale" category and replicating the standard category tree beneath that and assigning products to those categories.



    This quickly becomes un-manageable for a large catalogue, and when special prices end it is almost impossible to remember to remove the items from the Sale categories. A previous dev tried scripting the removal of products from sale categories but I don't feel that is the right approach either.



    This guide from Inchoo looks like it will help me achieve most of what I want. The missing part is how I could implement the normal (/) and sale (/sale/) category URL structure.



    Any ideas how I may handle this?










    share|improve this question
















    bumped to the homepage by Community 4 hours ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      1












      1








      1


      1






      In Magento 1.9.2.x I would like to create a custom module that will show all sale items (anything with a current special price) within a different section of the store but retaining the normal category hierarchy/structure and filtered navigation etc.



      Example:



      Standard category URLs showing non-sale items:



      /books/
      /videos/
      /games/


      New URLs showing only sale items within those same categories:



      /sale/books/
      /sale/videos/
      /sale/games/


      Previously we have done this by creating the "Sale" category and replicating the standard category tree beneath that and assigning products to those categories.



      This quickly becomes un-manageable for a large catalogue, and when special prices end it is almost impossible to remember to remove the items from the Sale categories. A previous dev tried scripting the removal of products from sale categories but I don't feel that is the right approach either.



      This guide from Inchoo looks like it will help me achieve most of what I want. The missing part is how I could implement the normal (/) and sale (/sale/) category URL structure.



      Any ideas how I may handle this?










      share|improve this question
















      In Magento 1.9.2.x I would like to create a custom module that will show all sale items (anything with a current special price) within a different section of the store but retaining the normal category hierarchy/structure and filtered navigation etc.



      Example:



      Standard category URLs showing non-sale items:



      /books/
      /videos/
      /games/


      New URLs showing only sale items within those same categories:



      /sale/books/
      /sale/videos/
      /sale/games/


      Previously we have done this by creating the "Sale" category and replicating the standard category tree beneath that and assigning products to those categories.



      This quickly becomes un-manageable for a large catalogue, and when special prices end it is almost impossible to remember to remove the items from the Sale categories. A previous dev tried scripting the removal of products from sale categories but I don't feel that is the right approach either.



      This guide from Inchoo looks like it will help me achieve most of what I want. The missing part is how I could implement the normal (/) and sale (/sale/) category URL structure.



      Any ideas how I may handle this?







      magento-1.9 module special-price






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 6 '18 at 11:14









      Murtuza Zabuawala

      12.7k73362




      12.7k73362










      asked May 6 '16 at 7:46









      BlueCBlueC

      536415




      536415





      bumped to the homepage by Community 4 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 4 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          you could write a custom module and register 'sale' as its frontname and the category's url_key as a parameter (eg. /sale/category/books)
          i have some hints here for you regarding loading the products. when you want to have all filters available from the layered nav you should load the products via the catalog/layer model...



          Namespace/Module/config.xml:



          <frontend>
          <routers>
          <saleproducts>
          <use>standard</use>
          <args>
          <module>Namespace_Module</module>
          <frontName>sale</frontName>
          </args>
          </saleproducts>
          </routers>
          <layout>
          <updates>
          <saleproducts>
          <file>sale.xml</file>
          </saleproducts>
          </updates>
          </layout>
          </frontend>


          Namespace/Module/controllers/IndexController.php:



          class Namespace_Module_IndexController extends Mage_Core_Controller_Front_Action

          public function indexAction()

          $this->loadLayout();
          $this->renderLayout();




          in the layout file /design/frontend/base/default/layout/sale.xml:



          <?xml version="1.0"?>
          <layout version="0.1.0">
          <sale_index_index>
          <reference name="content">
          <block type="sale/product_list" name="product_list" template="catalog/product/list.phtml">
          <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
          <block type="page/html_pager" name="product_list_toolbar_pager"/>
          </block>
          <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
          <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
          <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
          <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
          <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
          <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
          </block>
          </reference>
          </sale_index_index>
          </layout>


          and a Block in Namespace/Module/Block/Product/List.php :



          class Namespace_Module_Block_Product_List extends Mage_Catalog_Block_Product_List
          {
          protected function _getProductCollection()


          $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($this->getRequest()->getCategory(), 'url_key');
          Mage::register('current_category', $category);
          $productCollection = Mage::getSingleton('catalog/layer')->getProductCollection();

          return $productCollection;







          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f114221%2freplicate-category-pages-to-show-just-sale-products%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            you could write a custom module and register 'sale' as its frontname and the category's url_key as a parameter (eg. /sale/category/books)
            i have some hints here for you regarding loading the products. when you want to have all filters available from the layered nav you should load the products via the catalog/layer model...



            Namespace/Module/config.xml:



            <frontend>
            <routers>
            <saleproducts>
            <use>standard</use>
            <args>
            <module>Namespace_Module</module>
            <frontName>sale</frontName>
            </args>
            </saleproducts>
            </routers>
            <layout>
            <updates>
            <saleproducts>
            <file>sale.xml</file>
            </saleproducts>
            </updates>
            </layout>
            </frontend>


            Namespace/Module/controllers/IndexController.php:



            class Namespace_Module_IndexController extends Mage_Core_Controller_Front_Action

            public function indexAction()

            $this->loadLayout();
            $this->renderLayout();




            in the layout file /design/frontend/base/default/layout/sale.xml:



            <?xml version="1.0"?>
            <layout version="0.1.0">
            <sale_index_index>
            <reference name="content">
            <block type="sale/product_list" name="product_list" template="catalog/product/list.phtml">
            <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
            <block type="page/html_pager" name="product_list_toolbar_pager"/>
            </block>
            <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
            <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
            <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
            <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
            <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
            <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
            </block>
            </reference>
            </sale_index_index>
            </layout>


            and a Block in Namespace/Module/Block/Product/List.php :



            class Namespace_Module_Block_Product_List extends Mage_Catalog_Block_Product_List
            {
            protected function _getProductCollection()


            $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($this->getRequest()->getCategory(), 'url_key');
            Mage::register('current_category', $category);
            $productCollection = Mage::getSingleton('catalog/layer')->getProductCollection();

            return $productCollection;







            share|improve this answer





























              0














              you could write a custom module and register 'sale' as its frontname and the category's url_key as a parameter (eg. /sale/category/books)
              i have some hints here for you regarding loading the products. when you want to have all filters available from the layered nav you should load the products via the catalog/layer model...



              Namespace/Module/config.xml:



              <frontend>
              <routers>
              <saleproducts>
              <use>standard</use>
              <args>
              <module>Namespace_Module</module>
              <frontName>sale</frontName>
              </args>
              </saleproducts>
              </routers>
              <layout>
              <updates>
              <saleproducts>
              <file>sale.xml</file>
              </saleproducts>
              </updates>
              </layout>
              </frontend>


              Namespace/Module/controllers/IndexController.php:



              class Namespace_Module_IndexController extends Mage_Core_Controller_Front_Action

              public function indexAction()

              $this->loadLayout();
              $this->renderLayout();




              in the layout file /design/frontend/base/default/layout/sale.xml:



              <?xml version="1.0"?>
              <layout version="0.1.0">
              <sale_index_index>
              <reference name="content">
              <block type="sale/product_list" name="product_list" template="catalog/product/list.phtml">
              <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
              <block type="page/html_pager" name="product_list_toolbar_pager"/>
              </block>
              <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
              <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
              <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
              <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
              <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
              <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
              </block>
              </reference>
              </sale_index_index>
              </layout>


              and a Block in Namespace/Module/Block/Product/List.php :



              class Namespace_Module_Block_Product_List extends Mage_Catalog_Block_Product_List
              {
              protected function _getProductCollection()


              $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($this->getRequest()->getCategory(), 'url_key');
              Mage::register('current_category', $category);
              $productCollection = Mage::getSingleton('catalog/layer')->getProductCollection();

              return $productCollection;







              share|improve this answer



























                0












                0








                0







                you could write a custom module and register 'sale' as its frontname and the category's url_key as a parameter (eg. /sale/category/books)
                i have some hints here for you regarding loading the products. when you want to have all filters available from the layered nav you should load the products via the catalog/layer model...



                Namespace/Module/config.xml:



                <frontend>
                <routers>
                <saleproducts>
                <use>standard</use>
                <args>
                <module>Namespace_Module</module>
                <frontName>sale</frontName>
                </args>
                </saleproducts>
                </routers>
                <layout>
                <updates>
                <saleproducts>
                <file>sale.xml</file>
                </saleproducts>
                </updates>
                </layout>
                </frontend>


                Namespace/Module/controllers/IndexController.php:



                class Namespace_Module_IndexController extends Mage_Core_Controller_Front_Action

                public function indexAction()

                $this->loadLayout();
                $this->renderLayout();




                in the layout file /design/frontend/base/default/layout/sale.xml:



                <?xml version="1.0"?>
                <layout version="0.1.0">
                <sale_index_index>
                <reference name="content">
                <block type="sale/product_list" name="product_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                <block type="page/html_pager" name="product_list_toolbar_pager"/>
                </block>
                <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </block>
                </reference>
                </sale_index_index>
                </layout>


                and a Block in Namespace/Module/Block/Product/List.php :



                class Namespace_Module_Block_Product_List extends Mage_Catalog_Block_Product_List
                {
                protected function _getProductCollection()


                $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($this->getRequest()->getCategory(), 'url_key');
                Mage::register('current_category', $category);
                $productCollection = Mage::getSingleton('catalog/layer')->getProductCollection();

                return $productCollection;







                share|improve this answer















                you could write a custom module and register 'sale' as its frontname and the category's url_key as a parameter (eg. /sale/category/books)
                i have some hints here for you regarding loading the products. when you want to have all filters available from the layered nav you should load the products via the catalog/layer model...



                Namespace/Module/config.xml:



                <frontend>
                <routers>
                <saleproducts>
                <use>standard</use>
                <args>
                <module>Namespace_Module</module>
                <frontName>sale</frontName>
                </args>
                </saleproducts>
                </routers>
                <layout>
                <updates>
                <saleproducts>
                <file>sale.xml</file>
                </saleproducts>
                </updates>
                </layout>
                </frontend>


                Namespace/Module/controllers/IndexController.php:



                class Namespace_Module_IndexController extends Mage_Core_Controller_Front_Action

                public function indexAction()

                $this->loadLayout();
                $this->renderLayout();




                in the layout file /design/frontend/base/default/layout/sale.xml:



                <?xml version="1.0"?>
                <layout version="0.1.0">
                <sale_index_index>
                <reference name="content">
                <block type="sale/product_list" name="product_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                <block type="page/html_pager" name="product_list_toolbar_pager"/>
                </block>
                <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </block>
                </reference>
                </sale_index_index>
                </layout>


                and a Block in Namespace/Module/Block/Product/List.php :



                class Namespace_Module_Block_Product_List extends Mage_Catalog_Block_Product_List
                {
                protected function _getProductCollection()


                $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($this->getRequest()->getCategory(), 'url_key');
                Mage::register('current_category', $category);
                $productCollection = Mage::getSingleton('catalog/layer')->getProductCollection();

                return $productCollection;








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 11 '16 at 12:54

























                answered May 11 '16 at 12:41









                roman204roman204

                763415




                763415



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f114221%2freplicate-category-pages-to-show-just-sale-products%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                    How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2

                    Nissan Patrol Зміст Перше покоління — 4W60 (1951-1960) | Друге покоління — 60 series (1960-1980) | Третє покоління (1980–2002) | Четверте покоління — Y60 (1987–1998) | П'яте покоління — Y61 (1997–2013) | Шосте покоління — Y62 (2010- ) | Посилання | Зноски | Навігаційне менюОфіційний український сайтТест-драйв Nissan Patrol 2010 7-го поколінняNissan PatrolКак мы тестировали Nissan Patrol 2016рвиправивши або дописавши її