Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Displaying out of stock message


Reply


2 Posts   470 Views

Avatar
Mitz

Community Member, 9 Posts

29 September 2011 at 9:36am

Hi there,

For out of stock items on my client's site, I would like to be able to show a friendly Out of Stock message along with a link to a 'request product/enquiry form' to capture customer's details so that the client can contact them when the products are back in stock.

The client is happy to maintain the stock levels by simply ticking/unticking the "Allow product to be purchased' checkbox.
So I need to incorporate logic that if this checkbox is unticked, display out of stock message with link to form.

Any ideas where/how I could do this?

Thanks for your help.

Avatar
JonoM

Community Member, 103 Posts

29 September 2011 at 1:17pm

Hi Mitz, when you're in a template in the context of a product you should be able to add some simple logic i.e.

<% control Products %>

   <p>Title: $Title</p>

   <p>Description: $Description</p>

   <p>Price: $Price</p>
   
   <% if AllowPurchase %>
   
      <p><a href="link-to-buy/$ID">Buy now</a></p>
   
   <% else %>
   
      <p>This item is currently out of stock. You can <a href="link-to-form/$ID">request to be notified when it is available again</a>.</p>
      
   <% end_if %>
   
<% end_control %>

Assuming AllowPurchase is the name of your checkbox field