Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, can you share the shortcode you use which broke the trash button in the cart?

    Thread Starter randellbrantley

    (@randellbrantley)

    It’s a bit more complicated than that. I am using a function call.

    $product_title = esc_attr($post->post_title);
    $title_uk = $product_title . ' **UK postage**';
    $title_europe = $product_title . ' **Europe postage**';
    
    // UK postage
    $cart_button_uk = print_wp_cart_button_for_product(
    	$title_uk,
    	$price,
    	$postage_uk,
    	$var1,
    	$var2,
    	'',
    	array('thumbnail'=>$design_image_src[0]) );

    The other attributes are set on an options page.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi thank you for sharing. The reason why I asked for you to share your shortcode is because no one has reported this issue before. Now if you are using a custom function then that is probably what has caused your issue with the quotes in the Product Title.

    Plugin Author mra13

    (@mra13)

    Is this for single quote or double quotes?

    Thread Starter randellbrantley

    (@randellbrantley)

    It was actually for double quotes with an apostrophe. However, the problem also occurred when I took the apostrophe out:

    Anne Bonny “hang’d like a dog” – T-Shirt

    Plugin Author mra13

    (@mra13)

    I tried that in the shortcode and that seem to work fine. Does this only happen when you are using it in PHP?

    Thread Starter randellbrantley

    (@randellbrantley)

    The product name is: Anne Bonny “hang’d like a dog” – T-Shirt

    With the shortcode if try:

    name=”Anne Bonny “hang’d like a dog” – T-Shirt”

    or

    name=’Anne Bonny “hang’d like a dog” – T-Shirt’

    I get “Error! You must specify a product name in the shortcode.”

    I am now testing this on a different site from the one where I originally had the issue and I can’t replicate the original problem where, when using php, the trash button stops working in the shopping cart.

    However, with the php code the product name gets truncated at the first double quote, so that is reads: Anny Bonny.

    As I said in my original post I can get the php to work perfectly if I alter the plugin code in wspsc-cart-functions.php to escape all the input tag name attributes.

    Plugin Author mra13

    (@mra13)

    The issue with using esc_attr() like the way you suggested is that it then breaks the quantity change functionality when product names have foreign characters (European language characters) in it.

    Thread Starter randellbrantley

    (@randellbrantley)

    Thanks for that advice.

    I tried breaking it with php and the short code with –

    test product é ? ?

    – as the title, it seems to work OK for me and the quantity can be changed on the basket page.

    I will carry on using my slight modification since it seems to be working, at least for me.

    Thanks for the help.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    @randellbrantley that is good news.

    If your issue is now resolved can you mark this support thread as resolved.

    Thank you

    Thread Starter randellbrantley

    (@randellbrantley)

    Thanks for your help

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Quotes in title break trash button’ is closed to new replies.