Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > ecommerce -> new product -> single step add new product View modes: 
User avatar
Member
Member
eagleag - 9/28/2010 9:15:34 AM
   
ecommerce -> new product -> single step add new product
hi,
right now when i create a new "myProduct" (doc type i created that is used for products) I can fill in all fields that i created in doc type and then need to check "Create a new product".
I know I can do that part automatically but in both method the "Available items:" stays empty until i click OK on the PRODUCTS tab.
Is there anyway to do this in one step?
anyway to get more fields from the "product" to show on first step?

thanks :)

User avatar
Member
Member
kentico_michal - 10/8/2010 9:04:35 AM
   
RE:ecommerce -> new product -> single step add new product
Hi,

Yes it is possible, but it requires some modification.
So, could you please try to open ~\CMSModules\Ecommerce\Content\Product\NewProduct.ascx file and add following code at the end of the table:

<tr>
<td class="FieldLabel" style="padding-left: 35px;">
<asp:Label runat="server" ID="lblSKUAvailableItems" EnableViewState="false" Text="Available Items:"/>
</td>
<td>
<asp:TextBox ID="txtSKUAvailableItems" runat="server" CssClass="TextBoxField" EnableViewState="false" MaxLength="9" />
</td>
</tr>

</table>

Then file ~\CMSModules\Ecommerce\Content\Product\NewProduct.ascx.cs file needs to be modified as well. So please add into SaveData method following line:

skuObj.SKUDepartmentID = departmentElem.DepartmentID;
skuObj.SKUEnabled = true;
skuObj.SKUAvailableItems = ValidationHelper.GetInteger(txtSKUAvailableItems.Text.Trim(), 0);
// Create new SKU
SKUInfoProvider.SetSKUInfo(skuObj);

This is simple example how you can add Available items: field into the first step of creating new product. You can add another fields that are provided by SKUInfo class in similar way. More information about this class can be found at our API reference http://devnet.kentico.com/downloads/kenticocms_api.zip

Best regards,
Michal Legen