tanmalik786 Posted November 16, 2020 Share Posted November 16, 2020 Hi there, I am just about finalizing my first store [for a client] to go live, have come across a challenge, that's "need to setup a 'Best Sellers' section in my store's home page BUT display this label only when there's some Top Seller Products available to display in this section?" Is this even possible? Note: I am using 'Creative Elements' as the page builder, if it helps? TIA Link to comment Share on other sites More sharing options...
Guest Posted November 16, 2020 Share Posted November 16, 2020 Yes, it is possible. If you also tell us the version of Prestashop, you will also get help 😁 Link to comment Share on other sites More sharing options...
tanmalik786 Posted November 16, 2020 Author Share Posted November 16, 2020 2 hours ago, Guest said: Yes, it is possible. If you also tell us the version of Prestashop, you will also get help 😁 I am using v1.7.6.8 Link to comment Share on other sites More sharing options...
Guest Posted November 16, 2020 Share Posted November 16, 2020 ./modules/ps_bestsellers/views/templates/hook/ps_bestsellers.tpl original: <section> <h1>{l s='Best Sellers' d='Modules.Bestsellers.Shop'}</h1> <div class="products"> {foreach from=$products item="product"} {include file="catalog/_partials/miniatures/product.tpl" product=$product} {/foreach} </div> <a href="{$allBestSellers}">{l s='All best sellers' d='Modules.Bestsellers.Shop'}</a> </section> new: {if $products} <section> <h1>{l s='Best Sellers' d='Modules.Bestsellers.Shop'}</h1> <div class="products"> {foreach from=$products item="product"} {include file="catalog/_partials/miniatures/product.tpl" product=$product} {/foreach} </div> <a href="{$allBestSellers}">{l s='All best sellers' d='Modules.Bestsellers.Shop'}</a> </section> {/if} ./modules/ps_bestsellers/ps_bestsellers.php original function: public function getWidgetVariables($hookName, array $configuration) { $products = $this->getBestSellers(); if (!empty($products)) { return array( 'products' => $products, 'allBestSellers' => Context::getContext()->link->getPageLink('best-sales'), ); } return false; } new function: public function getWidgetVariables($hookName, array $configuration) { $products = $this->getBestSellers(); if (!empty($products)) { return array( 'products' => $products, 'allBestSellers' => Context::getContext()->link->getPageLink('best-sales'), ); } else { return array( 'products' => '', 'allBestSellers' => '', ); } return false; } Link to comment Share on other sites More sharing options...
tanmalik786 Posted November 16, 2020 Author Share Posted November 16, 2020 Thank you so much @D.Tengler I will certainly give it a try and leave a comment note here! Link to comment Share on other sites More sharing options...
tanmalik786 Posted November 18, 2020 Author Share Posted November 18, 2020 Hi @D Tengler, I did give it a try indeed BUT since I used "Creative Elements" so it became irrelevant - BUT surely I did learn something new. Thanks a lot for your help. Link to comment Share on other sites More sharing options...
Guest Posted November 18, 2020 Share Posted November 18, 2020 Unfortunately, Creative Elements and various Page Builder modules use custom solutions and custom modules. As soon as I get such an e-shop, I leave 🙂 because they are confusing. I'd love to help, but I don't have Creative Elements. Link to comment Share on other sites More sharing options...
tanmalik786 Posted November 18, 2020 Author Share Posted November 18, 2020 4 hours ago, Guest said: Unfortunately, Creative Elements and various Page Builder modules use custom solutions and custom modules. As soon as I get such an e-shop, I leave 🙂 because they are confusing. I'd love to help, but I don't have Creative Elements. Thanks a lot man for your help, I have experience using 'Elementor' for WordPress so thought it will be helpful .. this tool as of now is far from complete [feature wise] I believe. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now