Jump to content

adding a message on product page when "available for order" is turned off


Recommended Posts

Hi, I would like to add a message on the product page such as "call us for availability" when the product is disabled for "available to order." what files would i need to modify and how in order to display this message?

 

Thank you in advance for any help :)

Link to comment
Share on other sites

I understand, but stock management is disabled on my store and i have no option for adding custom message under quantities in product page. I would like to have product, if set to available for order to have button add to cart and for customer to place order. If product is set to not available for order to display :call us for availability

Link to comment
Share on other sites

I assume i would have to add code in product.tpl

 <!-- availability -->
	    <p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
		    <span id="availability_label">{l s='Availability:'}</span>
		    <span id="availability_value"{if $product->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}
		    </span>
	    </p>

 

something to the effect of {if $product->available_for_order == o}{l s='call us for availability'}{/if}

 

but where would i input that, and is this code correct?

Link to comment
Share on other sites

  • 2 months later...

If the condition is based on "Available for order" only, create new html paragraph and you may placed this new html paragraph after html comment <!-- availability --> . This new html paragraph will always displayed is you've disabled "Available for order"
You may add the new id to the available css rule
p#call_us_for_availability same as p#availability_statut and span#availability_info same as span#availability_label

<!-- availability -->
{if !$product->available_for_order}
<p id="call_us_for_availability">
      <span id="availability_info">{l s='call us for availability'}</span>
</p>
{/if}

If the condition is based on "Available for order" and "Product Quantity", you may modify the default html block.
Then if you've set product quantity > 0 and "Available for order" is disabled, the html paragraph id="availability_statut" and the text "Call us for availability" will be displayed

<!-- availability -->
<p id="availability_statut"{if !$product->available_for_order && $product->quantity > 0}{elseif ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
    {if !$product->available_for_order && $product->quantity > 0}<span id="availability_label">{l s='Call us for availability'}</span>{else}<span id="availability_label">{l s='Availability:'}</span>{/if}
    <span id="availability_value"{if $product->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}</span>                
</p>
  • Like 2
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...