Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I have tried using Clear Thinking's (2.x/3.x) Total-Based Shipping - I have set this up to use country based shipping, i.e 'if country = Ireland then the charge is set at £4.99'. The cost of the shipping for this does appear in the checkout, and I have disabled or uninstalled all other extensions, refreshed mods, cleared the cache, but still I get the shipping warning when the continue button is clicked after the delivery method stage
The your only option is to ask for commercial support.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
checkout/shipping_method.php and extension/total/shipping.php
so add some error_logs (or use echo) in there to see what is (not) happening.
for example controller/checkout/shipping_method.php function save():
Code: Select all
if (!isset($this->request->post['shipping_method'])) {
$json['error']['warning'] = $this->language->get('error_shipping');
} else {
$shipping = explode('.', $this->request->post['shipping_method']);
if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) {
$json['error']['warning'] = $this->language->get('error_shipping');
}
}
So add some error_log statements in there to see which is it.
Code: Select all
error_log(print_r($this->request->post['shipping_method'],true));
if (!isset($this->request->post['shipping_method'])) {
$json['error']['warning'] = $this->language->get('error_shipping');
} else {
$shipping = explode('.', $this->request->post['shipping_method']);
error_log(print_r($this->session->data['shipping_methods'],true));
if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) {
$json['error']['warning'] = $this->language->get('error_shipping');
}
}
extension/total/shipping.php has an almost identical construction in function shipping().
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Code: Select all
error_log(print_r($this->request->post['shipping_method'],true));
Code: Select all
$this->log->write(print_r($this->request->post['shipping_method'], true));
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thanks, tried this but nothing showed up. It seems this problem has been ongoing in Opencart for quite some time.letxobnav wrote: ↑Mon Apr 22, 2019 7:59 pmthe error is only initiated in two places:
checkout/shipping_method.php and extension/total/shipping.php
so add some error_logs (or use echo) in there to see what is (not) happening.
for example controller/checkout/shipping_method.php function save():
meaning: if there is no shipping_method in the post variables or if there is but there is no first part or no second part or there is no quote for it, give the warning.Code: Select all
if (!isset($this->request->post['shipping_method'])) { $json['error']['warning'] = $this->language->get('error_shipping'); } else { $shipping = explode('.', $this->request->post['shipping_method']); if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) { $json['error']['warning'] = $this->language->get('error_shipping'); } }
So add some error_log statements in there to see which is it.
and then check your error_log for the post variable shipping_method and the session data for the quotes.Code: Select all
error_log(print_r($this->request->post['shipping_method'],true)); if (!isset($this->request->post['shipping_method'])) { $json['error']['warning'] = $this->language->get('error_shipping'); } else { $shipping = explode('.', $this->request->post['shipping_method']); error_log(print_r($this->session->data['shipping_methods'],true)); if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) { $json['error']['warning'] = $this->language->get('error_shipping'); } }
extension/total/shipping.php has an almost identical construction in function shipping().
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
then use the statement straightlight mentioned:
Code: Select all
$this->log->write(...)
Code: Select all
error_log(...)
Make sure you have that enabled before you do the test.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Try the changes here to see if it makes any difference.
viewtopic.php?f=201&t=207498#p737430
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I did already look at that but it made no difference. When I opened framework.php however, it showed that there are apparently syntax errors on lines 17 & 50. I copied the code between those lines below... does that look correct?ADD Creative wrote: ↑Wed Apr 24, 2019 11:05 pmThere is a small chance that this is caused by the lack of cache control header in version 3. https://github.com/opencart/opencart/issues/7008
Try the changes here to see if it makes any difference.
viewtopic.php?f=201&t=207498#p737430
//Line 17// set_error_handler(function($code, $message, $file, $line) use($log, $config) {
// error suppressed with @
if (error_reporting() === 0) {
return false;
}
switch ($code) {
case E_NOTICE:
case E_USER_NOTICE:
$error = 'Notice';
break;
case E_WARNING:
case E_USER_WARNING:
$error = 'Warning';
break;
case E_ERROR:
case E_USER_ERROR:
$error = 'Fatal Error';
break;
default:
$error = 'Unknown';
break;
}
if ($config->get('error_display')) {
echo '<b>' . $error . '</b>: ' . $message . ' in <b>' . $file . '</b> on line <b>' . $line . '</b>';
}
if ($config->get('error_log')) {
$log->write('PHP ' . $error . ': ' . $message . ' in ' . $file . ' on line ' . $line);
}
return true;
//Line 50// });
Sorry, I was looking in the server log rather than OC admin. I have tried checking out using three different methods, and this is the resulting entries in the error log:
2019-04-25 8:47:11 - flat.flat
2019-04-25 8:49:43 - total_based.total_based_0
2019-04-25 8:51:41 - free.free
Still, these are from the oc error log? you are now using the $this->log->write(...) statements?
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.