Jump to content

Show out of stock if default combination is out of stock


Recommended Posts

Hi,

 

If a product's default combination is out of stock I want to list the product as out of stock in the product list even if there are other combinations available in stock. How do I do?

 

I guess I need to change following code in some way;

 

{if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}
{if ($product.allow_oosp || $product.quantity > 0)}
 {if isset($static_token)}
<a class="ajax_add_to_cart_button buy_exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a>
  {else}
<a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)} title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a>
 {/if}	
  {else}
<span class="noexclusive"><span></span>{l s='Out of stock'}</span>
 {/if}
{/if}		

Link to comment
Share on other sites

Look in product.tpl for the line:

 

var doesntExistNoMoreBut = '{l s='with those attributes but is available with others.' js=1}';

 

Try removing

 

with those attributes but is available with others.

It's product-list.tpl that I want to edit, not product.tpl. If the products default combination is out of stock I want following code to be shown in the product list instead of the "Add to cart" button even if there are other combinations available;

 

<span class="noexclusive"><span></span>{l s='Out of stock'}</span>

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

Oops sorry wrong page. OK you can edit line 53 of (1.5.4.1 default) product-list.tpl as follows:

 

Replace 'Product available with different options' with 'Out of stock'.

 

The Add to Cart button will be greyed out in this situation, so I would suggest leaving it alone. It would look a bit odd if it displayed differently to the situation where all combinations for the product are out of stock.

 

On a more general note, lets say you have 8 combinations, with just one being out of stock. Why would you want to steer your customers away from potential sales via the other 7 combinations?

Link to comment
Share on other sites

  • 1 year later...

Oops sorry wrong page. OK you can edit line 53 of (1.5.4.1 default) product-list.tpl as follows:

 

Replace 'Product available with different options' with 'Out of stock'.

 

The Add to Cart button will be greyed out in this situation, so I would suggest leaving it alone. It would look a bit odd if it displayed differently to the situation where all combinations for the product are out of stock.

 

On a more general note, lets say you have 8 combinations, with just one being out of stock. Why would you want to steer your customers away from potential sales via the other 7 combinations?

 

Hi. Just one doubt: how do I get ride of the message "Product available with different options"? I'm setting up a shoe shop, and if the default attribute (let's say color brown, size 40) is out of stock, that message appears in the category list (not on the homepage) and is misleading for the client.

 

Any help?

Link to comment
Share on other sites

×
×
  • Create New...