Jump to content

[Solved] [HELP!!!] Remove Available in product-list.tpl and Availability: in stock from the product.tpl


robkwal

Recommended Posts

Hi Rob,

To remove 'available' on product list page :
1. open .../themes/your theme/product-list.tpl
2. search for the following codes (in v 1.4.3 default theme its on line 44) :

{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}{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='Available'}{/if}{/if}



3. Delete the word Available as in {l s='Available'} (there are 2 instances) like this :

{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}{if ($product.allow_oosp || $product.quantity > 0)}{l s=''}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s=''}{/if}{/if}



4. Save and refresh your webpage.



To remove 'availability' on product page :
1. open .../themes/your theme/product.tpl
2. search for the following codes (in v 1.4.3 default theme its on line 338 to 343) :

quantity == 0 && !$product->available_later) OR ($product->quantity != 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
{l s='Availability:'}
quantity == 0} class="warning-inline"{/if}>
{if $product->quantity == 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}



3. Uncomment the whole code like this :

<!-- 
quantity == 0 && !$product->available_later) OR ($product->quantity != 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
{l s='Availability:'}
quantity == 0} class="warning-inline"{/if}>
{if $product->quantity == 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}

 -->



4. Save and refresh your webpage.

I hope the above help.
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...

Hi I have the same problem in 1.4.4.1

I have Uncomment the whole code, like Sam says, but it is still htere when I refresh ther site.

I have tried other pc's but it is still there, so its not the cache. Can anyone help me remove the Available text??

 

Thanks in advance.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

In version 1.4.6.2

 

Edit: \themes\yourtheme\css\product_list.css

 

Add: display: none:

 

You final solution should look like this:

 

ul#product_list li span.availability {

display: none;

color: #488c40;

font-size: 0.9em

}

 

I hope this helps...

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 5 months later...
  • 4 weeks later...
  • 11 months later...
  • 1 month later...

Because i do not use the advanced stock management system and all my items are in stock or should not be a factor in the order process, in order to remove that pesky "In Stock" icon I just edited product-list.tpl and commented out the following :

 

{*
{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">
{if ($product.allow_oosp || $product.quantity > 0)}
<span class="{if $product.quantity <= 0 && !$product.allow_oosp}out-of-stock{else}available-now{/if}">
<link itemprop="availability" href="http://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}{else}{l s='Out of stock'}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
</span>
{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
<span class="available-dif">
<link itemprop="availability" href="http://schema.org/LimitedAvailability" />{l s='Product available with different options'}
</span>
{else}
<span class="out-of-stock">
<link itemprop="availability" href="http://schema.org/OutOfStock" />{l s='Out of stock'}
</span>
{/if}
</span>
{/if}
{/if}
</div>
*}
 
Works on 1.6.0.11
Link to comment
Share on other sites

  • 3 weeks later...

Hi, I just tried it in 1.6.0.9 and it seems to work.

 

I would like to replace this button "in stock " with another one which shows the product condition: new, used, refurbished.

 

I am not a programmer, could someone tell me how to edit the product-list.tpl (i guess this is where it should be done... )?

 

thx in advance

Link to comment
Share on other sites

Hi, I just tried it in 1.6.0.9 and it seems to work.

 

I would like to replace this button "in stock " with another one which shows the product condition: new, used, refurbished.

 

I am not a programmer, could someone tell me how to edit the product-list.tpl (i guess this is where it should be done... )?

 

thx in advance

 

What if you try this, go to your product item -> quantities -> at the bottom you can see availability setting.

 

You can change displayed text in stock, or when it's out of stock, with your own writing.

Link to comment
Share on other sites

Hi, Thanks for your reply, but actually I was more thinking about using the same button which now shows in stock and automatically write there

 

the product condition.

 

I have found a code somewhere in a forum which i added to my product-list.tpl, just it does not work ...  the in stock I have commented out, so it does not show anymore.:

 

                    {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" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                                {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
                                    <span itemprop="price" class="price product-price">
                                        {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
                                    {if $product.condition}
                                        <p id="product_condition">
                                            <label>{l s='Condition'} </label>
                                            {if $product.condition == 'new'}
                                                <link itemprop="itemCondition" href="http://schema.org/NewCondition"/>
                                                <span class="editable">{l s='New'}</span>
                                            {elseif $product.condition == 'used'}
                                                <link itemprop="itemCondition" href="http://schema.org/UsedCondition"/>
                                                <span class="editable">{l s='Used'}</span>
                                            {elseif $product.condition == 'refurbished'}
                                                <link itemprop="itemCondition" href="http://schema.org/RefurbishedCondition"/>
                                                <span class="editable">{l s='Refurbished'}</span>
                                            {/if}
                                        </p>
                                        {/if}    
                                    </span>
                                    <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
                                    {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
                                        {hook h="displayProductPriceBlock" product=$product type="old_price"}
                                        <span class="old-price product-price">
                                            {displayWtPrice p=$product.price_without_reduction}

Link to comment
Share on other sites

  • 1 year later...

 

Because i do not use the advanced stock management system and all my items are in stock or should not be a factor in the order process, in order to remove that pesky "In Stock" icon I just edited product-list.tpl and commented out the following :

 

{*
{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">
{if ($product.allow_oosp || $product.quantity > 0)}
<span class="{if $product.quantity <= 0 && !$product.allow_oosp}out-of-stock{else}available-now{/if}">
<link itemprop="availability" href="http://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}{else}{l s='Out of stock'}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
</span>
{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
<span class="available-dif">
<link itemprop="availability" href="http://schema.org/LimitedAvailability" />{l s='Product available with different options'}
</span>
{else}
<span class="out-of-stock">
<link itemprop="availability" href="http://schema.org/OutOfStock" />{l s='Out of stock'}
</span>
{/if}
</span>
{/if}
{/if}
</div>
*}
 
Works on 1.6.0.11

 

Doesnt seem to work on 1.6.1, any suggestions?

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