Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Undefined variables in paypal_standard.php


BrockleyJohn

Recommended Posts

I have been doing some testing at what is presumably a currently unsupported php version (5.5.26) since I've not found any other reports of this problem. When coming back to osC from making a payment in Paypal, checkout_process.php is throwing up these notices:

Notice: Undefined variable: total_weight in /<snip>/oscommerce/includes/modules/payment/paypal_standard.php on line 627
Notice: Undefined variable: total_products_price in /<snip>/oscommerce/includes/modules/payment/paypal_standard.php on line 628
Notice: Undefined variable: products_tax in /<snip>/oscommerce/includes/modules/payment/paypal_standard.php on line 628
Notice: Undefined variable: total_products_price in /<snip>/oscommerce/includes/modules/payment/paypal_standard.php on line 629
Notice: Undefined variable: total_cost in /<snip>/oscommerce/includes/modules/payment/paypal_standard.php on line 629

from these lines in the before_process function:

$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;

I've checked and pertinent parts of the module seem to be identical in 2.3.4, BS and the latest versions on github in both resposive & osc2 repositories.

 

Now, I could declare the variables first to make the notice go away, but I couldn't find anywhere they actually get used... and I couldn't even find that $total_products_price and $products_tax get set anywhere.

 

Am I missing something or are these lines perhaps a left-over from some previous processing that can safely be pruned? Anyone recognise them?

 

TIA

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

Hi

for example $total_tax referal to amount_1 PP parameter and so on. Previous declaration is the best solution.

 

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

But why dont you use PP app?

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I'm going to use the app, I was testing something else and wanted to quickly pay for a test order - the assumption was that I could just turn on pp standard, put in the sandbox email address and go... the idea was not to get distracted setting up the pp app

 

so instead I got distracted on pp standard!

 

I'm going to find it hard not to keep looking at it, it's still bugging me that I can't see how values could get in there. I can see what you're talking about on the params for the process button on the way out to pp, but this is afterwards and it only seems to look at orders->products

 

Anyway, it's not important. Thanks for the pointers

 

cheers, John

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...