I am using the Commerce Stock module to incorporate stock control in to a drupal commerce store.

The stock control feature allows me to enter the number of each item size that we have in stock by using product variations.

However, when the item is displayed selecting a different size causes the product images to load again. In my case this is not necessary as the size of the clothing does not alter the picture to be displayed.

Is there a way to disable the javascript from firing a reload when a specific list item is changed? In my case that would be the size.

Thank you

Comments

bojanz’s picture

Status: Active » Fixed

No, this is by design.
The image in your case stays the same, but an entire new variation has been loaded (since you changed one of the attributes).
You could find a way to trigger a no-JS mode I guess but it would be quite a regression (you would lose price calculation, stock calculation etc on all non-default variations). You can try asking in the Commerce issue queue about that.

mrackham’s picture

Thank you bojanz

I left it as is. When a new size is selected the new variation loads and the images are loaded with it. The pictures are the same visually, but the files are different.

This leads to unnecessary bandwidth, browser delays and HDD storage. Each product has 5-8 variations, with 4-5 images per variation and then times that by each imagecache size (another 4 or 5) and this is a significant number of files. There is a saying a billion here a billion there, and all of a sudden you are talking about real money. Well the image folder on the site i'm currently working on looks a bit like that. I recommend you don't purge your imagecache's cache - you only make that mistake once.

For those who read this in the future and are interested, here are some more posts on the same issue:
http://drupal.stackexchange.com/questions/17956/feeds-import-causing-dup...
http://drupal.org/node/1357934
http://drupal.org/node/1171114

and http://drupal.org/project/filefield_sources may be an option

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.