Jump to content

PHP and MYSQL e-commerce help


blinkmadden

Recommended Posts

Hi, My name is Luther, I am new to this forum.

 

Could you guys help me figure out how to include the shipping cost and adding it to the total price of the items purchased in the Paypal. Firstly, I used the Beginning PHP and MySQL E-commerce book to build my e-commerce website. Then, I have completed till the storing customer orders and decided to use Paypal as my primary payment method. I am having trouble in adding the shipping cost to the total amount that the customer is about to pay when they check out. All thoughts are welcome.

 

Here is my Paypal form code (include/config.php):

// PayPal configuration

define('PAYPAL_URL',

'https://www.paypal.com/xclick/[email protected]');

define('PAYPAL_CURRENCY_CODE', 'USD');

define('PAYPAL_RETURN_URL', 'http://localhost/tshirtshop/');

define('PAYPAL_CANCEL_RETURN_URL', 'http://localhost/tshirtshop/');

 

Here is the paypal redirect link (presentation/checkout_info.php)

// This will contain the PayPal link

      $redirect =

        PAYPAL_URL . '&item_name=TShirtShop Order ' .

        urlencode('#') . $order_id .

        '&item_number=' . $order_id .

        '&amount=' . $this->mTotalAmount .

        '&currency_code=' . PAYPAL_CURRENCY_CODE .

        '&return=' . PAYPAL_RETURN_URL .

        '&cancel_return=' . PAYPAL_CANCEL_RETURN_URL;

 

      // Redirection to the payment page

      header('Location: ' . $redirect);

 

Here are the screens:

 

http://www.freeimagehosting.net/image.php?8c004417ff.jpg

http://www.freeimagehosting.net/image.php?c1e747981b.jpg

 

I would appreciate your help. Please let me know if you want to see the rest of my codes. Btw, I used Xampp to integrate the website. Thanks!

Link to comment
https://forums.phpfreaks.com/topic/170339-php-and-mysql-e-commerce-help/
Share on other sites

  • 3 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.