Jump to content

Display Add to Cart, on Order and Available soon in Product List


Recommended Posts

Hi everybody,

I'd like to modify my product list in this way:

 

If a product is in stock (quantity > 0) I want to display classic "Add To Cart" button.

If a product is out of stock (quantity <= 0) but it is available for order I want to display "Available on Order".

If a product is out of stock (quantity <=0) and it is not available for order I want to display "Available Soon".

 

What can I edit to do this?

 

Many thanks!

Link to comment
Share on other sites

No, I'm using TimePlus theme.

 

I edited my procuct-list.tpl and now I can display Add to Cart when quantity > 0 and "In Arrivo" when quantity <= 0.

 

I found that on a topic in this forum, don't know if it is correct but anyway it works. Now I want to add "Available on Order" but I can't do this!

 

This is what I did in product-list.tpl :

<p class="product-desc" itemprop="description">
						{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
					</p>
					<div class="button-container">
						{if isset($comparator_max_item) && $comparator_max_item}
								<a class="add_to_compare" href="{$product.link|escape:'html':'UTF-8'}" data-id-product="{$product.id_product}"><i class="icon-signal"></i></a>
						{/if}
						{hook h='displayProductListFunctionalButtons' product=$product}
						{if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.customizable != 2 && !$PS_CATALOG_MODE}
							{if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)}
								{capture}add=1&id_product={$product.id_product|intval}{if isset($static_token)}&token={$static_token}{/if}{/capture}
								<a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart', true, NULL, $smarty.capture.default, false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Aggiungi al Carrello'}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{if isset($product.product_attribute_minimal_quantity) && $product.product_attribute_minimal_quantity >= 1}{$product.product_attribute_minimal_quantity|intval}{else}{$product.minimal_quantity|intval}{/if}">
									{l s='Aggiungi al Carrello'}
								</a>
							{else}
							<a class="in_arrivo_avvisami"  href="{$product.link|escape:'html':'UTF-8'}">
								{l s='In Arrivo. Avvisami'}
							</a>
							{/if}
						{/if}
					</div>
Edited by leonardodestefanis (see edit history)
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...