WordPress.org

Forums

WP eCommerce
[resolved] WP e-Commerce problems with USPS API Shipping quote name. (10 posts)

  1. alfredwestlake
    Member
    Posted 1 year ago #

    I am having problems with the shipping choice names in wp e-commerce USPS shipping. The shipping choices show as:

    Standard Post<sup>®</sup> $6.99
    Priority Mail 2-Day<sup>™</sup> $8.75
    Priority Mail Express 1-Day<sup>™</sup> $35.20

    Actually it doesn't even show the special characters it shows the character codes rather than the trademark and copyright symbols.

    I can't seem to figure out how to or where to fix the problem. It seems to be coming from the usps API and is the:

    <label for='<?php echo wpsc_shipping_quote_html_id(); ?>'><?php echo wpsc_shipping_quote_name(); ?></label>

    But quite honestly I am lost as to how to fix it.

    Thanks for any help,
    Alfred

    https://wordpress.org/plugins/wp-e-commerce/

  2. alfredwestlake
    Member
    Posted 1 year ago #

    bump

  3. robot_monster
    Member
    Posted 1 year ago #

    After finally getting the USPS working, I believe I'm seeing a similar problem as mentioned above.

    Example:

    First-Class Mail<sup>®</sup> Parcel

  4. robot_monster
    Member
    Posted 1 year ago #

    Temporary fix as follows:
    In wp-e-commerce\wpsc-components\theme-engine-v1\helpers\shipping.php
    look for the wpsc_shipping_quote_name() function at line 66.

    Replace it with this:

    function wpsc_shipping_quote_name() {
       global $wpsc_cart;
    
      $fix = str_replace("& a m p ; l t ; sup & a m p ; g t ; & a m p ; # 1 7 4 ; & a m p ; l t ; / s u p & a m p ; g t ;", "<sup>& reg ;</sup>", $wpsc_cart->shipping_quote['name']);
      $fix = str_replace("& a  m p ; l t ; s u p & a m p ; g t ; & a m p ; # 1 5 3 ; & a m p ; l t ; / s u p & a m p ; g t ;", "<sup>& trade ;</sup>", $wpsc_cart->shipping_quote['name']);
    
      $wpsc_cart->shipping_quote['name']  = $fix;
    
       return apply_filters( 'wpsc_shipping_quote_name', $wpsc_cart->shipping_quote['name'] );
    }

    Just take the spaces out of the search strings - every time I posted the actual code it kept converting the characters.

  5. alfredwestlake
    Member
    Posted 1 year ago #

    Thanks robot_monster, it didn't work for me. I did come up with a solution. But then ran into another problem with another area of WP e-Commerce. So I decided to pack it in and try a different shopping cart solution. I will probably try WooCommerce or something. Too many problems with WP e-Commerce.

    Alfred

  6. alfredwestlake
    Member
    Posted 1 year ago #

    Here is my fix:
    on the wpsc-shopping_cart_page.php on line 172 replace
    <?php echo wpsc_shipping_quote_name(); ?>

    with

    <?php $dogvars = array("&","l","amp;t;supamp;gt;amp","amp;t;/supamp;gt;",";#174;",";#8482;"); $doggynew = str_replace($dogvars,"", wpsc_shipping_quote_name());?>
    <?php $doggyrate = str_replace("Mai","Mail",$doggynew);?>
    <?php echo $doggyrate; ?>

    alfred

  7. JimLS
    Member
    Posted 1 month ago #

    Was this ever updated in the released code or do people still have to patch this? I don't have exactly the same display but think it is related.

    I am still getting:
    Standard Post<sup>&#174
    rather than the display of the symbols this is code for (actually the greater than and less than symbols aren't interpreted either but it changed when I cut and pasted).

    I want rule out any customization on my site causing this before I dig into it. Would like to know if others still get it with uncustomized code.

    It's been several years since USPS API started returning the string that causes this.

  8. Mihai
    Member
    Plugin Author

    Posted 1 month ago #

    JimLS, this has been resolved a while back. From what i know there are no new reports about this issue so if you are using the latest version it should be good to go.

  9. JimLS
    Member
    Posted 1 month ago #

    Could you post links to any more detail? I would like to know what version this was fixed in. I am running a slightly older version because of changes in the way images are handled in the latest versions that cause my site issues.

  10. Mihai
    Member
    Plugin Author

    Posted 1 month ago #

    Try replacing your function in the usps file with the one here:
    https://github.com/wp-e-commerce/WP-e-Commerce/blob/master/wpsc-shipping/usps_20.php#L548

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic