WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Apostrophes in E-commerce not showing correctly

[Resolved] Apostrophes in E-commerce not showing correctly

  • MagicFire
    Member

    @magicfire

    Hi,

    I have a problem. This code

    $sql = $wpdb->prepare( "
    		SELECT {$selects}
    		FROM {$wpdb->posts} AS p
    		{$joins}
    		WHERE
    			p.post_type = %s
    			AND
    			p.post_parent = %d
    	", 'wpsc-product',$product_id );

    gives me this:

    SELECT pm.meta_value AS price, pm2.meta_value AS special_price FROM wp_posts AS p INNER JOIN wp_postmeta AS pm ON pm.post_id = p.id AND pm.meta_key = ‘_wpsc_price’ INNER JOIN wp_postmeta AS pm2 ON pm2.post_id = p.id AND pm2.meta_key = ‘_wpsc_special_price’ WHERE p.post_type = ‘wpsc-product’ AND p.post_parent = 4705

    The problem is with the double quotes or apostrophes. Both are returned bad. Is this a WP or E-Commerce problem?

    Thanks

    http://wordpress.org/extend/plugins/wp-e-commerce/

Viewing 1 replies (of 1 total)
  • Plugin Author Justin Sainton
    Participant

    @justinsainton

    I suppose that depends – if you’re copying the code from somewhere that has converted single quote characters to their typographic “apostrophe” counter-part, and that’s not getting parsed correctly – that’s a problem with copying code. Single/double quotes should be just fine in the code above.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Apostrophes in E-commerce not showing correctly’ is closed to new replies.