Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
Hello Team.
We have product import process in which we have received product xml and we insert product and product variant into DB. There is "Size" variant(i.e Product variation) with value 32,24,36 etc. While Product import Variant products get inserted into bvc_Product table(Field Name: ProductName i.e Product name + size)
Now we are facing issue while updating product. If any new variant values are added in XML during import (i.e. size having value 40,42 needs to be added or 34 has to be removed from existing ) then how should these new values to be reflected in bvc_Product table. How can we implement this scenario?
Example, Product Name-> Product 1 Variant1 -> Product1_32 Variant2 -> Product1_34 Variant3 -> Product1_36 These are successfully imported into database.
Now, we need to remove Variant3 -> Product1_36 from the Product_1 and insert any new variant Variant4 -> Product1_40. Please let us know how should we achieve this.
We have used following code while inserting variant product:
Product p = new Product(); //get product information in P
BVSoftware.Bvc5.Core.Catalog.ProductChoice pc = new BVSoftware.Bvc5.Core.Catalog.ProductChoice(); pc.Name = "Size"; pc.DisplayName = "Size"; pc.Type = "Drop Down List"; pc.ParentProductId = ProductBvin;
BVSoftware.Bvc5.Core.Catalog.ProductChoiceOption pco0 = new BVSoftware.Bvc5.Core.Catalog.ProductChoiceOption(); pco0.DisplayText = "Size"; pco0.IsNull = true; pc.ChoiceOptions.Add(pco0);
BVSoftware.Bvc5.Core.Catalog.ProductChoiceOption pco1 = new BVSoftware.Bvc5.Core.Catalog.ProductChoiceOption(); pco1.DisplayText = Vsize1; pc.ChoiceOptions.Add(pco1);
BVSoftware.Bvc5.Core.Catalog.ProductChoiceOption pco2 = new BVSoftware.Bvc5.Core.Catalog.ProductChoiceOption(); pco2.DisplayText = Vsize2; pc.ChoiceOptions.Add(pco2);
p.ChoicesAndInputs.Add(pc); p.GlobalProduct.CreateCombinations(); p.Commit();
Above code is perfectly working for inserting Product variation. Now we need to implement update Product variation i.e. size will added/removed from existing product.
Could you please help us to implement this functionality.
|
|
|
|
Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
Hello Team,
We are using BVC 2015. Could you please help us to implement update Product variation i.e. size will added/removed from existing productchoice.
Thank You.
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
It looks like you are on the right track. I would suggest that you look at the code used in the admin to manage this data (/BVAdmin/Catalog/ProductChoices.aspx.vb). That should point you in the right direction.
Depending on the behavior that you want you can either delete the choice option (e.g. size XX) or you could disable the variant. The latter will still display on the product page (unless you're running BVC 2018 or above and your product only has one choice) but will display an invalid option message when selected.
One other important note: there is not a one-to-one mapping of choice options (e.g. size XX) to variant products (i.e. a specific product record) because BVC supports multiple choices (e.g. size and color--where a user must select both size and color options to resolve to a specific product record). |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
Thank you for the reply. We will check the code "/BVAdmin/Catalog/ProductChoices.aspx.vb" module and will implement functionality. If we have any query, we will let you know.
Thank You.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.