BV Commerce Forum
»
BV Commerce Support
»
Tools & Downloads
»
OK to link Product to existing Modifier/Variation by adding record to bvc_ProductXModifier?
Rank: Member
Joined: 5/2/2005(UTC) Posts: 259
|
I also need to add Product Variations to a large number of products, after using the Import-Export tool. Is it OK to just add the appropriate records to the bvc_ProductXChoice table to achieve this? Again, I'm just being paranoid (like on my question regarding adding Product Categories at [2]http://forums.bvcommerce...spx?f=84&m=63337[/2]), that if I do this, there isn't some unintended consequence lurking out there that I didn't think of. Thanks for any guidance or confirmation you can provide!
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Just adding a row to bvc_ProductXChoice will not be enough. There are a lot of other table rows generated for variant products.
|
|
|
|
Rank: Member
Joined: 5/2/2005(UTC) Posts: 259
|
Marcus, I'm hoping that I was vague on my original questions, and that (hopefully) the answer is yes I can do that after all (after I explain better). I think that maybe it sounded like I was asking how to create the variant in the first place (which, understandably will be complex due to the choices within the variant, etc). What I'm after is, after a variant has already been properly created (via the BVC Admin), is it OK to associate that existing variant with a product by just adding a record to the bvc_ProductXModifier table (I mistakenly stated the bvc_ProductXChoice previously)? For example, if I already have the following records created (for a product and modifier, respectively): Code: bvc_Product.bvin: 580c157b-4753-4c1f-8abf-7ec38fd8e8ee bvc_ProductModifier.bvin: 5ea72281-14fb-46f7-934a-d40a0f34b4a0
And I add them to the bvc_ProductXModifier like so: Code: bvc_ProductXModifier.ProductId: 580c157b-4753-4c1f-8abf-7ec38fd8e8ee bvc_ProductXModifier.ModifierId: 5ea72281-14fb-46f7-934a-d40a0f34b4a0 bvc_ProductXModifier.LastUpdated: 6/8/2009 1:21:19 PM
Will that work? Or is there still something else that needs to done elsewhere?
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Here are some notes I made when writing a direct database import tool for BV5. You'll see that variant products live in several tables at the same time:
Manually creating products directly in the database:
bvc_Product - Holds main product data. Create records here first. Use GUID for bvin 0749e52b-6029-49bc-b715-4cbdf2720946
bvc_ProductType - assigns product properties to products. Optional. Can be left empy
bvc_ProductXCategory - links products and categories. Use category bvin and product bvin
bvc_ProductInventory - Should create one just for safety
Adding a single choice
bvc_ProductChoices - Create a choice here first (has productBVIN field too) (bvin,"Name","displayName",productbvin,SharedChoice T/F,"Drop Down List", date)
bvc_ProductXChoice - links a choice to a product - ProductBVIN, ChoiceBVIN
bvc_ProductChoiceOptions - selections for drop down bvin,choicebvin, "ProductChoiceName",Order = zero based int, Default T/F, Null T/F, date
bvc_ProductChoiceInputOrder - Sorted list of all choices assigned to product productBvin, ChoiceInputBvin, sortOrder (zero based), date
Create child products in bvc_Product with parentID or Root and unique SKUs Create child inventory records No need to link children to cateories
bvc_ProductChoiceCombinations - Stores all combos of choices
bvin UniqueID ChoiceId BVIN of choice ChoiceOptionId BVIN of choice option ProductId BVIN of child product that represents this combo ParentProductId BVIN of parent (root product) Available T/F Date
|
|
|
|
Rank: Member
Joined: 5/2/2005(UTC) Posts: 259
|
Marcus, that's definitely helpful info to have, for knowing how things are related.
But, I still think (hope?) that I worded my original question really poorly, because what I really want to know is much more narrowly focused.
Assuming the following:
<UL> <LI>A variant has already been created (properly), via the BVC Admin tool <LI>We know the ID of the variant, located in this table/field: bvc_ProductModifier.bvin (e.g. 5ea72281-14fb-46f7-934a-d40a0f34b4a0) <LI>A product has already been created (either via the BVC Admin tool or a successful import) * We know the ID of the product, located in this table/field: bvc_Product.bvin (e.g. 580c157b-4753-4c1f-8abf-7ec38fd8e8ee) </UL> At that point, I'm thinking we could create the link/relationship between the product and an existing modifier, by adding a record to the bvc_ProductXModifier table.
For example, we'd add a record like this:
[table style="WIDTH: 441pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=587 x:str]<COLGROUP> <COL style="WIDTH: 185pt; mso-width-source: userset; mso-width-alt: 8996" width=246> <COL style="WIDTH: 185pt; mso-width-source: userset; mso-width-alt: 9033" width=247> <COL style="WIDTH: 71pt; mso-width-source: userset; mso-width-alt: 3437" width=94>
[tr style="HEIGHT: 12.75pt" height=17][td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 185pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=17 width=246]ProductId[/td][td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 185pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" width=247]ModifierId[/td][td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 71pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" width=94]LastUpdated[/td][/tr][tr style="HEIGHT: 12.75pt" height=17][td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 185pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl24 height=17 width=246]580c157b-4753-4c1f-8abf-7ec38fd8e8ee[/td][td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 185pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl24 width=247]5ea72281-14fb-46f7-934a-d40a0f34b4a0[/td][td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 71pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl25 width=94 align=right x:num="39972.556469907409"]6/8/2009 13:21[/td][/tr][/table]
Will that work to relate a pre-existing product with a pre-existing variant?
P.S. I hope I'm not being really dense at this point (just dense in how I phrased my question in the first place!)
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
If you link a modifier to a variant product without linking it to the main product you could end up with some strange results.
|
|
|
|
Rank: Member
Joined: 5/2/2005(UTC) Posts: 259
|
But isn't my action described above linking a (main) Product to Modifier?
Btw, I'm not sure what a Variant Product is. In my previous post, I did say "Will that work to relate a pre-existing product with a pre-existing variant?", but I really meant "modifier".
I was originally using the terms interchangably, because in the admin, when editing a product, you click a link called "Edit Product Variations" to associate a modifier/choice/variation with the product.
So I'm wondering if part of the confusion is simply terminology?
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Okay, I think that if you want to add a modifier link to the main product then it will work without a problem. My question is why are you doing this in the database instead of just adding it on the "edit product" page in the admin?
|
|
|
|
Rank: Member
Joined: 5/2/2005(UTC) Posts: 259
|
Oh, I'm doing a bulk import of several hundred products, using the Import-Export tool.
For example within this import, we have quite a few hats, by a certain manufacturer, that we'd like all associated with a Shared Modifier (Small, Medium, Large, and X-Large hat sizes, wich X-Large costing extra). We'd like to avoid manually doing this in the admin for every single "brand X" hat.
Instead, I'd like to run a script that iterates through the products and generates the correct table records to associate all "brand X" hats with the "brand X" Shared Modifier.
Am I overlooking an easier way to accomplish this?
|
|
|
|
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.