• Resolved SpabRice

    (@spabrice)


    Hello,

    I have a ‘size’ variation which have inches as value. (Example = 15″).
    When I add this now to the cart it adds fine but on the cart page the output adds a backslash ( Example = Size: 15\” ).

    And this probably also is done in the ‘adding’ process because I added the same item with same variations with the default add-to-cart behaviour (plugin disabled) and in the cart page, I now have 2 items listed instead of 1 item with 2 quantities.

    Hope my issue is clear and would really appreciate some help on this.
    Thanks

    https://www.ads-software.com/plugins/woocommerce-ajax-add-to-cart-for-variable-products/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rishi Mehta

    (@rcreators)

    Hello,

    Can i have any url to check. Also is it working fine without plugin ? So i can check in adding process. May be its just issue with variation value with ” and that create issue. so need to check it first.

    Thread Starter SpabRice

    (@spabrice)

    Thanks for the fast reply.

    Unfortunately I’m still on local.
    Yes, it’s definately only for variations with ” in the value.
    The other variations (Color, etc.) works fine.

    I had a look at the cart array “WC()->cart->get_cart()”.
    Here the attribute_size has 2 backslashes (when addded with plugin):
    [attribute_size] => 15\\”

    Yes, it is working fine without plugin.
    I could send you an export of my product if this helps, but in general you can easily test it by creating an attribute ‘Size’ with the values 12″|13″|15″ for example.

    Thread Starter SpabRice

    (@spabrice)

    I think I found a fix.
    In the php file woocommerce-ajax-add-to-cart-variable-products.php at line 124 I added the following below the line.

    foreach ($variation as $key=>$value) { $variation[$key] = stripslashes($value); }

    This strip the slashes for all variation values which does the trick for me. You may inlcude it in your next update or use any custom fix.

    Plugin Author Rishi Mehta

    (@rcreators)

    Hello,

    Thanks for the fix. I will sure add it in next release later this week.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cart output adds backslash to variation value’ is closed to new replies.