Tag Archives: plug in

WP E-Commerce plug in: fixing output from USPS rate calculator

I have used the WP E-commerce plug in for several WordPress online stores that I have developed for clients, and one thing that I have run into more than once is this: the names of the carriers when you calculate USPS shipping rates often have an unsightly line of code in them:

Priority Mail<sup>®</sup> Flat Rate Envelope
Express Mail<sup>®</sup> Flat Rate Envelope
Parcel Post<sup>®</sup>

Here is the way to fix it. OpenĀ  wp-e-commerce/wpsc-includes/cart.class.php and find this line of code:

function wpsc_shipping_quote_name() {
 global $wpsc_cart;
 return $wpsc_cart->shipping_quote['name'];
}

Replace that block of code with this:

function wpsc_shipping_quote_name() {
	global $wpsc_cart;
	//return $wpsc_cart->shipping_quote['name'];

   $output .= $wpsc_cart->shipping_quote['name'];
+  $output = str_replace('&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt;', '<sup>&reg;</sup>', $output);
+  $output = str_replace('&amp;lt;sup&amp;gt;&amp;amp;trade;&amp;lt;/sup&amp;gt;', '<sup>&trade;</sup>', $output);

   return $output;
 }

Now simply save the file and your problem should be fixed! That has worked every time for me, but let me know if you have any trouble.