Jump to content

View availability message on summary page Cart


webnetcrea
 Share

Recommended Posts

Hello,

I want to display the availability message on the basket summary page, I used this piece of code on the product list page everything works, but against the basket page it does not work the product is always displayed as in stock, how can you get the right

availability message on the shopping cart page?

The site is under prestashop 1.7.4.3

Thank you

{block name='product_availability'}
      <span id="product-availability">
        {if $product.show_availability && $product.availability_message}
          {if $product.availability == 'available'}
            <i class="material-icons rtl-no-flip product-available">&#xE5CA;</i>
          {elseif $product.availability == 'last_remaining_items'}
            <i class="material-icons product-last-items">&#xE002;</i>
          {else}
            <i class="material-icons product-unavailable">&#xE14B;</i>
          {/if}
          {$product.availability_message}
        {/if}
      </span>
    {/block}

Capture d’écran 2018-10-24 à 13.53.20.png

Share this post


Link to post
Share on other sites

  • 1 year later...
On 10/25/2018 at 4:29 PM, webnetcrea said:

Hello,

I want to display the availability message on the basket summary page, I used this piece of code on the product list page everything works, but against the basket page it does not work the product is always displayed as in stock, how can you get the right

availability message on the shopping cart page?

The site is under prestashop 1.7.4.3

Thank you

{block name='product_availability'}
      <span id="product-availability">
        {if $product.show_availability && $product.availability_message}
          {if $product.availability == 'available'}
            <i class="material-icons rtl-no-flip product-available">&#xE5CA;</i>
          {elseif $product.availability == 'last_remaining_items'}
            <i class="material-icons product-last-items">&#xE002;</i>
          {else}
            <i class="material-icons product-unavailable">&#xE14B;</i>
          {/if}
          {$product.availability_message}
        {/if}
      </span>
    {/block}

Capture d’écran 2018-10-24 à 13.53.20.png

Hello 

 

did you solve it?

 

Thanks

angela

Share this post


Link to post
Share on other sites

  • 9 months later...

 Here's the solution to show product availability on cart (tested on PS1.7.7.3):

File to be modified:
themes/classic/templates/catalog/_partials/product-add-to-cart.tpl

    {if $product.stock_quantity<=0}
      <span style="font-weight:700;color:red;">Out of stock</span>
    {elseif $product.stock_quantity < $product.quantity}
      <span style="font-weight:700;color:orange;">Non available in the desidered quantity</span>
    {else}
      <span style="font-weight:700;color:green;">Available</span>
    {/if}

 

  • Thanks 1

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

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