Custom Layout For Sales

I'm trying to have a page that will display the on sale products.

I think I could use the products.on_sale or products.final_sale values, but the /index.php?dispatch=products.on_sale page use the default layout and I want to display a layout similar as categories.

I tried to make a custom layout with a dispatch value (example "sales"), but the url /index.php?dispatch=sales always returns a 404.

Anyone can explain how to do this ?

Hi there,

For this you need to follow following steps:

  1. go to Design > Layout
  2. Now click on Add layout page…
  3. Now on dispatch choose Custom
  4. Write your dispatch value (in your case "products.on_sale")
  5. Give any desired name and page title.

After creating new layout switch to new your newly created layout.

Now you need to add new block for main content to show.

  1. Click on add grid option in content section
  2. Now make a grid of 16 width
  3. After creating new grid click on add block.
  4. Now choose Main Content block.

After all steps goto front end and hit your site with dispatch=products.on_sale

Thank you.

Note that the On sale page which is created by the Bestsellers module does not take into account promotions. It means that it will show only products with price != list price.

Thanks himanshudangwal ! It works.

The only thing I cannot display on the new page is my filters. Do you know if the filters should work on this page ?

Hello Pascal,

I have tried adding product option block but it is not working.

thanks.

The locations for block with filters are hardcoded in the app/functions/fn.catalog.php file.

$valid_locations = array(
            'categories.view',
            'product_features.view',
            'companies.products',
            'products.search'
        );

Try to add new location here

You may check On sale products page addon which will meet all your needs.

The locations for block with filters are hardcoded in the app/functions/fn.catalog.php file.

$valid_locations = array(
            'categories.view',
            'product_features.view',
            'companies.products',
            'products.search'
        );

Try to add new location here

This works perfectly, the location makes the filters appear on the On Sale page, however the filters are not connected to the products displayed here

When I select a filter, it should automatically display the products, but in this case, I need to select the filter and then refresh the page to get the correct products. Any advice on how to connect the filter to the products on the page?

This works perfectly, the location makes the filters appear on the On Sale page, however the filters are not connected to the products displayed here

When I select a filter, it should automatically display the products, but in this case, I need to select the filter and then refresh the page to get the correct products. Any advice on how to connect the filter to the products on the page?

It is required to examine the issue. Looks like some parameters which allows to reload products are missed

It is required to examine the issue. Looks like some parameters which allows to reload products are missed

So besides inserting the location in the fn.catalog.php file is there any other code insertion that is required anywhere else?

So besides inserting the location in the fn.catalog.php file is there any other code insertion that is required anywhere else?

Code review is required to answer on your questions. As far as I know, no extra changes were required on previous CS-Cart versions

The locations for block with filters are hardcoded in the app/functions/fn.catalog.php file.

$valid_locations = array(
            'categories.view',
            'product_features.view',
            'companies.products',
            'products.search'
        );

Try to add new location here

For the On sale page I have inserted the location to be 'products.on_sale' - is this right?

For the On sale page I have inserted the location to be 'products.on_sale' - is this right?

Right