0

Hello I am new to demandware just worked on few POC's and I need to create a notify button on pdp page if a product is out of stock then on clicking this button a pop up window will open which will ask for email id that should be saved in a custom object and the user should be alerted when the product comes in stock via email that has been saved in custom object

Vipul
  • 57
  • 4

2 Answers2

1

Generally you should rely on a third party system (usually the OMS or some other back-end system) to store and send notifications. The mechanism I've seen used most often to achieve this is to record the product ID, customer email address, and timestamp into a Custom Object. Periodically these Custom Objects should be exported to the third party system via a job and then deleted from the Demandware system. Deletion is important because of system quotas limiting the total number of Custom Objects than can be stored.

The third party system would periodically look at the the products that have been 'subscribed' to, if they have inventory, then email the people who wanted to be notified.

sholsinger
  • 3,028
  • 2
  • 23
  • 40
0

What you can do is create a simple button on PDP upon clicking which, a popup box is shown which contains a form with hidden pid field and a text box for entering user's email, and a submit button to submit this information.

Use jQuery and AJAX to get the form data (pid & email), pass this on to Controller, store the data into custom object, get the response back from the Controller, and show the response back on the popup or in any other way you feel fit.

You'd need to create custom object to store this data, wherein your unique key would be combination of email and pid (encryption recommended).