Jump to content
finnenhawke

ISBN/EAN-13/UPC references show up ONLY if product has combinations - PrestaShop 1.7.5.1

Recommended Posts

Posted (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 by finnenhawke (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More