Support » Plugin: Additional Variation Images Gallery for WooCommerce » Variation image section being displayed twice in admin section

  • Resolved mrheslop

    (@mrheslop)


    Variation image section being displayed twice in admin section.

    Causing anomolies. Each time product is saved, an extra duplicate image is added to the gallery.

    You answered this previously in another topic by image, which is now a 404.

    Can you please respond with a permanent solution?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there,

    Is the duplicate image showing on the frontend? please share the product page url. Sometime update causes unexpected behavior, try deactivating our plugin and then reactivate again, see if it fixes your issue

    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?”

    https://wordpress.org/support/topic/variation-image-section-being-displayed-twice-in-admin-section/

    Many thanks.

    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 @mrheslop,

    Could you record me your issue using tool like useloom.com

    Thank You

    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 8 months, 4 weeks ago by mrheslop.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Variation image section being displayed twice in admin section’ is closed to new replies.