Jump to content

Default template modification not displayed


Recommended Posts

Hi everyone,

 

I tried to change a little bit the product page of the default template but for some reasons I cannot see the changes on my shop.

 

The modification I tried to perform was to display a message for each product that is currently not in stock but available to order. I know I can add a message for each product individually but it takes a lot of time so I wanted to add a generic message.

 

To perform this goal I made the following modifications to the file product.tpl line 214.

From 

<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}{l s='This product is available within 2 weeks'}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>
</p>

to this :

<p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$allow_oosp) || $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}{l s='This product is available within 2 weeks'}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>
</p>

For some reasons this change does not change anything as the span with id "availability_value" is only display when I choose an in stock product.

 

I tried to add an html comment inside the availability_status paragraph and I can see it on my browser. 

I also tried to empty the cache and force template compilation at each call from the Performance menu but it didn't change anything: the availability_status paragraph is still not shown for not in stock products.

 

Any idea why my generic message is not displayed in this case ?

 

Thanks in advance.

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