Jump to content

Set specific products free shipping


rb10

Recommended Posts

There is a way for set some specific products like as free shipping, and show this info in product-list page and also in product detail page

 

 

thanks

Link to comment
Share on other sites

Hi.

If you tell us what version of Prestashop you have, I will give you instructions 😉

You need to choose a carrier with free shipping, as advised @Prestashop Addict

I assume you have Prestashop 8.x.
Open the file ./themes/your_theme/templates/catalog/_partials/product-flags.tpl

Under {/foreach} add this code:

{if (int)$product.additional_shipping_cost == 0}
  <style>
    .free-shipping-flag {
      background: #ffe300;
      color: black;
      padding: 0 5px;
      line-height: 1.25rem;
      height: 1.35rem;
      font-size: .75rem;
      font-weight: 600;
      border-radius: 3px;
      text-transform: uppercase;
      margin-top: 5px;
    }
  </style>
  <li class="free-shipping-flag"><i class="material-icons mi-local_shipping">local_shipping</i> {l s='Free' d='Shop.Theme.Catalog'}</li>
{/if}

Result will be:

obrazek.png.e3f9021dd00fe2d377026ad1b167ba64.png

The full code will be:

{block name='product_flags'}

    <ul class="product-flags js-product-flags">

        {foreach from=$product.flags item=flag}

            <li class="product-flag {$flag.type}">{$flag.label}</li>

        {/foreach}

        {if (int)$product.additional_shipping_cost == 0}
            <style>
                .free-shipping-flag {
                    background: #ffe300;
                    color: black;
                    padding: 0 5px;
                    line-height: 1.25rem;
                    height: 1.35rem;
                    font-size: .75rem;
                    font-weight: 600;
                    border-radius: 3px;
                    text-transform: uppercase;
                    margin-top: 5px;
                }
            </style>
            <li class="free-shipping-flag"><i class="material-icons mi-local_shipping">local_shipping</i> {l s='Free' d='Shop.Theme.Catalog'}</li>
        {/if}

    </ul>

{/block}

 

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

5 hours ago, rb10 said:

But there is a way for show "FREE SHIPPING" in a label / message in product list and product details 

There are product label modules as well, which can be used to display the "Free Shipping" label with the product, but that will be a manual task. If you are updating the list of products for free Shipping, then you have to update the list on the product labels module as well.

 

Link to comment
Share on other sites

13 hours ago, ps8modules said:

Hi.

If you tell us what version of Prestashop you have, I will give you instructions 😉

You need to choose a carrier with free shipping, as advised @Prestashop Addict

I assume you have Prestashop 8.x.
Open the file ./themes/your_theme/templates/catalog/_partials/product-flags.tpl

Under {/foreach} add this code:

{if (int)$product.additional_shipping_cost == 0}
  <style>
    .free-shipping-flag {
      background: #ffe300;
      color: black;
      padding: 0 5px;
      line-height: 1.25rem;
      height: 1.35rem;
      font-size: .75rem;
      font-weight: 600;
      border-radius: 3px;
      text-transform: uppercase;
      margin-top: 5px;
    }
  </style>
  <li class="free-shipping-flag"><i class="material-icons mi-local_shipping">local_shipping</i> {l s='Free' d='Shop.Theme.Catalog'}</li>
{/if}

Result will be:

obrazek.png.e3f9021dd00fe2d377026ad1b167ba64.png

The full code will be:

{block name='product_flags'}

    <ul class="product-flags js-product-flags">

        {foreach from=$product.flags item=flag}

            <li class="product-flag {$flag.type}">{$flag.label}</li>

        {/foreach}

        {if (int)$product.additional_shipping_cost == 0}
            <style>
                .free-shipping-flag {
                    background: #ffe300;
                    color: black;
                    padding: 0 5px;
                    line-height: 1.25rem;
                    height: 1.35rem;
                    font-size: .75rem;
                    font-weight: 600;
                    border-radius: 3px;
                    text-transform: uppercase;
                    margin-top: 5px;
                }
            </style>
            <li class="free-shipping-flag"><i class="material-icons mi-local_shipping">local_shipping</i> {l s='Free' d='Shop.Theme.Catalog'}</li>
        {/if}

    </ul>

{/block}

 

Thanks for your reply, i have  8.1.2  version

Link to comment
Share on other sites

On 23/07/2025 at 09:04, ps8modules said:

CIAO.

Se ci dici che versione di Prestashop hai, ti darò le istruzioni  😉

È necessario scegliere un corriere con spedizione gratuita, come consigliato@Prestashop Addict

Presumo che tu abbia Prestashop 8.x.
Apri il file ./themes/your_theme/templates/catalog/_partials/product-flags.tpl

In {/foreach} aggiungi questo codice:

  
  
             
    
  
  

Il risultato sarà:

immagine.png.e3f9021dd00fe2d377026ad1b167ba64.png

Il codice completo sarà:



    

         

            

        

          
            
                         
                
            
            
        

    

 

What happen when i add 2 product with different carrier (1 free and 1 paid)  ? 

Link to comment
Share on other sites

On 7/23/2025 at 9:04 AM, ps8modules said:

Hi.

If you tell us what version of Prestashop you have, I will give you instructions 😉

You need to choose a carrier with free shipping, as advised @Prestashop Addict

I assume you have Prestashop 8.x.
Open the file ./themes/your_theme/templates/catalog/_partials/product-flags.tpl

Under {/foreach} add this code:

{if (int)$product.additional_shipping_cost == 0}
  <style>
    .free-shipping-flag {
      background: #ffe300;
      color: black;
      padding: 0 5px;
      line-height: 1.25rem;
      height: 1.35rem;
      font-size: .75rem;
      font-weight: 600;
      border-radius: 3px;
      text-transform: uppercase;
      margin-top: 5px;
    }
  </style>
  <li class="free-shipping-flag"><i class="material-icons mi-local_shipping">local_shipping</i> {l s='Free' d='Shop.Theme.Catalog'}</li>
{/if}

Result will be:

obrazek.png.e3f9021dd00fe2d377026ad1b167ba64.png

The full code will be:

{block name='product_flags'}

    <ul class="product-flags js-product-flags">

        {foreach from=$product.flags item=flag}

            <li class="product-flag {$flag.type}">{$flag.label}</li>

        {/foreach}

        {if (int)$product.additional_shipping_cost == 0}
            <style>
                .free-shipping-flag {
                    background: #ffe300;
                    color: black;
                    padding: 0 5px;
                    line-height: 1.25rem;
                    height: 1.35rem;
                    font-size: .75rem;
                    font-weight: 600;
                    border-radius: 3px;
                    text-transform: uppercase;
                    margin-top: 5px;
                }
            </style>
            <li class="free-shipping-flag"><i class="material-icons mi-local_shipping">local_shipping</i> {l s='Free' d='Shop.Theme.Catalog'}</li>
        {/if}

    </ul>

{/block}

 

i tried this code but not show any

Link to comment
Share on other sites

The instructions are for the default template. If you use a page builder in your template, the code must be inserted elsewhere. After any modification of the TPL file, it is necessary to clear the Prestashop cache. It is also necessary to have the free carrier checked for the product in the shipping section.

Please note that we cannot see what you have done where, so you need to answer us in more detail, give us a picture of what you have set where, etc.

Link to comment
Share on other sites

9 hours ago, ps8modules said:

The instructions are for the default template. If you use a page builder in your template, the code must be inserted elsewhere. After any modification of the TPL file, it is necessary to clear the Prestashop cache. It is also necessary to have the free carrier checked for the product in the shipping section.

Please note that we cannot see what you have done where, so you need to answer us in more detail, give us a picture of what you have set where, etc.

i edit the file in path of my theme (not classic theme) (attached file) , and clear cache but not see 

product-flags.tpl

Link to comment
Share on other sites

Even if I created a free module, there would still be a few people who wouldn't understand where and what to set. I've clearly given enough information here and it's obviously not enough.

Then someone here will ask for instructions on how to embed the code 😄

 

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

20 hours ago, sanjay210 said:

I have Prestashop 8. 1 version can you provide instructions.

The instructions I gave here are valid from Prestashop version 7.0.0 and all Prestashop versions 8. Just find the file on FTP in the location I wrote, and you need to change "your_theme" to the name of your template. Then just copy the code from "The full code will be:" and save the file.

Link to comment
Share on other sites

There is no comment listed in your page source, so the code is not inserted into the correct TPL file of your template.

Your theme is theme_ecolife. It is quite possible that it has some kind of product page layout pre-set.
I assume it will be somewhere like ./themes/theme_ecolife/templates/catalog/product_layouts/ and your chosen template or 

./themes/theme_ecolife/templates/catalog/_partials/product-cover-thumbnails.tpl.

obrazek.png.0ba498a65c073af16c21a3c44e35babd.png

 

 

Here you see a comment in my code that should appear in your TPL template.

obrazek.png.2278db9b89d6f70fe4835a722daf1445.png

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

1 hour ago, ps8modules said:

There is no comment listed in your page source, so the code is not inserted into the correct TPL file of your template.

Your theme is theme_ecolife. It is quite possible that it has some kind of product page layout pre-set.
I assume it will be somewhere like ./themes/theme_ecolife/templates/catalog/product_layouts/ and your chosen template or 

./themes/theme_ecolife/templates/catalog/_partials/product-cover-thumbnails.tpl.

obrazek.png.0ba498a65c073af16c21a3c44e35babd.png

 

 

Here you see a comment in my code that should appear in your TPL template.

obrazek.png.2278db9b89d6f70fe4835a722daf1445.png

On product detail page now works, there is a way for add label also in products grid/list ? 

Link to comment
Share on other sites

this is code: 

 

{block name='product_miniature_item'}
	<article class="thumbnail-container style_product_default product-miniature js-product-miniature item_in" data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}" >
		<div class="img_block">
		    {block name='product_thumbnail'}
				{if $product.cover}
				<a href="{$product.url}" class="thumbnail product-thumbnail">
				  <img class="first-image lazyload"
					data-src = "{$product.cover.bySize.home_default.url}" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" 
					alt = "{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}"
					data-full-size-image-url = "{$product.cover.large.url}"
				  >
				   {hook h="rotatorImg" product=$product}	
				</a>
				{else}
				  <a href="{$product.url}" class="thumbnail product-thumbnail">
					<img src="{$urls.no_picture_image.bySize.home_default.url}" />
				  </a>
				{/if}
				{/block}
				 <div class="quick-view">
					{block name='quick_view'}
					<a class="quick_view" href="#" data-link-action="quickview" title="{l s='Quick view' d='Shop.Theme.Actions'}">
					 <span>{l s='Quick view' d='Shop.Theme.Actions'}</span>
					</a>
					{/block}
				</div>
				{block name='product_flags'}
				<ul class="product-flag">
				{foreach from=$product.flags item=flag}
					<li class="{$flag.type}"><span>{$flag.label}</span></li>
				{/foreach}
				</ul>
			{/block}
		</div>
		<div class="product_desc">
			<div class="inner_desc">
				{if isset($product.id_manufacturer)}
				 <div class="manufacturer"><a href="{url entity='manufacturer' id=$product.id_manufacturer }">{Manufacturer::getnamebyid($product.id_manufacturer)}</a></div>
				{/if}
				{block name='product_name'}
				  <h3 ><a href="{$product.url}" class="product_name {if $name_length ==0 }one_line{/if}" title="{$product.name}">{$product.name|truncate:50:'...'}</a></h3> 
				{/block}
				 {block name='product_reviews'}
					<div class="hook-reviews">
					{hook h='displayProductListReviews' product=$product}
					</div>
				{/block}
				{block name='product_price_and_shipping'}
				  {if $product.show_price}
					<div class="product-price-and-shipping">
					  {if $product.has_discount}
						{hook h='displayProductPriceBlock' product=$product type="old_price"}
						<span class="regular-price" aria-label="{l s='Regular price' d='Shop.Theme.Catalog'}">{$product.regular_price}</span>
					  {/if}

					  {hook h='displayProductPriceBlock' product=$product type="before_price"}

					  <span class="price {if $product.has_discount}price-sale{/if}" aria-label="{l s='Price' d='Shop.Theme.Catalog'}">
						{capture name='custom_price'}{hook h='displayProductPriceBlock' product=$product type='custom_price' hook_origin='products_list'}{/capture}
						{if '' !== $smarty.capture.custom_price}
						  {$smarty.capture.custom_price nofilter}
						{else}
						  {$product.price}
						{/if}
					  </span>
						
					  {hook h='displayProductPriceBlock' product=$product type='unit_price'}

					  {hook h='displayProductPriceBlock' product=$product type='weight'}
					  {if $product.has_discount}
						{if $product.discount_type === 'percentage'}
						  <span class="discount-percentage discount-product">{$product.discount_percentage}</span>
						{elseif $product.discount_type === 'amount'}
						  <span class="discount-amount discount-product">{$product.discount_amount_to_display}</span>
						{/if}
					  {/if}
					</div>
				  {/if}
				{/block}
		
				<ul class="add-to-links">	
					<li class="cart">
						{include file='catalog/_partials/customize/button-cart.tpl' product=$product}
					</li>
					<li>
						{hook h='displayProductListFunctionalButtons' product=$product}
					</li>
					{assign var='displayProductListCompare' value={hook h='displayProductListCompare'} }
					{if $displayProductListCompare} 
					<li class="compare">	
						 <a href="#" class="poscompare-add compare-button js-poscompare-add"  data-id_product="{$product.id_product|intval}"   onclick="posCompare.addCompare($(this),{$product.id_product|intval},'{$product.name}','{$product.cover.bySize.home_default.url}'); return false;" title="{l s='Add to compare' d='Shop.Theme.Actions'}"><span>{l s='compare' d='Shop.Theme.Actions'}</span></a>
					</li>
					 {/if}
					
				</ul>
			</div>	
			<div class="availability"> 
			{if $product.show_availability }
				{if $product.quantity > 0}
				<div class="availability-list in-stock">{l s='Availability' d='Shop.Theme.Actions'}: <span>{$product.quantity} {l s='In Stock' d='Shop.Theme.Actions'}</span></div>

				{else}

				<div class="availability-list out-of-stock">{l s='Availability' d='Shop.Theme.Actions'}: <span>{l s='Out of stock' d='Shop.Theme.Actions'}</span></div> 
				{/if}
			{/if}
			</div>
			{block name='product_description_short'}
				<div class="product-desc" >{$product.description_short nofilter}</div>
			{/block}
		
			<div class="variant-links">
			{block name='product_variants'}
			{if $product.main_variants}
			{include file='catalog/_partials/variant-links.tpl' variants=$product.main_variants}
			{/if}
			{/block} 
			</div>
		
		</div>
	</article>
{/block}

 

Link to comment
Share on other sites

Can you edit domain ?

23 minutes ago, ps8modules said:

This will be because the domain of your e-shop includes www !!
you entered it without www.

obrazek.png.919e9c23a99d6531b7fddb897adfb898.png

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi, if i have 1 product with free ship carrier and add also another product with shipping not free, in cart i see alsways free shipping for both,  it's normal? 

there is a way for having shipping cost related product with paid ship ? 

Link to comment
Share on other sites

On 8/8/2025 at 7:01 AM, rb10 said:

Hi, if i have 1 product with free ship carrier and add also another product with shipping not free, in cart i see alsways free shipping for both,  it's normal? 

there is a way for having shipping cost related product with paid ship ? 

not using prestashop, this has not and apparently will never be something that prestashop support, i.e. two carriers at checkout.  also it's never a very good idea to use product level shipping carrier assignment free or paid, it creates unpredictable results.

there might be a module, (doubt it), or you could find developer to hack,

my advice?  walk away from this idea looool

happy ps'ing

Link to comment
Share on other sites

On 12/08/2025 at 20:45, El Patron said:

non usando PrestaShop, questa non è stata e apparentemente non sarà mai una cosa supportata da PrestaShop, ovvero due corrieri al momento del pagamento. Inoltre non è mai una buona idea usare l'assegnazione del corriere per la spedizione a livello di prodotto, gratuita o a pagamento, perché crea risultati imprevedibili.

potrebbe esserci un modulo (ne dubito), oppure potresti trovare uno sviluppatore da hackerare,

il mio consiglio? abbandona questa idea looool

buon divertimento

thanks for advice

  • Like 1
Link to comment
Share on other sites

On 7/17/2025 at 9:18 PM, rb10 said:

There is a way for set some specific products like as free shipping, and show this info in product-list page and also in product detail page

 

 

thanks

Option A. Create a “Free Shipping” carrier with all ranges at 0. In each product go to Shipping and allow only this carrier. The free carrier will appear if the cart contains only these products.

Option B. Create a Cart Rule, enable free shipping, and add the product as a condition. In this case the whole order becomes free shipping as soon as the product is in the cart.

To display a note or badge, add a product flag or feature such as “Free Shipping” and show it in the product listing and product page through your theme.

Always clear cache after changes and test both single product and mixed cart scenarios to confirm the expected behavior.

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