Open munkyjutres opened 5 years ago
cuando creo y/o actualizo un articulo se ejecuta bien, pero al revisar el articulo muestra el precio en 0 y el stock en 0
adjunto codigo:
ProductFactory ProductFactory = new ProductFactory(BaseUrl, Account, Password); Bukimedia.PrestaSharp.Entities.product p = ProductFactory.Get(A.id); p.id = A.id; p.ean13 = ""; p.minimal_quantity = 1; p.additional_shipping_cost = 0; p.ecotax = 0; p.available_for_order = 1; p.customizable = 1; p.uploadable_files = 0; p.active = A.active; p.condition = ""; p.cache_is_pack = 0; p.cache_has_attachments = 0; p.cache_default_attribute = 0; p.id_category_default = A.id_category_default; p.id_default_combination = A.id_default_combination; p.id_default_image = A.id_default_image; p.id_manufacturer = A.id_manufacturer; p.id_product_redirected = A.id_product_redirected; p.id_shop_default = A.id_shop_default; p.id_supplier = A.id_supplier; p.id_tax_rules_group = A.id_tax_rules_group; p.indexed = A.indexed; p.AddLinkRewrite(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.link_rewrite)); p.location = A.location; p.meta_description.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.meta_description)); p.meta_keywords.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.meta_keywords)); p.meta_title.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.meta_title)); p.name.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.name)); p.on_sale = A.on_sale; p.online_only = A.online_only; p.position_in_category = 0; p.price = A.price; p.redirect_type = "301-category"; p.reference = A.reference; p.show_condition = 0; p.show_price = A.show_price; p.state = 1; p.supplier_reference = ""; p.text_fields = 1; p.unit_price_ratio = A.unit_price_ratio; p.unity = ""; p.upc = ""; p.visibility = "both"; p.wholesale_price = A.wholesale_price; p.description.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.descripcion)); p.description_short.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.descripcion)); p.associations.categories.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.category((long)A.id_category_default));
ProductFactory.Update(p);
StockAvailableFactory StockAvailableFactory = new StockAvailableFactory(BaseUrl, Account, Password); Bukimedia.PrestaSharp.Entities.stock_available p = StockAvailableFactory.Get(a.id); p.quantity = a.quantity; StockAvailableFactory.Update(p);
cuando creo y/o actualizo un articulo se ejecuta bien, pero al revisar el articulo muestra el precio en 0 y el stock en 0
adjunto codigo:
ProductFactory ProductFactory = new ProductFactory(BaseUrl, Account, Password); Bukimedia.PrestaSharp.Entities.product p = ProductFactory.Get(A.id); p.id = A.id; p.ean13 = ""; p.minimal_quantity = 1; p.additional_shipping_cost = 0; p.ecotax = 0; p.available_for_order = 1; p.customizable = 1; p.uploadable_files = 0; p.active = A.active; p.condition = ""; p.cache_is_pack = 0; p.cache_has_attachments = 0; p.cache_default_attribute = 0; p.id_category_default = A.id_category_default; p.id_default_combination = A.id_default_combination; p.id_default_image = A.id_default_image; p.id_manufacturer = A.id_manufacturer; p.id_product_redirected = A.id_product_redirected; p.id_shop_default = A.id_shop_default; p.id_supplier = A.id_supplier; p.id_tax_rules_group = A.id_tax_rules_group; p.indexed = A.indexed; p.AddLinkRewrite(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.link_rewrite)); p.location = A.location; p.meta_description.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.meta_description)); p.meta_keywords.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.meta_keywords)); p.meta_title.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.meta_title)); p.name.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.name)); p.on_sale = A.on_sale; p.online_only = A.online_only; p.position_in_category = 0; p.price = A.price; p.redirect_type = "301-category"; p.reference = A.reference; p.show_condition = 0; p.show_price = A.show_price; p.state = 1; p.supplier_reference = ""; p.text_fields = 1; p.unit_price_ratio = A.unit_price_ratio; p.unity = ""; p.upc = ""; p.visibility = "both"; p.wholesale_price = A.wholesale_price; p.description.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.descripcion)); p.description_short.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.language((long)1, A.descripcion)); p.associations.categories.Add(new Bukimedia.PrestaSharp.Entities.AuxEntities.category((long)A.id_category_default));
StockAvailableFactory StockAvailableFactory = new StockAvailableFactory(BaseUrl, Account, Password); Bukimedia.PrestaSharp.Entities.stock_available p = StockAvailableFactory.Get(a.id); p.quantity = a.quantity; StockAvailableFactory.Update(p);