BV Commerce Forum
»
BV Commerce Support
»
Development
»
Adding additional columns into the database
Rank: Member
Joined: 7/3/2007(UTC) Posts: 79
|
Hi there,
Does anyone have any instructions or guidelines on how to add extra columns to the database?
We need to add 2 additional columns into the product table to support a "thumbnail" image type and an even shorter description or "teaser" for every product.
Has anyone done this or have any details on adding custom items into the db?
Any help would be most appreciated.... thanks :D
Regards,
Jason
Needapresent.com
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
Hi Jason,
Depending on how exactly you are planning on using them it can be a quick and easy db edit and a refactoring of several class files. The difference being how you are hoping to access the additional fields.
What I would suggest instead is simply adding a product property called "teaser" to your products and using the bvc api to use that product property for your teaser.
In regards to the thumbnails, you can use the same approach outlined above with a product property to specify the filename of the thumbnail or if your thumbnails are truely thumbnails (meaning smaller versions of the existing bv catalog images), you can use the .net api to resize them on the fly for the locations you need them in. Do note this later solution will take a few more cpu cycles and a bit of memory to implement, so it may or may not be a viable solution depending on the hardware you have available as well as your traffic patterns. |
Netriplex Corporation<br /> |
|
|
|
Rank: Member
Joined: 6/27/2007(UTC) Posts: 63
|
Great tip caplink - is this how you would envision building something to accomodate the custom fields necessary for some of the shopping feeds? I haven't looked at the Froogle feed as an example yet but just thinking about it... |
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
Depending on what type of settings you are referring to, yes. The froogle feed done by bvc basically makes a csv file of all data in the database, meaning any property that matches a field name google accepts is added into the feed. The shopping feed component we have written has a basic interface for selecting what properties to upload by product type and how to handle shipping data to be included in each feed for each product type. Some engines are very user/developer friendly like Shopping.com as the user can basically upload any feed and map the fields in their shopping.com account. Other engines tend to be a bit more picky. |
Netriplex Corporation<br /> |
|
|
|
Rank: Member
Joined: 7/3/2007(UTC) Posts: 79
|
Hi there,
That sounds great, we use the "teaser" and the thumbnail to display in various sections on the homepage ("New Gifts" & "Top 20") and all of the images have already been created so we wouldn't need to resize them on the fly, even though they are true thumbnails.
I've already added both columns to the db, but am not sure which class files i need to edit to get the values out of the db! For the moment i've managed to get the thumbnails displaying on the home page by building the <img> tag on the fly using the sku, as all our product images are named by sku which makes life a bit easier. But any pointers as how to proceed would be appreciated...
Regards,
Jason
Needapresent.com
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
Hi Jason,
My suggestion was to NOT add anything to the db and use some built in bvc functionality to work around the issue.
By adding those columns to the db you will need to modify stored procedures and pieces of the core and therefore will lose the ability to patch bvc5 in the future (without reapplying everything again at least). You could also just create a seperate sp that simply retrieved those values from the db and not change the class structure.
Personally, I would still recommend my previous suggestion over doing this. |
Netriplex Corporation<br /> |
|
|
|
Rank: Member
Joined: 7/3/2007(UTC) Posts: 79
|
Okay,
I'm gonna be a bit dumb here (fairly new to BV! but certainly not as dumb as Britney :-o )
Do you mean go to Catalog >> Type Properties, create a new property, then create a new product type and add in the property I just created and set all my products to use this new product type? Phew!
Regards,
Jason
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
Yes, it isn't that hard, because one of the batch product edit options should be product type. If that doesn't exist for some reason, you can run a sql query in the db to change the product type of your whole catalog. |
Netriplex Corporation<br /> |
|
|
|
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.