SergeiG Posted May 23, 2017 Share Posted May 23, 2017 (edited) Hello! I would really appreciate if somebody explains me how to show 'featured' products on the main page instead of 'latest' products. Thank you Edited May 30, 2017 by SergeiG Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 23, 2017 Share Posted May 23, 2017 I tried swapping the code in content.homepage.php that creates the Latest Product section with the comparable code in box.featured.php, but it didn't work. I'm sure it can be done, but not by me. Sorry. Please add your skin to your signature, and if you upgrade CC be sure to change that, too. Thanks for making one!! It saves time. IF you're not dealing with a large number of products, you could disable Latest on all of them, enable Featured on all you want, and then use the Language setting in Admin to change the wording of Latest Products to what you want. That has the advantage that it will not make any core edits and will not be lost on upgrade. Quote Link to comment Share on other sites More sharing options...
keat Posted May 25, 2017 Share Posted May 25, 2017 (edited) If we want to promote any particular products, then we do what DB has suggested. rather than using 'Latest Products' to display the latest products, we use it to display products that we wish to promote. In the languages section change the wording of 'Latest Products' to 'Anything You want' Then anything you wish to display in this area just ensure the 'Include in latest products' check box ticked. Edited May 26, 2017 by keat Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 25, 2017 Share Posted May 25, 2017 Yes, I just re-read my suggestion and realized it didn't make sense. Take Latest off any you don't want to Feature. Then change the wording for Latest. Quote Link to comment Share on other sites More sharing options...
SergeiG Posted May 25, 2017 Author Share Posted May 25, 2017 2 hours ago, Dirty Butter said: Yes, I just re-read my suggestion and realized it didn't make sense. Take Latest off any you don't want to Feature. Then change the wording for Latest. 6 hours ago, keat said: If we want to promote any particular products, then we do what DB has suggested. rather than using 'Latest Products' to display the latest products, we use it to display products that we wish to promote. In the languages section change the wording of 'Lastest Products' to 'Anything You want' Then anything you wish to display in this area just ensure the 'Include in latest products' check box ticked. Thank you for advice, I almost complete this way of realization my idea. However, there is one huge difference between these two lists which I wanted to use - the feature list isn't stable, it changes randomly. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 25, 2017 Share Posted May 25, 2017 There should be some way to randomize your "Latest" products. But I'm not the one to code it. I'll do some forum searching and maybe I can find it. Sorry, but I didn't find anything in the forum that would help you. Quote Link to comment Share on other sites More sharing options...
keat Posted May 26, 2017 Share Posted May 26, 2017 (edited) I used this in 6.0.10 for a while, it may still work in later versions. in classes/cubecart.class.php change $GLOBALS['smarty']->assign('LATEST_PRODUCTS', $products); To: $lp_rand_keys = array_rand($products, 6); // Make sure there are 3 or more 'featured' products foreach ($lp_rand_keys as $rand_key) $lp_rand_products[$rand_key] = $products[$rand_key]; $products = $lp_rand_products; $GLOBALS['smarty']->assign('LATEST_PRODUCTS', $products); This will limit the amount of 'latest products' to 6 (so change if you require more), and then with each page refresh, those 6 products will change randomly. Not my work by the way, so I can't take any credit. Edited May 26, 2017 by keat 1 Quote Link to comment Share on other sites More sharing options...
SergeiG Posted May 29, 2017 Author Share Posted May 29, 2017 On 5/26/2017 at 2:50 AM, keat said: I used this in 6.0.10 for a while, it may still work in later versions. in classes/cubecart.class.php change $GLOBALS['smarty']->assign('LATEST_PRODUCTS', $products); To: $lp_rand_keys = array_rand($products, 6); // Make sure there are 3 or more 'featured' products foreach ($lp_rand_keys as $rand_key) $lp_rand_products[$rand_key] = $products[$rand_key]; $products = $lp_rand_products; $GLOBALS['smarty']->assign('LATEST_PRODUCTS', $products); This will limit the amount of 'latest products' to 6 (so change if you require more), and then with each page refresh, those 6 products will change randomly. Not my work by the way, so I can't take any credit. Great thank you! It works absolutely fine! Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 29, 2017 Share Posted May 29, 2017 Fantastic! Posters have only recently had the ability on this forum to add RESOLVED to the original post title. Simply edit that original post and add it in. THANKS! 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.