Order note dropdown in Checkout.

The requirement is to add the order note drop-down in checkout page of the SCA web store for One Source. The field should be a text field where user can add comments. It should be placed under HAVE A PROMO CODE like the promo code. It should be drop-down. 

Deliverables  

  • In checkout page we will add the order note field under the promo code field. That field will be a text area field where users can add their comments. It should not be a mandatory field. 
  • The order note section will be a drop-down option. When the user clicks the order note field option, the comment field will be displayed, and user can add comments. 
  • When user adds order comments in order notes, it will be stored in order field that is already there in SO record. We can use the transaction field with Field ID: custbody13.  
  • To add field in the checkout is a standard sca extension. We can activate and make changes to meet our requirement. 

Functionality :


define(
	'JJ.OrderNoteDropdown.OrderNoteDropdown'
	, [
		'OrderWizard.Module.PromocodeForm'
	]
	, function (
		OrderWizardModulePromocodeForm
	) {
		'use strict';

		return {
			mountToApp: function mountToApp(container) {
				// using the 'Layout' component we add a new child view inside the 'Header' existing view 
				// (there will be a DOM element with the HTML attribute data-view="Header.Logo")
				// more documentation of the Extensibility API in
				// https://system.netsuite.com/help/helpcenter/en_US/APIs/SuiteCommerce/Extensibility/Frontend/index.html

				/** @type {LayoutComponent} */
				var layout = container.getComponent('Layout');

				_.extend(OrderWizardModulePromocodeForm.prototype, {

					events: _.extend(OrderWizardModulePromocodeForm.prototype.events, {
						'change [id="delivery-messages"]': 'DeliveryMessage',
					}),


					DeliveryMessage: function () {
						var DeliveryMsg = $('#delivery-messages').val();
						console.log(DeliveryMsg, 'DeliveryMsg')
						var model = this.options.wizard.model;
						var options = model.get("options");
						options.custbody13 = DeliveryMsg;

		


					}


				});

			}
		};
	});

Leave a comment

Your email address will not be published. Required fields are marked *