BV Commerce Forum
»
BV Commerce Support
»
Development
»
Extending BV Product Class for image collection
Rank: Member
Joined: 4/29/2010(UTC) Posts: 256
Thanks: 4 times Was thanked: 11 time(s) in 10 post(s)
|
I am currently developing a new front page content block which will use some specialist (read variable size) images. As they are of a specialist nature I do not want to user either the small, medium or the additional images as these images will break other elements within the theme.
I don’t think I could use the Product.CustomProperty as these are already in use to a varying degree on the several sites this content block will be used upon.
Can anyone think of an alternative method of extending the product class to accommodate another image collection, without having to modify the Core?
|
|
|
|
Rank: Member
Joined: 4/29/2010(UTC) Posts: 256
Thanks: 4 times Was thanked: 11 time(s) in 10 post(s)
|
I resolved the above by utilising the Component settings in the end as this seemed a better fit with regards to the open/closed principle.
|
|
|
|
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)
|
Steve,
Can you elaborate on why you didn't think a CustomProperty would work? |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 4/29/2010(UTC) Posts: 256
Thanks: 4 times Was thanked: 11 time(s) in 10 post(s)
|
Aaron One of the sites has a lot of custom properties for a few products (over a hundred) which it takes a fair amount on time to retrieve and parse the xml via its mapper in the core. This is the only time I have seen this many CustomProperties so it is probably an edge case as BV doesn’t have any issues with address for instance using the same functionality. Edited by user Wednesday, August 26, 2015 7:49:35 AM(UTC)
| Reason: Not specified
|
|
|
|
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)
|
Originally Posted by: Steve95 One of the sites has a lot of custom properties for a few products (over a hundred) which it takes a fair amount on time to retrieve and parse the xml via its mapper in the core. Wow! Yeah, that's a little extreme and probably not an appropriate use of Custom Properties. Is the data valid? The reason I ask is that earlier versions of 5.X had a bug when cloning products that caused duplication of Custom Properties. So, if you cloned a clone you would multiply the number of properties. Back to your question, the only real downside to using Component Settings is that it requires an extra SQL query (or more, depending how you do it or how many settings you have to retrieve) compared to Custom Properties, which you would have already loaded with the product. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 4/29/2010(UTC) Posts: 256
Thanks: 4 times Was thanked: 11 time(s) in 10 post(s)
|
It’s all valid but I believe this particular site has been on BV pre 5.0 when apparently it was "the only way" its functionality could be carried out before the introduction of product properties. Edited by user Wednesday, August 26, 2015 9:18:24 AM(UTC)
| Reason: Not specified
|
|
|
|
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.