protected void SyncRequiredCatalogAttributes() { using (var helper = new AssortmentHelper(Connector.Connection, Version)) { var attributes = helper.GetAttributeList(CATEGORY_ENTITY_TYPE_ID); eav_attribute att = null; attributes.TryGetValue("icecat_cat_id", out att); if (att == null) { att = helper.CreateAttribute("icecat_cat_id", CATEGORY_ENTITY_TYPE_ID, "icecat_cat_id", "int", is_required: true); } else { att.is_required = false; att.is_user_defined = false; } helper.SyncAttribute(att, addToDefaultSet: true); attributes = helper.GetAttributeList(PRODUCT_ENTITY_TYPE_ID); if (!attributes.TryGetValue("concentrator_product_id", out att)) { att = helper.CreateAttribute("concentrator_product_id", PRODUCT_ENTITY_TYPE_ID, "concentrator_product_id", "int", is_visible: false); } else { att.frontend_label = "Concentrator ID"; att.is_required = false; att.is_user_defined = false; att.used_in_product_listing = true; } helper.SyncAttribute(att, addToDefaultSet: true); if (!attributes.TryGetValue("barcode", out att)) { att = helper.CreateAttribute("barcode", PRODUCT_ENTITY_TYPE_ID, "barcode", "varchar"); } else { att.frontend_label = "Barcode"; att.is_required = false; att.is_user_defined = false; att.is_searchable = true; } helper.SyncAttribute(att, addToDefaultSet: true); if (!attributes.TryGetValue("stock_status", out att)) { att = helper.CreateAttribute("stock_status", PRODUCT_ENTITY_TYPE_ID, "stock_status", "varchar", is_visible: false); } else { att.frontend_label = "Stock Status"; att.is_required = false; att.is_user_defined = false; } helper.SyncAttribute(att, addToDefaultSet: true); if (!attributes.TryGetValue("quantity_to_receive", out att)) { att = helper.CreateAttribute("quantity_to_receive", PRODUCT_ENTITY_TYPE_ID, "quantity_to_receive", "int", is_visible: false); } else { att.frontend_label = "Quantity on PO"; att.is_required = false; att.is_user_defined = false; } helper.SyncAttribute(att, addToDefaultSet: true); if (!attributes.TryGetValue("promised_delivery_date", out att)) { att = helper.CreateAttribute("promised_delivery_date", PRODUCT_ENTITY_TYPE_ID, "promised_delivery_date", "date", is_visible: true, used_in_product_listing: true); } else { att.frontend_label = "Promised Delivery Date"; att.frontend_input = "date"; att.is_required = false; att.is_user_defined = false; att.is_visible = false; att.used_in_product_listing = true; } helper.SyncAttribute(att, addToDefaultSet: true); if (!attributes.TryGetValue("custom_item_number", out att)) { att = helper.CreateAttribute("custom_item_number", PRODUCT_ENTITY_TYPE_ID, "custom_item_number", "varchar", is_visible: true, used_in_product_listing: true, is_searchable: true); } else { att.frontend_label = "Custom Item Number"; att.is_required = false; att.is_user_defined = false; att.is_visible = false; att.used_in_product_listing = false; att.is_searchable = true; } helper.SyncAttribute(att, addToDefaultSet: true); if (!attributes.TryGetValue("commercial_status", out att)) { att = helper.CreateAttribute("commercial_status", PRODUCT_ENTITY_TYPE_ID, "commercial_status", "varchar", is_visible: true, used_in_product_listing: true); } else { att.frontend_label = "Commercial Status"; att.is_required = false; att.is_user_defined = false; att.is_visible = false; att.used_in_product_listing = true; } helper.SyncAttribute(att, addToDefaultSet: true); } }