bobyan Posted February 13, 2017 Share Posted February 13, 2017 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 Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 14, 2017 Share Posted February 14, 2017 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 Quote Link to comment Share on other sites More sharing options...
bobyan Posted February 18, 2017 Author Share Posted February 18, 2017 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 Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 18, 2017 Share Posted February 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.