Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
Nick1973
I'm getting the 'Sorry, but our expedited checkout process cannot be used' flash up for a millisecond then it disappears. It appears that orders can still be processed though. I am using Zen Cart 1.5.7c, Bootstrap 4 and the OPC Styles for Bootstrap 4. Jquery is on 3.5.1. It only appears to happen on a Desktop. It's just a very quick flash.
That's the way that OPC is designed. That "Sorry ..." message shows initially, until all the page's javascript is loaded and the OPC jQuery turns that message off.
It's the only way I could think of to give customers an opportunity to still checkout if the site has a javascript/jQuery issue during the page's load ... which will cause OPC's jQuery (which is an integral part of the processing) to not work.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
That's the way that OPC is designed. That "Sorry ..." message shows initially, until all the page's javascript is loaded and the OPC jQuery turns that message off.
It's the only way I could think of to give customers an opportunity to still checkout if the site has a javascript/jQuery issue during the page's load ... which will cause OPC's jQuery (which is an integral part of the processing) to not work.
ok no problem cindy, at least i know not to worry that something is not installed correctly
Re: One-Page Checkout [Support Thread]
Zen Cart 1.5.7c
OPC 2.3.9
Active shipping modules: storepickup
I'm getting the "Please contact the store owner; some required elements of this page are missing." message on checkout.
After clicking OK on the popup message, the checkout page displays correctly, although I did notice that the address for the user account isn't pre populated in the billing/shipping address fields.
Console log shows
Code:
Missing #otshipping
setFormSubmitButton, payment-module: moneyorder
Showing "confirm"
Setting orderConfirmed (0), submitter (null)
jQuery version: 2.1.4
I switched to responsive classic template and still get the same issue.
I checked the readme doc and found
"Some required elements on this page are missing
If you receive a javascript alert reading Please contact the store owner; some required elements of this page are missing., then your template-override version of /includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_one_default.php is missing one or more of the HTML id elements that OPC requires for its proper operation.
Follow the instructions above to view the browser's console-log; the missing elements are identified there. You'll need to compare your template-override version of the file with the version present in the /includes/templates/template_default/templates directory, adding those required elements back!"
Except I haven't modified tpl_checkout_one_default.php, so that can't be the issue.
Any suggestions?
Re: One-Page Checkout [Support Thread]
Interestingly, if I enable another shipping method, flat rate for example, the missing #otshipping warning goes away.
Can anyone else confirm that using storepickup as the only shipping method causes the missing #otshipping warning?
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
strelitzia
Interestingly, if I enable another shipping method, flat rate for example, the missing #otshipping warning goes away.
Can anyone else confirm that using storepickup as the only shipping method causes the missing #otshipping warning?
I can! It's a core-file issue; you'll need to edit /includes/classes/shipping.php's cheapest method:
Code:
function cheapest() {
if (!is_array($this->modules)) return false;
$rates = array();
foreach($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
if (isset($GLOBALS[$class]) && is_object($GLOBALS[$class]) && $GLOBALS[$class]->enabled) {
$quotes = isset($GLOBALS[$class]->quotes) ? $GLOBALS[$class]->quotes : null;
if (empty($quotes['methods'])) {
continue;
}
$size = sizeof($quotes['methods']);
for ($i=0; $i<$size; $i++) {
if (isset($quotes['methods'][$i]['cost'])){
$rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
'cost' => $quotes['methods'][$i]['cost'],
'module' => $quotes['id']
);
}
}
}
}
$cheapest = false;
$size = sizeof($rates);
for ($i=0; $i<$size; $i++) {
if (is_array($cheapest)) {
// never quote storepickup as lowest - needs to be configured in shipping module
if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
} else {
if ($rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
}
}
$this->notify('NOTIFY_SHIPPING_MODULE_CALCULATE_CHEAPEST', $cheapest, $cheapest, $rates);
return $cheapest;
}
... and change the highlighted line to read:
Code:
if ($size === 1 || $rates[$i]['module'] != 'storepickup') {
That change enables the storepickup to be selected as the cheapest ... if it's the only shipping method available.
Re: One-Page Checkout [Support Thread]
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
I can! It's a core-file issue; you'll need to edit /includes/classes/shipping.php's cheapest method:
Code:
function cheapest() {
if (!is_array($this->modules)) return false;
$rates = array();
foreach($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
if (isset($GLOBALS[$class]) && is_object($GLOBALS[$class]) && $GLOBALS[$class]->enabled) {
$quotes = isset($GLOBALS[$class]->quotes) ? $GLOBALS[$class]->quotes : null;
if (empty($quotes['methods'])) {
continue;
}
$size = sizeof($quotes['methods']);
for ($i=0; $i<$size; $i++) {
if (isset($quotes['methods'][$i]['cost'])){
$rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
'cost' => $quotes['methods'][$i]['cost'],
'module' => $quotes['id']
);
}
}
}
}
$cheapest = false;
$size = sizeof($rates);
for ($i=0; $i<$size; $i++) {
if (is_array($cheapest)) {
// never quote storepickup as lowest - needs to be configured in shipping module
if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
} else {
if ($rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
}
}
$this->notify('NOTIFY_SHIPPING_MODULE_CALCULATE_CHEAPEST', $cheapest, $cheapest, $rates);
return $cheapest;
}
... and change the highlighted line to read:
Code:
if ($size === 1 || $rates[$i]['module'] != 'storepickup') {
That change enables the storepickup to be selected as the cheapest ... if it's the only shipping method available.
That works perfectly. Thank you, once again, for amazingly fast support.
2 Attachment(s)
Re: One-Page Checkout [Support Thread]
My clients store is ZC 1.5.7c using OPC 2.3.9
upon clicking checkout, I'm getting a page reload with the following display:
Attachment 19798
and once I click ok:
Im brought to the checkout screen, but not ble to select the payment method:
Attachment 19799
the following debug error: 06-Nov-2021 01:16:36 UTC] PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: false in /includes/classes/order.php on line 323
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
Carbonless
My clients store is ZC 1.5.7c using OPC 2.3.9
upon clicking checkout, I'm getting a page reload with the following display:
Attachment 19798
and once I click ok:
Im brought to the checkout screen, but not ble to select the payment method:
Attachment 19799
the following debug error: 06-Nov-2021 01:16:36 UTC] PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: false in /includes/classes/order.php on line 323
Looks like you've been bit by this (https://github.com/zencart/zencart/issues/4478) Zen Cart core bug, where 'storepickup' is the only shipping method available.
I'll see what I can do later today to provide a solution.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Turns out I'd provided a solution in the post referenced by the above GitHub issue: https://www.zen-cart.com/showthread....27#post1384427