Product variation colors swatches (both image and color, tried in separate variations) are not showing in simple products. The color variation swatches are only showing on variable products using the same variations.
I am using WP Gridbuilder for filtering. Colors and images swatches are not showing on color variation filtering facet.
Any time I use existing images in the media library for product images, they do not show up on the product pages.
Here’s what I’ve tried:
Disable all non-essential plugins Cleared Woocommerce cache Deleted/recreated products Deleted/recreated image and images variations Deleted/recreated a second set of color variations Deleted/reuploaded images Checked permissions on uploads folder I’ve tried this locally and hosted, same results.
*I’m running WordPress 6.6.1, with Woo 9.2.2, and Bricks Builder 1.10.1.
Any idea on if these two could be related? Any pointers on how to fix things or where to start?
Thank you for bringing this to our attention. This is indeed unusual, and they do seem to be related. Can you tell us which plugin you’re using for the variation swatches? WooCommerce only supports color swatches natively, so I take it you’re using a third-party plugin.
Since this concerns images, it’s probably breaking both the swatches and the product images. To confirm, have you tried disabling any such plugin to see if at least the product images return? I’d start checking there.
If this still doesn’t work, a full conflict test would be advised. I see you’ve done this partially, but it’s recommended to do a full test, with a default theme and every other plugin except WooCommerce (and any other plugin needed for the feature you’re testing) active.
@omarfpg …after doing some further digging, it appears that the problem is that WC is not attaching the images to the product. Without the images being attached, they are not showing on the frontend.
This is still a issue but yes the following SQL script fixed this for me.
UPDATE wp_posts AS p INNER JOIN ( SELECT p.ID AS attachment_id, pm.post_id AS post_id FROM wp_posts p JOIN wp_postmeta pm ON pm.meta_value = p.ID WHERE ( pm.meta_key = '_thumbnail_id' AND p.post_type = 'attachment' AND p.post_parent = 0 ) ) AS b ON p.ID = b.attachment_id SET p.post_parent = b.post_id
Since you are not importing products and images I do not think you are facing the same issue as this GitHub issue. But somehow images are not getting attached to the product.
Any time I use existing images in the media library for product images, they do not show up on the product pages.
This action should be performed by WooCommerce core. To find out what is causing this problem I suggest a full conflict test.
You may set up a staging site if you do not want to affect your live site. The WP Staging plugin is a good way to create a staging site.
Once you have disabled all other plugins except WooCommerce and switched to the Twenty Twenty-four theme, could repeat the steps for adding images? Then check if the problem persists.
It would be helpful if you could record a video of these steps and share it with me. You can use an online tool like AwesomeScreenshot to record your screen.
I’ve performed the conflict test. Still the same results. Quick question…is Woocommerce supposed to ‘attach’ images to products either initially upon creation and/or added from the existing media library assets?
I’ve performed the conflict test. Still the same results.
Are you able to confirm that you switched to a default theme when running the test?
is Woocommerce supposed to ‘attach’ images to products either initially upon creation and/or added from the existing media library assets?
WooCommerce allows you to attach images to products, both initially upon creation and from the existing media library assets. When creating a new product, you can add images in the ‘Product Image’ section. If you want to add images from your existing media library, simply click on ‘Add product gallery images’ and select the images you wish to attach to that particular product. More details can be found here.
Thank you for confirming! So, upon editing a product by changing images, you would then need to manually unattached the former images and manually attach images from the media library, right?
As a user, I would assume that WC would perform this automatically.
To you comment “WooCommerce allows you to attach images to products, both initially upon creation and from the existing media library assets. When creating a new product, you can add images in the ‘Product Image’ section. If you want to add images from your existing media library, simply click on ‘Add product gallery images’ and select the images you wish to attach to that particular product. “
That is the problem…WC is not automatically attaching/unattaching images that exist in my media library when I edit a product.
I performed another test on my local site and noticed that when we edit an existing product and change the Product Image by selecting an existing image, the Media Library still shows “Unattached” for the image.
But on my local site, the images still show up even when they are unattached. This is not happening on your site and this raises a question of what is causing this behavior on your site.
To troubleshoot this further and find a solution, I suggest you perform another conflict test and record a video. You can use the Awesome screenshot tool to record your screen and share it with me. This will me trace your steps and compare them with my steps on the local site.
I remember this thread! Getting back to the top of it, the issue happens with the variation swatches images, correct? Does adding the images regularly to the product gallery or as the featured image for each variation (not using the variation swatches image plugin you’re using) work as expected?
On that note, which plugin are you using for that feature? We don’t have a link to your site or your System Status Report, so we don’t have all the details yet. Can you tell us if your WooCommerce, WordPress, theme, and any Woo-related plugins are up to date?
Additionally, do you find any errors in your WooCommerce > Status > Logs?
I guess I’m just wondering if WC is coded to attach/unattach images when adding, editing, etc?
I don’t think that’s the case, as I just tested on a clean install of WordPress/WooCommerce by adding an image to the media library, then editing a product and setting that image as the featured image and it still shows as unattached on the media library. However, I don’t think that’s the issue, as my product works just fine and it displays the image in the front end as expected. (Still, it’s a thread to pull if we don’t find any other possible reason!). Let’s keep digging and see what we find out.
Thanks! -OP
Viewing 11 replies - 1 through 11 (of 11 total)
The topic ‘Image and variation trouble’ is closed to new replies.