mrheslop
Forum Replies Created
-
Just add this to your functions.php and then have a look at a variation in admin. Explanation and fix given in previous response (i.e. ‘options’ class)
add_action( ‘woocommerce_product_after_variable_attributes’, ‘woo_option_test’, 10, 3 );
function woo_option_test( $loop, $variation_data, $variation )
{
echo ‘<div class=”options”>OPTIONS 1</div>’;
echo ‘<div class=”options”>OPTIONS 2</div>’;
echo ‘<div class=”options”>OPTIONS 3</div>’;
}Cheers, MrH
- This reply was modified 5 years, 8 months ago by mrheslop.
Hello
For anyone else who finds themselves in this situation.
For me, this was caused by a plugin conflict whereby another plugin had generated HTML within the variation panel which included an element with a class called “options”. This is used by Woocommerce for the main variation options (Enabled, Downloadable, Virtual, etc), but is also used by this plugin for injecting the image uploader.
The WooCommerce Additional Variation Images Gallery plugin injects their “ImageUploader” HTML (for image selection) into each variation panel using an insertBefore() method targeting the ‘option’ class.
So in my case, given that there were two ‘option’ classes within the variation container, this plugin injected two “ImageUploader” objects.
Can I suggest to the plugin author that they tweak the javascript to target only the first() option class, rather than all of them to avoid similar plugin conflicts?
File: plugins/woo-variation-gallery/assets/js/admin.js (Line 138)
Change From: var optionsWrapper = $(this).find(‘.options’);
Change To: var optionsWrapper = $(this).find(‘.options’).first();
Hi, thanks for quick reply.
Yes, duplicates showing on frontend. Every time I save the product, another duplicate image is added.
I don’t install plugins on a live site without testing locally, so no URL I’m afraid.
Activate/deactivate didn’t work.
Can you describe the solution which was previously provided via image when the problem was raised in a previous topic? It referred to “Do you have this option selected?”
Many thanks.