SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Integrating USPS shipping costs into PayPal?

    Has anyone come upon a solution to adding the shipping costs of USPS to the item for PayPal? I decided to not use a shopping cart, because it seemed simpler to build my own basic store using CakePHP. My client didn't need a very complex system - the original goal was to simply add items to a cart and checkout. I'm using PayPal's services as a cart and also to handle shipping.

    I looked into the USPS web tools, and I have a script set up to retrieve shipping prices for a certain weight and destination. When a customer picks an item, he enters the zip code and it can calculate the shipping fine. It changes the value of the optional "shipping" HTML variable, and then when the "Add to Cart" button is clicked the information is sent to the PayPal server, where the customer finishes the transaction. I did this so that I didn't have to manage any accounts and deal with security issues.

    The problem comes, however, when the customer buys a second item - my scripts have no way of knowing what's already in the cart, since it's on the PayPal servers, and thus has no way of calculating the additional shipping charge for the extra item. I could just add the same amount again, but that would be overcharging the customer by a lot. I could use cookies or session variables to keep track of the number of items in the cart, but even then I won't be able to override the other shipping for the first item.

    I was considering manually setting up zones in the PayPal shipping on a state-by-state basis, but that seems very painful. I'm sort of regretting not using a premade cart at the moment, but it's too late to go back now.

    So the question is: how can I effectively calculate shipping rates and add them to the price of the product?

    Any tips/ideas/suggestions would be greatly appreciated!

  2. #2
    SitePoint Member
    Join Date
    Jan 2001
    Location
    Phoenix, AZ
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •