Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Swatches assets show up while unneeded #2998

Closed
loekvangool opened this issue Jan 26, 2023 · 0 comments · Fixed by #2999
Closed

Configurable Swatches assets show up while unneeded #2998

loekvangool opened this issue Jan 26, 2023 · 0 comments · Fixed by #2999
Labels

Comments

@loekvangool
Copy link
Contributor

loekvangool commented Jan 26, 2023

Preconditions (*)

While re-saving the Configurable Swatches settings, I removed "Product Attribute to Use for Swatches in Product Listing" and "Dynamic Price Change for Swatches in Product Listing", or configswatches_general_product_list_attribute (to NULL) and configswatches_general_product_list_price_change (to 0).

Expected result (*)

The Configurable Swatches JS and CSS assets and code should not end up in listviews, if no configuration exists for listviews.

Actual result (*)

Several assets are loaded, and a JavaScript block is included with unneeded code.

<script type="text/javascript" src="skin/frontend/rwd/default/js/configurableswatches/product-media.js"></script>
<script type="text/javascript" src="skin/frontend/rwd/default/js/configurableswatches/swatches-list.js"></script>

<script type="text/javascript">
  $j(document).on('product-media-loaded', function() {
    ConfigurableMediaImages.init('small_image');
    ConfigurableMediaImages.setImageFallback(123, $j.parseJSON('{"option_labels":[],"small_image":{"51381":"https:\/\/....png"},"base_image":[]}'));
    $j(document).trigger('configurable-media-images-init', ConfigurableMediaImages);
</script>

Furthermore, I ran into a coding error in Mage_ConfigurableSwatches_Helper_Mediafallback->getConfigurableImagesFallbackArray(), where an empty configuration was not expected (but possible by resaving the Configuration page).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant