Situation:
OC 1.5.6 clean installation.
PayPal Express Checkout button: enabled (in checkout layout).
Flat Rate shipping method: disabled (sort order 1).
Weight Based Shipping: enabled (sort order 2). Tax class "Taxable Goods". Enabled for General, UK Shipping and UK VAT Zone.
In the Checkout page, click on PayPal Express Checkout button. In PayPal Gateway choose to pay with credit card (as a guest, not to pay with a PayPal account). Fill in the PayPal form and proceed (continue with the order). Now, the OC Confirm Order page appears with the "What would you like to do next?" and the order information. But...
the Weight Based Shipping is not shown!, and at the top of the page this message appears!:
"Warning: key() expects parameter 1 to be array, null given in /....../catalog/controller/payment/pp_express.php on line 620"
Does anybody know the cause?
Thanks.
Regards.
OC 1.5.6 clean installation.
PayPal Express Checkout button: enabled (in checkout layout).
Flat Rate shipping method: disabled (sort order 1).
Weight Based Shipping: enabled (sort order 2). Tax class "Taxable Goods". Enabled for General, UK Shipping and UK VAT Zone.
In the Checkout page, click on PayPal Express Checkout button. In PayPal Gateway choose to pay with credit card (as a guest, not to pay with a PayPal account). Fill in the PayPal form and proceed (continue with the order). Now, the OC Confirm Order page appears with the "What would you like to do next?" and the order information. But...
the Weight Based Shipping is not shown!, and at the top of the page this message appears!:
"Warning: key() expects parameter 1 to be array, null given in /....../catalog/controller/payment/pp_express.php on line 620"
Does anybody know the cause?
Thanks.
Regards.
My guess is that the shipping isn't set before sending the data to PayPal Express, so it's looking for something that doesn't exist. I'm not sure, but you might have to have your customers apply shipping through the shipping estimator before going to PayPal Express, or get someone to modify it for you so it automatically applies a shipping cost before sending the data.
Thanks Johnathan for your reply.
I've been lokking at this deeper, and I've found that I think an "if-else" is missing. In file catalog/controller/payment/pp_express.php, the sentence:
returns an empty value. Then, the variable "$quote_data" stay empty too, but the code does not take this into account.
I think that the code should be somthing like this:
In conclusion, adding the if-else sentence:
could repair the bug.
Regards.
I've been lokking at this deeper, and I've found that I think an "if-else" is missing. In file catalog/controller/payment/pp_express.php, the sentence:
Code: Select all
$quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address);
I think that the code should be somthing like this:
Code: Select all
if (!empty($quote_data)) {
$sort_order = array();
foreach ($quote_data as $key => $value) {
$sort_order[$key] = $value['sort_order'];
}
array_multisort($sort_order, SORT_ASC, $quote_data);
$this->session->data['shipping_methods'] = $quote_data;
$this->data['shipping_methods'] = $quote_data;
if(!isset($this->session->data['shipping_method'])) {
//default the shipping to the very first option.
$key1 = key($quote_data);
$key2 = key($quote_data[$key1]['quote']);
$this->session->data['shipping_method'] = $quote_data[$key1]['quote'][$key2];
}
$this->data['code'] = $this->session->data['shipping_method']['code'];
$this->data['action_shipping'] = $this->url->link('payment/pp_express/shipping', '', 'SSL');
} else }
unset($this->session->data['shipping_methods']);
unset($this->session->data['shipping_method']);
$this->data['error_no_shipping'] = $this->language->get('error_no_shipping');
} else {
unset($this->session->data['shipping_methods']);
unset($this->session->data['shipping_method']);
$this->data['error_no_shipping'] = $this->language->get('error_no_shipping');
}
Code: Select all
if (!empty($quote_data)) {
$sort_order = array();
......
} else {
unset($this->session->data['shipping_methods']);
unset($this->session->data['shipping_method']);
$this->data['error_no_shipping'] = $this->language->get('error_no_shipping');
}
Regards.
Sorry, I'm working with 1.5.6. If you fix it in 1.5.6.1 please let us know for future upgrades.Tom Cat wrote:I am trying to apply this fix to OC Version 1.5.6.1, but I cannot make the modification as the text /code cannot be found in the file.
Has anyone found a fix for this in Version 1.5.6.1 ?
Many thanks
Regards.
So can you confirm the PayPal Express module works fine with the OC weight based shipping module in v1.5.6 ?
Also that the PayPal Express button works correctly with the weight based shipping module in v1.5.6 ?
That the fix shown above worked for v1.5.6 ?
My hosting guys say the weight based shipping module and the PayPal Express module are not compatible in version 1.5.6.1 and that if I turn off the weight based shipping module, the PayPal Express module will work correctly.
But how do I asign shipping costs? The PayPal postage calculations are not adavanced enough for my postage costs as I ship overseas?
Please confirm.
Also that the PayPal Express button works correctly with the weight based shipping module in v1.5.6 ?
That the fix shown above worked for v1.5.6 ?
My hosting guys say the weight based shipping module and the PayPal Express module are not compatible in version 1.5.6.1 and that if I turn off the weight based shipping module, the PayPal Express module will work correctly.
But how do I asign shipping costs? The PayPal postage calculations are not adavanced enough for my postage costs as I ship overseas?
Please confirm.
In 1.5.6 the PayPal Express module works fine. I did the fix shown above by myself and worked. That's why I posted it.
About this module in 1.5.6.1, I don't know, but after reading your massege I'm shivering thinking of the next upgrade.
Regards.
About this module in 1.5.6.1, I don't know, but after reading your massege I'm shivering thinking of the next upgrade.
Regards.
The check if $quote_data is not empty is the best way to resolve. If no shipping quotes can be matched then it will display a message to the user.
I have attached a patched 1.5.6.1 version of the catalog/controller/payment/pp_express.php file.
I have also patched this on the 2.0 release.
https://github.com/opencart/opencart/co ... e5e4183d2f
Hope this helps.
I have attached a patched 1.5.6.1 version of the catalog/controller/payment/pp_express.php file.
I have also patched this on the 2.0 release.
https://github.com/opencart/opencart/co ... e5e4183d2f
Hope this helps.
Attachments
1.5.6.1 patched of the catalog/controller/payment/pp_express.php
Actually just spotted another issue with the language string..it is missing the url link for the contact page.
$this->data['error_no_shipping'] = sprintf($this->language->get('error_no_shipping'), $this->url->link('information/contact'));
Update file attached.
$this->data['error_no_shipping'] = sprintf($this->language->get('error_no_shipping'), $this->url->link('information/contact'));
Update file attached.
Attachments
Thank you James.
I now have this working in OC v1.5.6.1
The PayPal Express module works fine with my weight based shipping and so far no errors have occurred. I will let it run as my only payment option for a few days and report back.
Cheers!!
I now have this working in OC v1.5.6.1
The PayPal Express module works fine with my weight based shipping and so far no errors have occurred. I will let it run as my only payment option for a few days and report back.
Cheers!!
UPDATE: v1.5.6.1 using PayPal Express Checkout with PayPal Express Checkout button.
Ok I thought all was well, but a few errors occurred this morning with customers making multiple purchases as the payment process did not show the purchase had been made.
The OC Error Log:
Warning: Cannot modify header information - headers already sent by (output started at /home/kenwoodc/public_html/shop/catalog/language/english/payment/pp_express.php:1) in /home/kenwoodc/public_html/shop/vqmod/vqcache/vq2-system_engine_controller.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /home/kenwoodc/public_html/shop/catalog/language/english/payment/pp_express.php:1) in /home/kenwoodc/public_html/shop/vqmod/vqcache/vq2-system_engine_controller.php on line 29
Although I must add, over the weekend I installed vqmod and installed a watermark extension for my pics. Maybe this has something to do with it?
Any thoughts?
Ok I thought all was well, but a few errors occurred this morning with customers making multiple purchases as the payment process did not show the purchase had been made.
The OC Error Log:
Warning: Cannot modify header information - headers already sent by (output started at /home/kenwoodc/public_html/shop/catalog/language/english/payment/pp_express.php:1) in /home/kenwoodc/public_html/shop/vqmod/vqcache/vq2-system_engine_controller.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /home/kenwoodc/public_html/shop/catalog/language/english/payment/pp_express.php:1) in /home/kenwoodc/public_html/shop/vqmod/vqcache/vq2-system_engine_controller.php on line 29
Although I must add, over the weekend I installed vqmod and installed a watermark extension for my pics. Maybe this has something to do with it?
Any thoughts?
Not sure what would cause that, usually a header problem is when you try to redirect and the output has already been started. There is no output on expressReturn() but there is a redirect, do you have display errors = off in the admin? If not you need to if running a live site.
If you can recreate the issue update the thread and I'll see if I can replicate
If you can recreate the issue update the thread and I'll see if I can replicate
Hi James,
I have both Display Errors: Yes and Log Errors: Yes
I run two websites, one for physical products and one for Downloads only – both upgraded to v1.5.6.1 and using PayPal Express Checkout with PayPal Express Checkout button.
Both websites are reporting the same error logs.
I had another an error occur on my downloads website in the storefront when I made a real life purchase myself from the website, paying by clicking the PayPal Express Checkout button to checkout:-
Notice: Undefined index: payment_address_id in /home4/kenwood3/public_html/catalog/controller/payment/pp_express.php on line 681
I clicked continue as the webpage was complete but had this error at the top.
The next page was blank but with the same error codes as my other website.
******************************************************************
Since writing this, my host site has come back with an answer in that they have:
I've enabled output buffering for you in a custom php.ini - can you let me know if that's helped?
I made a test purchase from my webshop without errors using the PayPal Express Checkout button so I guess this has fixed it?
BUT How can I apply this fix to my other website? I have no idea how I would create a custom php.ini and I am guessing neither having many other OC users?
Please can you help as my other website still has the errors but it is hosted with a different company.
Regards
Al.
I have both Display Errors: Yes and Log Errors: Yes
I run two websites, one for physical products and one for Downloads only – both upgraded to v1.5.6.1 and using PayPal Express Checkout with PayPal Express Checkout button.
Both websites are reporting the same error logs.
I had another an error occur on my downloads website in the storefront when I made a real life purchase myself from the website, paying by clicking the PayPal Express Checkout button to checkout:-
Notice: Undefined index: payment_address_id in /home4/kenwood3/public_html/catalog/controller/payment/pp_express.php on line 681
I clicked continue as the webpage was complete but had this error at the top.
The next page was blank but with the same error codes as my other website.
******************************************************************
Since writing this, my host site has come back with an answer in that they have:
I've enabled output buffering for you in a custom php.ini - can you let me know if that's helped?
I made a test purchase from my webshop without errors using the PayPal Express Checkout button so I guess this has fixed it?
BUT How can I apply this fix to my other website? I have no idea how I would create a custom php.ini and I am guessing neither having many other OC users?
Please can you help as my other website still has the errors but it is hosted with a different company.
Regards
Al.
I think I've narrowed down the issue. If you are logged in but still use the PayPal guest checkout it would throw the missing address ID notice (then cause the header issue too).
Try the attached file and let me know if it works ok for you. If so i'll add the fix into 1.5.6.2 release!
J
Try the attached file and let me know if it works ok for you. If so i'll add the fix into 1.5.6.2 release!
J
Attachments
Also, you need to disable "disable errors" - it should only be used on a development site. Its seen as best practice to hide errors because they disclose paths. Errors will still be logged though - and this will have the same effect as what your host did as the error isn't output to the screen.
Hope this helps!
Hope this helps!
The error is very informative if you look carefully. This tells you there is some header data sent by this language file. This means that there are some characters or spaces or line feeds before the first <?php tag. Check that file to see what is up there.Tom Cat wrote: The OC Error Log:
Warning: Cannot modify header information - headers already sent by (output started at /home/kenwoodc/public_html/shop/catalog/language/english/payment/pp_express.php:1)
OK, I have added this file to both my OC websites. The Downloads only site (with no output buffering) stills reports the same header error when I check out using the button.James wrote:I think I've narrowed down the issue. If you are logged in but still use the PayPal guest checkout it would throw the missing address ID notice (then cause the header issue too).
Try the attached file and let me know if it works ok for you. If so i'll add the fix into 1.5.6.2 release!
J
The physical goods site looks to be working fine with no errors reporting.
I have looked at the information Qphoria has posted. I don't fully understand, but the first code on the first line is <?php tag. There are no spaces or lines before.
Any ideas?
Correction: since posting this a customer has advised they just get a blank screen on checkout. I have disabled the PPEXCO Button module.
I found the exception, PayPal does not pass back the address data if you flag the basket to contain digital items only (i.e. no shipping required)+ you use the guest checkout. It will now set the empty variables so they can be used. The downside is that no address data is collected for the order - but if it isn't supplied it can't be read
Try the attached.
I could not get a blank page like you mentioned, do you have any logs?
J
Try the attached.
I could not get a blank page like you mentioned, do you have any logs?
J
Attachments
Ok I updated both websites tonight.
My products website (with buffering) worked ok with error.
My Downloads website (without buffering) showed the errors below.
I guess I need instructions from you how to ‘enable output buffering in a custom php.ini’ for my products website.
Warning: Cannot modify header information - headers already sent by (output started at /home4/kenwood3/public_html/catalog/language/english/payment/pp_express.php:1) in /home4/kenwood3/public_html/system/engine/controller.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /home4/kenwood3/public_html/catalog/language/english/payment/pp_express.php:1) in /home4/kenwood3/public_html/system/engine/controller.php on line 29
Prevously when I had errors on the websites I disabled the PPEX Button module to stop any further errors for my customers, this would be the reason you had no blank screen. Customers can still pay with PPEX payments but without the button.
I have left the module enabled for the next 24 hrs to see if I still get errors.
My products website (with buffering) worked ok with error.
My Downloads website (without buffering) showed the errors below.
I guess I need instructions from you how to ‘enable output buffering in a custom php.ini’ for my products website.
Warning: Cannot modify header information - headers already sent by (output started at /home4/kenwood3/public_html/catalog/language/english/payment/pp_express.php:1) in /home4/kenwood3/public_html/system/engine/controller.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /home4/kenwood3/public_html/catalog/language/english/payment/pp_express.php:1) in /home4/kenwood3/public_html/system/engine/controller.php on line 29
Prevously when I had errors on the websites I disabled the PPEX Button module to stop any further errors for my customers, this would be the reason you had no blank screen. Customers can still pay with PPEX payments but without the button.
I have left the module enabled for the next 24 hrs to see if I still get errors.
Who is online
Users browsing this forum: No registered users and 72 guests