organicinternet / magento-configurable-simple

Enhancement to Magento to allow simple product prices to be used instead of the default special-case configurable product prices
http://organicinternet.co.uk/
283 stars 267 forks source link

Suggestion for improvement to make the extension more custom theme compatible #38

Open alsd opened 13 years ago

alsd commented 13 years ago

I was integrating this extension to a custom theme and faced a few issues. Turned out it was just a matter of missing div class and elements for image area which you highlighted in the "Lightboxes" section under readme.

In the scp_product_extension.js,

  1. 241, #251 #264 - Would it be possible to target the "shortDescription", "description", "productAttributes" with no dependency of clases?

    $$('#product_addtocart_form div.short-description div.std').each(function(el) $$('div.box-description div.std').each(function(el) $$('div.product-collateral div.box-additional').each(function(el)

  2. 305 - remove the dependency for imageZoomer code but target the "product-image" class or just the ".product-img-box", this should solve the custom image gallery that uses lightbox-alike gallery. #315 to #336 has nothing to do with popup gallery script but zooming feature - SCP updates the product image, but in the default theme, the zoom feature is just an extension for zooming therefore SCP can do without it.

and in line #217, $$('#product_addtocart_form p.product-image img').each(function(el) { use just the ".product-image img" without p tag.

toasty commented 13 years ago

Cheers for taking the time to suggest some improvements :)

#241, #251 #264 - Would it be possible to target the "shortDescription", "description", "productAttributes" with no dependency of clases?

I don't really like that they're dependent on classes either. Do you have suggestions for how else to do it?

Regarding the image zoomer stuff, if SCP doesn't do all this then the built-in image zoomer just breaks. Possibly there's a nicer way to do it though. Certainly working with most other lightboxes is vastly easier than working with Magento's zoomer when it comes to refreshing the images, but the zoomer is what comes by default so that's what SCP targets.

BTW, SCP supports two image updating 'modes', one where it just directly replaces the main product image, and another where it replaces the whole product-img-box block (i.e. including the 'more views' section etc). It's this second one that this showFullImageDiv() function handles, and it's in this case that all the zoomer code is needed. The much simpler updateProductImage() is used if you just want to update the single image.

and in line #217, $$('#product_addtocart_form p.product-image img').each(function(el) {
use just the ".product-image img" without p tag.

Could do, if it helps when themes aren't using paragraph tags here.