• Resolved max_Q

    (@max_q)


    Hi,

    Trying to use your plugin on a client site and there’s no visible variation slug field in the “Add product gallery images” media gallery. With no ability to add the variation slug to the images, all the images are being filtered out, so no images are visible in the image gallery.

    I disabled all other plugins and tried two themes, the one I’m working on and WooCommerce’s Storefront, to try and remove any conflicts. No luck.

    Regards

    https://www.ads-software.com/plugins/smart-variations-images/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author David Rosendo

    (@drosendo)

    Hi max,

    You first have to create THE variations in the product and save! Then they will show up. Until then no options will appear… This is explained in the install…

    On your product assign the product attributes and save

    Please tell me how it goes…

    Thanks

    Thread Starter max_Q

    (@max_q)

    Hi David,

    All the products are variable products with three variations (colors) and all the attributes (black, brown, white) have been created and assigned.

    All the variations have default images, and they show up when you choose a particular attribute (and it’s enabled in your plugin’s settings). Each product has a gallery with maybe twenty images and right now none of the gallery images are showing up because I haven’t been able to find the variation slug dropdown.

    Curious, huh?

    Plugin Author David Rosendo

    (@drosendo)

    Indeed Curious…

    [ redacted ]

    I will give it a look most probably monday morning Lisbon time.

    Thanks,
    David

    Thread Starter max_Q

    (@max_q)

    Sorry, I can’t. It’s a client site with some proprietary info in the back end.

    I like the functionality of your plugin enough to spend some time seeing if I can suss out what’s going on. I’ll let you know what I find. Thanks for your interest.

    Regards

    Thread Starter max_Q

    (@max_q)

    Okay, David, here’s what I think is going on:

    I have two attributes for my products, Finish (pa_finish) and Color (pa_color). The particular product I’m using for testing only has Color as an applicable attribute, not Finish.

    On line 311 of smart-variations-images.php you assign the variable $variations the value of ‘true’. You then loop through each attribute and use the terms used by the post to create the select control. During the loop, if this particular post doesn’t use any of the terms of the current attribute (as is the case with my test product when looping through the ‘Finish’ attribute) you change the value of $variations to ‘false’. When you do the test ‘if ($variations)’ on line 329 the result is false, and your addition of the Variation Slug dropdown to the form is never created.

    The bottom line is, if the product didn’t use at least one term of all of the attributes, no matter that it used some of the attributes, you’ll never see the Variation Slug control.

    I propose starting out by assigning the $variations variable the value of ‘false’. Then, during the loop ‘if (!empty($fabric_values))’ on line 318 changing the value of $variations to ‘true’. You would only reach that point if the current post has at least one term of at least one of the attributes. But that’s all it takes, right? Get rid of the ‘else’ section on line 322, as it’s no longer needed. This allows me to see the Variation Slug control.

    I’m going to do more testing now.

    Regards

    Plugin Author David Rosendo

    (@drosendo)

    Hey! good point…

    I will commit a version update by tomorrow with a new approach then.

    Thanks! please tell me how it goes..

    Thread Starter max_Q

    (@max_q)

    Marking resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No variation slug field’ is closed to new replies.