Jump to content

PHP foreach loop - Display combinations reference


Noise2000

Recommended Posts

Hello!
I try to display the combination reference or product reference (if no combinations available) in a custom quotation page.

I land there coming from a product page after adding the product in cart. Other product elements as Name, Link or Image are displayed as expected..

I tried adding {$product.reference|escape:'htmlall':'UTF-8'} code  in the foreach loop and I get nothing.

Prestashop 1,6

Can anyone help me?

 

 

<div id="fmm_quote_from">
    <!-- {$products|@var_dump} -->
    {if isset($products) && $products}
    <div class="fmm_content_holder">
        <ul>                 
            {foreach from=$products item=product name=products}
            <li>
                <div class="pq_img"><a href="{$product.link|escape:'htmlall':'UTF-8'}"><img width="60" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html':'UTF-8'}" /></a></div>

                <h6>
                <a href="{$product.link|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'}

                </a>
                
                
                <br/> Reference:  {$product.reference|escape:'htmlall':'UTF-8'}<br />


                <a class="fmm_quote_del" onclick="dropItemQuote({$product.id_quotes_products|escape:'htmlall':'UTF-8'})"></a>

                <strong>

                {l s='Quantity' mod='productquotation'}: 
                <input type="number" tabindex="{$product.id_quotes_products|escape:'htmlall':'UTF-8'}" value="{$product.qty|escape:'htmlall':'UTF-8'}" min="1" class="fmm_quote_row_qty" /> 

                </strong></h6>
            </li>
            {/foreach}
        </ul>
    </div>

Untitled-1.jpg

Edited by Noise2000 (see edit history)
Link to comment
Share on other sites

I'm sorry, but your question is for the seer.
In short, "I have something" and "I need something".
You'll need to upload tpl file to understand what you're trying to do.

Link to comment
Share on other sites

10 hours ago, Guest said:

I'm sorry, but your question is for the seer.
In short, "I have something" and "I need something".
You'll need to upload tpl file to understand what you're trying to do.

Sorry!
I upload the code and a image with the result 
In my custom page i get the product image name and link (to product page) but not the reference ! 
Wait for your response ! Thank you 🙏 

Link to comment
Share on other sites

How about


    {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}

 

Edited by Guest (see edit history)
Link to comment
Share on other sites

1 hour ago, Guest said:

How about



    {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}

 

I add the code but nothing displays in front office , neither "label" word 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...