Setting the Needs Shipping option to false upon product creation

   —   
This article describes how to set the Needs shipping option to false when a new product is created from within the CMS Desk.
When you create a new product in the CMS Desk, the Needs shipping option will always be checked by default as seen below:


In order to have this option unchecked by default, you would need to edit the ~\CMSModules\Ecommerce\Controls\UI\ProductEdit.ascx.cs file around lines 927 & 933 and set the SKUNeedsShipping = false
Default code:
/// <summary> /// Sets the field defaults. /// </summary> private void SetFieldDefaults() { switch (SKURepresenting) { case SKUProductTypeEnum.Product: case SKUProductTypeEnum.Bundle: SetFieldValue(SKUForms, "SKUNeedsShipping", true); break; } if (ProductIsProductOption) { SetFieldValue(SKUForms, "SKUNeedsShipping", true); } }

Code after SKUNeedsShipping is set to ‘false’    
 
/// <summary> /// Sets the field defaults. /// </summary> private void SetFieldDefaults() { switch (SKURepresenting) { case SKUProductTypeEnum.Product: case SKUProductTypeEnum.Bundle: SetFieldValue(SKUForms, "SKUNeedsShipping", false); break; } if (ProductIsProductOption) { SetFieldValue(SKUForms, "SKUNeedsShipping", false); } }

The Needs shipping option will be unchecked when you create a new product after making these changes.

Share this article on   LinkedIn