finnenhawke Posted April 1, 2019 Share Posted April 1, 2019 (edited) I either do not understand the intent behind the way it works or there is a bug with displaying specific references. As you know, in PrestaShop you can set up ISBN, EAN-13 and UPC codes (references) for each product. It is done in "Options" tab when editing the product ("Condition & References" section). As I understand, these codes should show up in the product details section called "Specific References". Except they don't, because that section doesn't show up, even though there is a code for it in product-details.tpl: {* if product have specific references, a table will be added to product details section *} {block name='product_specific_references'} {if !empty($product.specific_references)} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> {foreach from=$product.specific_references item=reference key=key} <dt class="name">{$key}</dt> <dd class="value">{$reference}</dd> {/foreach} </dl> </section> {/if} {/block} However, when I change the product type from "Simple product" to "Product with combinations" and add a single combination (without adding any specific references to that individual combination), these references from "OPTIONS > Conditions & References" tab immediately show up! What's more, when I even go one step further and set individual ISBN/EAN-13/UPC codes for each combination, they also show up and switch correctly. So it's working fine, but for some reason it's not working on product without combinations. Is this intended? Why can't it work the same for simple product and show the ISBN/EAN13/UPC? If it's not intended then it must be a bug in PrestaShop that prevents showing Specific References in "Simple products". Is there any way I could fix this? I know that I can manually force showing EAN-13/ISBN/UPC codes by adding it directly to product.tpl file. However, it's not a good fix. It will work for simple products, but on "products with combinations" it will be a mess since the specific references will show up twice (from my forced code AND from the above code that works only on products with combinations). Is there any way that I could fix this? Or is there any way I could create code similar to the above that is limited only to simple products? Something that would work like that "IF Product Type = Simple Product SHOW [ EAN13 / ISBN / UPC ]". Sadly, I don't know Smarty and PHP so it's very hard for me to put this logic into actual code. I know how to call for EAN/ISBN/UPC code but I don't know how to limit that "call" only to "simple products". Edited April 1, 2019 by finnenhawke (see edit history) 1 Link to comment Share on other sites More sharing options...
www.TopToners.com Posted July 17, 2019 Share Posted July 17, 2019 I've found this problem too. Hopefully PrestaShop will soon have a resolve for this issue. Mark www.TopToners.com Link to comment Share on other sites More sharing options...
marijn Posted April 14, 2020 Share Posted April 14, 2020 Hello, I've found this issue as well. I'm on Prestashop version 1.7.6. and the issue is still there... Anyone know of a fix by now? Link to comment Share on other sites More sharing options...
danbby Posted May 13, 2020 Share Posted May 13, 2020 Same problem. Link to comment Share on other sites More sharing options...
Tomsleter Posted July 2, 2020 Share Posted July 2, 2020 I have the same problem. Link to comment Share on other sites More sharing options...
cedrowa Posted September 6, 2021 Share Posted September 6, 2021 Hi, I have a partial solution for EAN codes. In the public_html / themes / (template-name) /templates/catalog/_partials/product-details.tpl file, the following code should be added to the condition around line 80, between {/if} and {/block} {if isset($product.ean13) && $product.ean13 neq ''} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> <dt class="name">{l s='EAN' d='Shop.Theme.Catalog'}</dt> <dd class="value">{$product.ean13}</dd> </dl> </section> {/if} This is the second (additional) condition to the existing one. In total, this code snippet should look like this: {* if product have specific references, a table will be added to product details section *} {block name='product_specific_references'} {if !empty($product.specific_references)} <div class="specific-references"> {foreach from=$product.specific_references item=reference key=key} <div> <label class="label">{$key}</label> <span>{$reference}</span> </div> {/foreach} </div> {/if} {if isset($product.ean13) && $product.ean13 neq ''} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> <dt class="name">{l s='EAN' d='Shop.Theme.Catalog'}</dt> <dd class="value">{$product.ean13}</dd> </dl> </section> {/if} {/block} Presta 1.7.7.4 Remember to make a copy of this file before modifying! 2 1 Link to comment Share on other sites More sharing options...
SIWA_Fabian Posted November 9, 2021 Share Posted November 9, 2021 On 9/6/2021 at 2:21 PM, cedrowa said: Hi, I have a partial solution for EAN codes. In the public_html / themes / (template-name) /templates/catalog/_partials/product-details.tpl file, the following code should be added to the condition around line 80, between {/if} and {/block} {if isset($product.ean13) && $product.ean13 neq ''} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> <dt class="name">{l s='EAN' d='Shop.Theme.Catalog'}</dt> <dd class="value">{$product.ean13}</dd> </dl> </section> {/if} This is the second (additional) condition to the existing one. In total, this code snippet should look like this: {* if product have specific references, a table will be added to product details section *} {block name='product_specific_references'} {if !empty($product.specific_references)} <div class="specific-references"> {foreach from=$product.specific_references item=reference key=key} <div> <label class="label">{$key}</label> <span>{$reference}</span> </div> {/foreach} </div> {/if} {if isset($product.ean13) && $product.ean13 neq ''} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> <dt class="name">{l s='EAN' d='Shop.Theme.Catalog'}</dt> <dd class="value">{$product.ean13}</dd> </dl> </section> {/if} {/block} Presta 1.7.7.4 Remember to make a copy of this file before modifying! I enhanced this solution, since in my Theme (Warehouse) it lead to EANs beeing output twice on products with Variants. This solution prevents that: {block name='product_specific_references'} {if !empty($product.specific_references)} <div class="specific-references"> {foreach from=$product.specific_references item=reference key=key} <div> <label class="label">{$key}</label> <span>{$reference}</span> </div> {/foreach} </div> {elseif isset($product.ean13) && $product.ean13 neq ''} <div class="specific-references"> <div> <label class="label">{l s='ean13' d='Shop.Theme.Catalog'}</label> <span>{$product.ean13}</span> </div> </div> {/if} {/block} Hope it helps somebody else. 1 1 Link to comment Share on other sites More sharing options...
Yulia Vitun Posted August 8, 2022 Share Posted August 8, 2022 my solution code for classic theme: /themes/classic/templates/catalog/_partials/product-details.tpl file - added lines 82-89 {elseif isset($product.ean13) && $product.ean13 neq ''} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> <dt class="name">{l s='ean13' d='Shop.Theme.Catalog'}</dt> <dd class="value">{$product.ean13}</dd> </dl> </section> - final view of lines 70-91: {* if product have specific references, a table will be added to product details section *} {block name='product_specific_references'} {if !empty($product.specific_references)} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> {foreach from=$product.specific_references item=reference key=key} <dt class="name">{$key}</dt> <dd class="value">{$reference}</dd> {/foreach} </dl> </section> {elseif isset($product.ean13) && $product.ean13 neq ''} <section class="product-features"> <p class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</p> <dl class="data-sheet"> <dt class="name">{l s='ean13' d='Shop.Theme.Catalog'}</dt> <dd class="value">{$product.ean13}</dd> </dl> </section> {/if} {/block} - example attached: 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