Changing images on attributes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Hello

I have a product ( shoe ) having two key attributes Color and Size ( Dropdown)

I know Nopcommerce 1.6 supports change in pricing if I was to select one of them from the price list.

However I want to know change the product as and when the user selects the color.

I don't want to add each color image as a seperate Product variant

Thanks
Jayesh
13 лет назад
Hi,

I'd say the best way to do this from a user XP perspective is to use JQuery )or similar( to handle the colour attribute change. Working back from this is where the fun starts!

This is the tricky bit. You need each colour/image to match an attribute value.

You can probably hack JQuery around enough to get something meaningful from the drop down or checkbox selection, even with the manageld ids.

I've done 'similar' things with nop/jquery. (See http://www.trionz.co.uk/Category/7-charity-bracelet.aspx). This is a set of ProductBox controls that are hidden, then show using JQuery. Not exactly the same, but the logic is similar. You just need to show all the pics of colours and add the hook to the attribute.

Without delving too much in to the problem, instinct suggests you've got one choice. You'll need to extend the attributes model to include an 'image' field and create your own product attributes type of 'PictureOPtion' (or similar) that adds the attribute selector and messages of choice, but also shows the pictures all hidden that you can then control by JQuery. This lets you render the selection control and the pictures (in divs) based on the same ControlID, so matching the one to show after selection will be easy.

Form experience, you should create and use your own ProductAttributes control, based on the default one. You can hack out all the stuff you don't need and just use a single control type for your bespoke bit.

HTH.
13 лет назад
Hello

Firstly, thanks for your reply and help. However I am a bit confused

How are you adding the images . Would they all go as product variants for each color ? Or its just one product with different images.

I would really appreciate if you could share some code with us related to the way you did

http://www.trionz.co.uk/Category/7-charity-bracelet.aspx

Thanks once again
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.