Jump to content

Need help with Product Ribbon Label on Quick View and Product Pages


lcp2000

Recommended Posts

So, I have this code that displays a "FREE SHIPPING" ribbon on my product images on home page. Problem is, it wont display on the Quick View or Product Pages.

 

On my product-list.tpl file I have (which works fine):

<div class="product-image-container">
...other code

{* LCP *}
{if isset($product.additional_shipping_cost) && $product.additional_shipping_cost == 0}
    <a class="free-shipping-box" href="{$product.link|escape:'html':'UTF-8'}">
        <span class="free-shipping-label">{l s='Free'} <em class="icon-truck" id="icon-truck"></em> !</span>
    </a>
{/if}
{* /LCP *}

...other code

If I add that same code to product.tpl I get a blank page:

            <!-- product img-->
            <div id="image-block" class="clearfix">
                {if $product->new}
                    <span class="new-box">
                        <span class="new-label">{l s='New'}</span>
                    </span>
                {/if}
                {if $product->on_sale}
                    <span class="sale-box no-print">
                        <span class="sale-label">{l s='Sale!'}</span>
                    </span>
                {elseif $product->specificPrice && $product->specificPrice.reduction && $productPriceWithoutReduction > $productPrice}
                    <span class="discount">{l s='Reduced price!'}</span>
                {/if}

                {* LCP *}
                {if isset($product.additional_shipping_cost) && $product.additional_shipping_cost == 0}
                    <a class="free-shipping-box" href="{$product.link|escape:'html':'UTF-8'}">
                        <span class="free-shipping-label">{l s='Free'} <em class="icon-truck" id="icon-truck"></em> !</span>
                    </a>
                {/if}
                {* /LCP *}

...other code

I take it that "$product.additional_shipping_cost" is not yet set here?

 

Don't know where to look from here... Anyone?

 

You can refer to my other post HERE if you need to.

 

 

Thanks,

LCP

 

 

 

 

 

 

Link to comment
Share on other sites

Try with this, use product-> as it is an object and remove link as it is not needed  

                {* LCP *}
                {if isset($product->additional_shipping_cost) && $product->additional_shipping_cost == 0}
                        <span class="free-shipping-label">{l s='Free'} <em class="icon-truck" id="icon-truck"></em> !</span>
                {/if}
                {* /LCP *}
Edited by razaro (see edit history)
  • Like 1
Link to comment
Share on other sites

Awesome, thank you. Here's what I ended up with. Changed the link to a span so as to continue using the ribbon css

    {* LCP *}
    {if isset($product->additional_shipping_cost) && $product->additional_shipping_cost == 0}
        <span class="free-shipping-box">
		<span class="free-shipping-label">{l s='Free'} <em class="icon-truck" id="icon-truck"></em> !</span>
	</span>
    {/if}
    {* /LCP *}

Link to comment
Share on other sites

  • 2 years later...

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...