WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[resolved] Apostrophes in E-commerce not showing correctly (2 posts)

  1. MagicFire
    Member
    Posted 1 year ago #

    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/

  2. Justin Sainton
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.