Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi! I have the same issue here, tested with several sites and it’s the same. It could be the conflict with the latest Woocommerce version.
    Can you check it?
    Thanks!

    Hello
    Having issues since a week with swatches , can i get help? I cant list new products to my website !
    My page
    https://watashistore.com/

    • This reply was modified 6 years, 3 months ago by watashistore.

    Anyone could help me out ?!,

    I have the same issue!!!

    I found on the Edit Product screen (in the admin) you can assign and save attributes to a product and whilst they do save, the attributes appear to refresh via ajax and are blank. If you reload the page in full, the attributes come back. This happened after upgrading Woocommerce to version 3.5.1

    I have tracked this issue down to line 195 of the file includes/class-admin.php:

    global $thepostid;

    It appears that $thepostid is an integer when the edit page is first loaded, but after saving the attributes, they refresh via ajax and $thepostid is then null.

    A very quick work around which seems to work for me is to add, directly below “global $thepostid” the following:

    global $thepostid;
    if ( ! $thepostid ) {
    $thepostid = $_POST[‘post_id’];
    }

    I found the plugin replaced the default attribute select field but the template markup has been changed in Woo version 3.5 so it causes this issue.
    I updated the markup and it works now. Because the author doesn’t support this plugin any more so I upload a fixed version to Github here https://github.com/duongancol/variation-swatches-for-woocommerce-fixed-
    Hope it helps!

    Thanks a lot x

    Hello @duongancol, first of all thanks for the fixed version. I found a bug: for me it’s impossible to remove some attributes of the list, because they’re are automatically added as soon as you click save button. Did you know it? Some ideas of how to fix it?
    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Color Swatches not working for product’ is closed to new replies.