Jump to content
ccarlos.lima2

Hide reference number in front office prestashop 1. 7

Recommended Posts

Can someone please tell me how to hide the reference number/code in the front office?

I´m using prestashop 1.7.0.4 and the Classic Theme.

Thanks in advance!

Share this post


Link to post
Share on other sites

Edit /themes/classic/templates/catalog/_partials/product_details.tpl

 

and comment lines 20-25:

    {if isset($product.reference_to_display)}
      <div class="product-reference">
        <label class="label">{l s='Reference' d='Shop.Theme.Catalog'} </label>
        <span itemprop="sku">{$product.reference_to_display}</span>
      </div>
    {/if}

so they are like this:

    {* if isset($product.reference_to_display)}
      <div class="product-reference">
        <label class="label">{l s='Reference' d='Shop.Theme.Catalog'} </label>
        <span itemprop="sku">{$product.reference_to_display}</span>
      </div>
    {/if *}

Cheers.

  • Like 2

Share this post


Link to post
Share on other sites

Yes it worked for a "Simple product" 

But, it not working on "Product with combinations"  :huh2:

 

Any idea?

Share this post


Link to post
Share on other sites

Yes it worked for a "Simple product" 

But, it not working on "Product with combinations"  :huh2:

 

Any idea?

 

Post link to site please. It does work on my end.

Share this post


Link to post
Share on other sites

 

 

Does anyone know how to hide the same reference number in version 1.6? 

Thanks a lot!!

Share this post


Link to post
Share on other sites

Open product.tpl from your theme directory. If its a default theme, then you will find this at around line 159 and following:

            <p id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>
                <label>{l s='Reference:'} </label>
                <span class="editable" itemprop="sku"{if !empty($product->reference) && $product->reference} content="{$product->reference}"{/if}>{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>
            </p>

Set begin comment {* before the first paragraph and end comment *} after closing paragraph. However, this only the part which displays product details on front page. The same reference might be used on the product comparison, cart, delivery slip, invoice and order details page.

 

Kicking them out is mostly the same behavior. If the data is part of a table, then it could make sense to use the $id_product as reference instead.
 

Edited by Scully (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hi 

We have version 1.7.2

Can somebody help us to change the script in .tpl file as coding is different the given on this topic

Thanks

Share this post


Link to post
Share on other sites

Hello all, noob here. Where do I find the lines to edit? 

Another unrelated question, I have a problem with shipping charges where the shopping cart shows "Free Shipping" even though I have set the price for shipping. I use Classic theme. Please help!

Share this post


Link to post
Share on other sites
On 2/16/2017 at 4:38 AM, w3bsolutions said:

Edit /themes/classic/templates/catalog/_partials/product_details.tpl

 

and comment lines 20-25:


    {if isset($product.reference_to_display)}
      <div class="product-reference">
        <label class="label">{l s='Reference' d='Shop.Theme.Catalog'} </label>
        <span itemprop="sku">{$product.reference_to_display}</span>
      </div>
    {/if}

so they are like this:


    {* if isset($product.reference_to_display)}
      <div class="product-reference">
        <label class="label">{l s='Reference' d='Shop.Theme.Catalog'} </label>
        <span itemprop="sku">{$product.reference_to_display}</span>
      </div>
    {/if *}

Cheers.

In PS 1.7.6 the code in this file is below. What should I comment out to remove the reference number? Thanks.

  {* if product have specific references, a table will be added to product details section *}
  {block name='product_specific_references'}
    {if isset($product.specific_references)}
      <section class="product-features">
        <h3 class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</h3>
          <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}

 

Share this post


Link to post
Share on other sites

In 1.7.6 file to edit is /themes/yourtheme/templates/catalog/product.tpl

I commented out the whole section below lines 114 - 135 because I don't want the manufacturers logo either. Added a  <br> under it so things don't look too tight on product page.

 

            {*{block name='product_reference'}
                {if isset($product_manufacturer->id)}
                  <div class="product-manufacturer">
                    {if isset($manufacturer_image_url)}
                      <a href="{$product_brand_url}">
                        <img src="{$manufacturer_image_url}" class="img img-thumbnail manufacturer-logo" />
                      </a>
                    {else}
                      <label class="label">{l s='Brand' d='Shop.Theme.Catalog'}</label>
                      <span>
                        <a href="{$product_brand_url}">{$product_manufacturer->name}</a>
                      </span>
                    {/if}
                  </div>
                {/if}
                {if isset($product.reference_to_display)}
                  <div class="product-reference">
                    <label class="label">{l s='Reference' d='Shop.Theme.Catalog'} </label>
                    <span itemprop="sku">{$product.reference_to_display}</span>
                  </div>
                {/if}
              {/block}*}
<br>

 

Edited by Dan1 (see edit history)

Share this post


Link to post
Share on other sites

Hi, how are you?

I want to add an update, actually if you want to hide the reference number on prestashop 1.7.6.3 you need to go to 

/var/www/html/site/themes/the theme that you have/templates if you have it/catalog/_partials

Inside of these you need to comment with * * the code with whose name is products-details.tpl 

 

{* if isset($product.reference_to_display) && $product.reference_to_display neq ''}
      <div class="product-reference">
        <label class="label">{l s='Reference' d='Shop.Theme.Catalog'} </label>
        <span itemprop="sku">{$product.reference_to_display}</span>
      </div>
    {/if *}
  {/block}

you can ctrl + F to finde reference and there you have it :D

Have a good day.

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