Post by firstwave » Thu Nov 16, 2017 10:42 pm

Hi Guys.
I'm running OC 3.020 and keep getting this error.
Was testing payment methods running Coingate and payfast 2 days running and now this pops up.
Please advise.

Newbie

Posts

Joined
Tue Oct 03, 2017 1:00 am

Post by straightlight » Thu Nov 16, 2017 10:58 pm

Ensure to install, enable and configure your desired shipping module provider from the admin - > extensions - > extensions - > shipping (x) page. Then, from your admin - > catalog - > products page, ensure to indicate that the products that needs to be shipped are set to: Yes. This should resolved the problem.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by heihei » Wed Oct 10, 2018 9:07 pm

I have the same problem in Ver. 3.0.2.0
enable the "free shipping" and "store pickup"
and set all products Requires Shipping to "YES"
but still showing
"Warning: Shipping method required! "

Newbie

Posts

Joined
Thu Aug 23, 2018 1:47 am

Post by FCWC » Wed Jan 23, 2019 5:35 am

Same issue ...

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am

Post by FCWC » Sun Feb 03, 2019 3:01 am

Could never figure this out so just started over.

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am

Post by straightlight » Mon Feb 04, 2019 4:03 am

But nobody on the topic addressed what happens once the payment form settings has been saved in the admin if it does remain saved and which payment option they're using. Same issue would be irrelevant in this case since there are missing details since the third post.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by PatrickG » Mon Apr 22, 2019 6:21 pm

I too have this problem. I am using OC 3.0.3.2. Products all have shipping required, geo zones are set up but no matter which shipping method I try I still get the error 'Warning: Shipping method required!' at checkout.

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

Personalised Gifts for all Occasions


New member

Posts

Joined
Wed Mar 18, 2015 10:32 pm


Post by thekrotek » Mon Apr 22, 2019 6:35 pm

PatrickG wrote:
Mon Apr 22, 2019 6:21 pm
I too have this problem. I am using OC 3.0.3.2. Products all have shipping required, geo zones are set up but no matter which shipping method I try I still get the error 'Warning: Shipping method required!' at checkout.
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


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by letxobnav » Mon Apr 22, 2019 7:59 pm

the 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():

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');
			}
		}
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.


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');
			}
		}
		
and then check your error_log for the post variable shipping_method and the session data for the quotes.

extension/total/shipping.php has an almost identical construction in function shipping().

Crystal Light Centrum Taiwan


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm

Post by straightlight » Mon Apr 22, 2019 10:42 pm

Code: Select all

error_log(print_r($this->request->post['shipping_method'],true));
could be replaced with:

Code: Select all

$this->log->write(print_r($this->request->post['shipping_method'], true));

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by PatrickG » Wed Apr 24, 2019 3:43 am

letxobnav wrote:
Mon Apr 22, 2019 7:59 pm
the 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():

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');
			}
		}
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.


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');
			}
		}
		
and then check your error_log for the post variable shipping_method and the session data for the quotes.

extension/total/shipping.php has an almost identical construction in function shipping().
Thanks, tried this but nothing showed up. It seems this problem has been ongoing in Opencart for quite some time.

Personalised Gifts for all Occasions


New member

Posts

Joined
Wed Mar 18, 2015 10:32 pm


Post by letxobnav » Wed Apr 24, 2019 6:38 am

well, then show your error_log.

Crystal Light Centrum Taiwan


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm

Post by PatrickG » Wed Apr 24, 2019 2:00 pm

There is nothing to show, it's empty

Personalised Gifts for all Occasions


New member

Posts

Joined
Wed Mar 18, 2015 10:32 pm


Post by letxobnav » Wed Apr 24, 2019 5:26 pm

Ok so your error log is not functioning.

then use the statement straightlight mentioned:

Code: Select all

$this->log->write(...)
instead of

Code: Select all

error_log(...)
and then check your oc error log in admin.

Make sure you have that enabled before you do the test.

Crystal Light Centrum Taiwan


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm

Post by ADD Creative » Wed Apr 24, 2019 11:05 pm

There 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

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by letxobnav » Wed Apr 24, 2019 11:24 pm

good point but then other things would have gone haywire as well, unless he did not notice those.

Crystal Light Centrum Taiwan


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm

Post by PatrickG » Thu Apr 25, 2019 5:02 pm

ADD Creative wrote:
Wed Apr 24, 2019 11:05 pm
There 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
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?

//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// });
Last edited by PatrickG on Thu Apr 25, 2019 5:06 pm, edited 1 time in total.

Personalised Gifts for all Occasions


New member

Posts

Joined
Wed Mar 18, 2015 10:32 pm


Post by PatrickG » Thu Apr 25, 2019 5:04 pm

letxobnav wrote:
Wed Apr 24, 2019 6:38 am
well, then show your error_log.
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

Personalised Gifts for all Occasions


New member

Posts

Joined
Wed Mar 18, 2015 10:32 pm


Post by letxobnav » Thu Apr 25, 2019 5:42 pm

well, when I mention the error_log I mean the php error_log, not the webserver error_log.
Still, these are from the oc error log? you are now using the $this->log->write(...) statements?

Crystal Light Centrum Taiwan


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm

Post by PatrickG » Fri Apr 26, 2019 5:09 pm

letxobnav wrote:
Thu Apr 25, 2019 5:42 pm
well, when I mention the error_log I mean the php error_log, not the webserver error_log.
Still, these are from the oc error log? you are now using the $this->log->write(...) statements?
Yes that's right

Personalised Gifts for all Occasions


New member

Posts

Joined
Wed Mar 18, 2015 10:32 pm

Who is online

Users browsing this forum: No registered users and 18 guests