Jump to content


This topic is now archived and is closed to further replies.


[Resolved} Sales Items on Homepage

Recommended Posts

Hi all,

Is there away to replace the (Latest Products) displayed on home page with the (Sales Items)

I know the key to this is in the "content.homepage" within here, but can not figure-out where to find the replacement code to display sales items instead

<div id="content_latest_products">
   <ul class="small-block-grid-1 medium-block-grid-3 large-block-grid-3" data-equalizer>
      {foreach from=$LATEST_PRODUCTS item=product}


Thanks for any help



Share this post

Link to post
Share on other sites

You can keep the template code the same. The template will show the sale items no differently than the latest products.

What needs to happen is for CubeCart to make a database query similar to the pseudo-category "Sale Items" and then give the resulting dataset to the template variable LATEST_PRODUCTS.

Looking at CubeCart->displayHomePage(), we see that the code makes queries for, and processes a dataset for, the Latest Products. At the end of all that processing, the $products array is assigned to 'LATEST_PRODUCTS'.

However, just before the template rendering engine builds the HTML with that data, there is a "hook" we can use to call Catalogue->searchCatalogue(), which is what is used to show the Sale Items page. We can assign the resultant array of sale items back to LATEST_PRODUCTS.

This is, obviously, an overview, and several factoids about CubeCart's program flow are necessary to understand.

There is an extension that has this all figured out: https://www.cubecart.com/extensions/plugins/homepage-sale-products


Share this post

Link to post
Share on other sites

This is how I solved this;

with help from your clue above Since I only needed a "cosmetic" solution

I changed  "Latest Products" to "Top Deals" in  "language/definitions.xml"  

It works perfectly for me since I only plan to have a maximum of 30 products for sale per week!

Thank you

Share this post

Link to post
Share on other sites

I'll mark this as resolved. But if you find your method cumbersome, you can always comment again here and I'll remove the resolved until you are satisfied.

Share this post

Link to post
Share on other sites