Jump to content

All products shows as in stock


Recommended Posts

Hello guys,

I have a strange problem with a new show... I currently starting to add products to the shop, and all products shows as in stock, but in the back office I havn't added anything to Qty. its 0.

Can please help mere here... I use customized Theme, and the product-list.tpl looks like this:

 

<div class="right_block">
{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale">{l s='On sale!'}</span>
{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span>{/if}
{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
<div class="content_price">
{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if}
 
</div>
 
{/if}
 
 
</div>
 
So I think that should be okay...
 
Udklip.png
 
Link to comment
Share on other sites

Pascal.

I have the "allow ordering out of stock products" enabled, and just removed the $product.allow_oosp ||  in the TPL file for the product list, and now it seems to work.

BUT, in the product page (product.tpl) I have a problem with the: Avaiblility

It does now show: On stock / Out of stock.

 

I found that is something with this part in the tpl file.

 

<!-- availability -->
<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<span id="availability_label">{l s='Availability:'}</span>
<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{$product->available_later}{l s='This product is no longer in stock'}{else}{$product->available_now}{/if}</span>
</p>
 
But I can't figure out what to change to get the page show in stock / out of stock regardless of what options is set in the BO. I would like the page to ALWAYS show this.
 
Thanks.
Edited by Syswatch (see edit history)
Link to comment
Share on other sites

in the code you copied in your original question, almost at the end. you see the code piece:

 

{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}

 

This means it's always 'available, whether quantity>0 or 'out of stock product' (i.e. 'oosp') can be ordered. 

 

You could change this to differentiate in

1 can be ordered but out of stock (order out of stock possible, but quantity <=0)

2 Available    (quantity >0)

 

So change the exact code piece above to something like this:

 

{if ($product.allow_oosp && $product.quantity <= 0)}{l s='Out of stock, but can be ordered'} {elseif $product.quantity > 0)}{l s='Available'}

 

the text "Out of stock, but can be ordered" can be changed in anything similar, as desired :-)

 

 

Hope this does the trick. Did't try it though...

 

pascal.

Link to comment
Share on other sites

Pascal.


I have the "allow ordering out of stock products" enabled, and just removed the $product.allow_oosp ||  in the TPL file for the product list, and now it seems to work.


BUT, in the product page (product.tpl) I have a problem with the: Avaiblility


It does not show: On stock / Out of stock.


 


I found that is something with this part in the tpl file.


 


<!-- availability -->

<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>

<span id="availability_label">{l s='Availability:'}</span>

<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{$product->available_later}{l s='This product is no longer in stock'}{else}{$product->available_now}{/if}</span>

</p>

 

But I can't figure out what to change to get the page show in stock / out of stock regardless of what options is set in the BO. I would like the page to ALWAYS show this.

 

Thanks.

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

GOT IT ! :-)

 

Changed this line:

<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>

to:

<p id="availability_statut">

 

Changed this line:

<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{$product->available_later}{l s='This product is no longer in stock'}{else}{$product->available_now}{/if}</span>

to:

<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{$product->available_later}{l s='This product is no longer in stock'}{else}{$product->available_now}{l s='Available'}{/if}</span>

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

×
×
  • Create New...