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;
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
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.
add a comment |
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
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.
add a comment |
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
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
magento-1.9 module special-price
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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;
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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;
add a comment |
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;
add a comment |
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;
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;
edited May 11 '16 at 12:54
answered May 11 '16 at 12:41
roman204roman204
763415
763415
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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