dtwfung Posted April 15, 2015 Share Posted April 15, 2015 Hi There, With the great help on this thread https://www.prestashop.com/forums/topic/352356-product-reference-in-product-list-prestashop-16/ in product-list.tpl, <p id="product_reference"{if empty($product.reference) || !$product.reference} style="display: none;"{/if}> <label>{l s='Model#:'} </label> <span class="editable" itemprop="sku">{$product.reference}</span> </p> I'm able to make product reference number displayed on grid, list view and "popular" (homefeature) . But strange behavior on "Best Seller block" (BestSellerBlock). Some with reference number display and some have not. (p.s. all products have reference number) if I just put this instead <label>{l s='Model#:'} </label> {$product.reference} I got this error in those products had NO reference shown before Model#:XXX/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 200 Any things I have missed ... note: I am using 1.6.0.14 and standard theme. Thanks in advance. Link to comment Share on other sites More sharing options...
Tuni-Soft Posted April 15, 2015 Share Posted April 15, 2015 (edited) Take a look at the file classes/ProductSale.php method: getBestSalesLight In the SQL there, the reference is not selected, you need to add it to the query Add this code after the first select p.reference, So it becomes like this $sql = ' SELECT p.reference, ...... Of course, modifying directly on core files is not recommended because updates will be more difficult You need to override the method Copy the attached file, to the folder override/classes/ if the file ProductSale.php exists, copy the method inside it, and then clear PrestaShop cache to refresh the overrides More on overrides here ProductSale.zip Edited April 15, 2015 by Tuni-Soft (see edit history) 1 Link to comment Share on other sites More sharing options...
dtwfung Posted April 16, 2015 Author Share Posted April 16, 2015 Many thanks for your information. I fixed the problem. Thanks again. 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