Jump to content

[Resolved} Sales Items on Homepage


bobyan

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

{/if}
{if $LATEST_PRODUCTS}
<div id="content_latest_products">
   <h2>{$LANG.catalogue.latest_products}</h2>
   <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

 

 

Link to comment
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

 

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...