1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Displaying out of stock message
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 292 Views |
-
Displaying out of stock message

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.
-
Re: Displaying out of stock message

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
| 292 Views | ||
|
Page:
1
|
Go to Top |


