Jump to content

Hide availability text


Recommended Posts

Hi, when a product is out of stock, the text "This product is no longer in stock with those attributes but is available with others.

is displayed. I want to hide it in the product page, but also in the catalog page where all the  products are displayed. 

Link to comment
Share on other sites

Remove this from product-list.tpl
 

{if $PS_STOCK_MANAGEMENT && isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
<span class="unvisible">
{if ($product.allow_oosp || $product.quantity > 0)}
<link itemprop="availability" href="https://schema.org/InStock" />{if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock'}{/if}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
<link itemprop="availability" href="https://schema.org/LimitedAvailability" />{l s='Product available with different options'}
 
{else}
<link itemprop="availability" href="https://schema.org/OutOfStock" />{l s='Out of stock'}
{/if}
</span>
{/if}

And this from the product.tpl file

<p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
{*<span id="availability_label">{l s='Availability:'}</span>*}
<span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>
</p>
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...