Jump to:

2084 Posts in 1005 Topics by 453 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, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 451 Views
  • Mitz
    Community Member
    9 Posts

    Displaying out of stock message Link to this post

    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.

  • JonoM
    Community Member
    103 Posts

    Re: Displaying out of stock message Link to this post

    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

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.