Skip to content

Instantly share code, notes, and snippets.

@raulfmiranda
Created February 2, 2019 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulfmiranda/89a43e29557d69dbf7e46f51c90f24a7 to your computer and use it in GitHub Desktop.
Save raulfmiranda/89a43e29557d69dbf7e46f51c90f24a7 to your computer and use it in GitHub Desktop.
CRIAR UM CUSTOM OBJECT
exports.CreateNewsLetterObject = function (newsletterForm)
{
var CustomObjectMgr = require('dw/object/CustomObjectMgr');
var customObjectInstance = CustomObjectMgr.createCustomObject("NewsletterSubscription", newsletterForm.email.value);
newsletterForm.copyTo(customObjectInstance);
customObjectInstance.custom.couponcode = getCouponCode();
return customObjectInstance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment