Jump to content

Check product and combination stock status.


Recommended Posts

Hey people!

 

I run into a problem regarding checking the stock status of my products combination(sizes).

 

Basically what i want is to show one img when the products specific size in in stock and another img when it's not.

 

this is what i wrote in the products.tpl (line 338) and I understand that it only checks the products stock status and not it's attributes:

 

{if $product->quantity > 0}
  <label>{l s="In Stock : "}</label><img src="{$img_dir}_in_product/instock.png" />
  {else}
  <label>{l s="In Stock : "}</label><img src="{$img_dir}_in_product/outstock.png" />
  {/if}

 

So now it's the instock img that shows all the time because one size is in stock. I tried looking in the file on how to solve it but I don't understand how it's used.

 

Thank you

  • Like 1
Link to comment
Share on other sites

Ok I still havent figured this one out. Im using the exact same statement as prestashop does when deciding to show the add to cart button or quantity option. The only difference is that I'm using a {else} statement as well.

 

  {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}
  <label><img src="{$img_dir}_in_product/_buybox/{$lang_iso}_outstock.png" /></label>
  {else}
  <label><img src="{$img_dir}_in_product/_buybox/{$lang_iso}_instock.png" /></label>
  {/if}

 

Can anyone see anything crazy?

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