Page 1 of 1
Order editing error: Warning: Shipping method required!
Posted: Fri Sep 23, 2016 6:00 am
by zendframeworks
Hello
Opencart Version 2.0.1.1
Theme: Journal
I am getting this error frequently when i am editing orders in opencart
When I am in Step 5 totals when editing orders
Warning: Shipping method required!
I checked chrome console to see errors it is pointing to following errors
Code: Select all
if (json['shipping_methods']) {
for (i in json['shipping_methods']) {
html += '<optgroup label="' + json['shipping_methods'][i]['title'] + '">';
if (!json['shipping_methods'][i]['error']) {
for (j in json['shipping_methods'][i]['quote']) {
if (json['shipping_methods'][i]['quote'][j]['code'] == $('select[name=\'shipping_method\'] option:selected').val()) {
html += '<option value="' + json['shipping_methods'][i]['quote'][j]['code'] + '" selected="selected">' + json['shipping_methods'][i]['quote'][j]['title'] + '</option>';
} else {
html += '<option value="' + json['shipping_methods'][i]['quote'][j]['code'] + '">' + json['shipping_methods'][i]['quote'][j]['title'] + '</option>';
}
}
[b][u][color=#FF0000]} else {
html += '<option value="" style="color: #F00;" disabled="disabled">' + json['shipping_method'][i]['error'] + '</option>';[/color][/u][/b]
}
html += '</optgroup>';
Following line gives error
} else {
html += '<option value="" style="color: #F00;" disabled="disabled">' + json['shipping_method']['error'] + '</option>';



Re: Order editing error: Warning: Shipping method required!
Posted: Fri Nov 18, 2016 5:44 am
by zendframeworks
I noticed this issue was being occured only with my custom geo zones.
US All States - All US states
US tax state - One US state where tax apply
US Shipping Zone 48 Contiguous states
Shipping methods - USPS and UPS are set to All Geo Zones
Free Shipping - Set to US Shipping Zone
Whenever i edit an order placed outside of "US Shipping Zone 48 Contiguous states" we get the above error
Re: Order editing error: Warning: Shipping method required!
Posted: Mon Nov 21, 2016 6:15 pm
by thekrotek
Well, apparently you method is not available for anyone outside your custom geo zone. This is absolutely normal.
Re: Order editing error: Warning: Shipping method required!
Posted: Tue Nov 29, 2016 12:49 am
by zendframeworks
thekrotek wrote:Well, apparently you method is not available for anyone outside your custom geo zone. This is absolutely normal.
But the issue is, in the shipping method, it is selected as All Zones.
For example, in the above case, Shipping method is USPS priority mail and it is in one of the custom zones i have created. - "US All States".
Re: Order editing error: Warning: Shipping method required!
Posted: Tue Nov 29, 2016 4:44 am
by thekrotek
I don't think, that problem is with USPS module, since it's default. I saw similar issues with other shipping methods and usually they're related to order itself. It's really hard to guess, what's wrong. A more deep debugging might be necessary.
Re: Order editing error: Warning: Shipping method required!
Posted: Tue Jun 11, 2019 6:45 am
by seekevin
Hello,
I have a similar error said "Warning: Shipping method required!"
My setup/Configurations as follow,
- OpenCart version 3.0.3.1_rc is running
- Valid UPS Access Key, User name and password were properly set in opencart
- UPS, the only shipping method/extension is enable. The rest of methods were disable
- product "A" assigned to Tax Class which has tax rate of 9.25% if shipping address is in Geo zone "California"
- Use different shipping address locations for checkout, within CA or out of CA states, still results in such warning message
Your help is needed and very much appreciated.
Kevin
Re: Order editing error: Warning: Shipping method required!
Posted: Tue Jun 11, 2019 2:35 pm
by thekrotek
seekevin wrote: ↑Tue Jun 11, 2019 6:45 am
Hello,
I have a similar error said "Warning: Shipping method required!"
My setup/Configurations as follow,
- OpenCart version 3.0.3.1_rc is running
- Valid UPS Access Key, User name and password were properly set in opencart
- UPS, the only shipping method/extension is enable. The rest of methods were disable
- product "A" assigned to Tax Class which has tax rate of 9.25% if shipping address is in Geo zone "California"
- Use different shipping address locations for checkout, within CA or out of CA states, still results in such warning message
Your help is needed and very much appreciated.
Kevin
See my reply above. There's no generic solution for this.
Re: Order editing error: Warning: Shipping method required!
Posted: Sat Feb 22, 2020 1:47 pm
by houree
this is a configuration issue not a bug!
Re: Order editing error: Warning: Shipping method required!
Posted: Tue Mar 03, 2020 1:24 pm
by bahytt
The error in the codebase is in catalog/controller/checkout/shipping_method. php and it's the last OR clause of the if statement. This method will only work if you want to force a shipping method and avoid "Warning Shipping Method Required" error.
Re: Order editing error: Warning: Shipping method required!
Posted: Mon Mar 09, 2020 12:54 pm
by carlaonic
I'm having this problem and I'm only using one shipping module. "Flat Rate shipping"
The error in the codebase is in
catalog/controller/checkout/shipping_method.php and it's the last OR clause of the if statement.
Code: Select all
Code: Select all
if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) {
If you're only using one shipping method like "Flat Rate" shipping then this vqmod will fix the problem. Forcing the posted shipping method to the desired method $this->request->post['shipping_method'] = "flat.flat";
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Force shipping rate</id>
<version>1.0</version>
<vqmver>2.X</vqmver>
<author>oasisfleeting</author>
<file name="catalog/controller/checkout/shipping_method.php">
<operation info="fix shipping method error">
<search position="before"><![CDATA[
if (!isset($this->request->post['shipping_method'])) {
]]></search>
<add><![CDATA[
$this->request->post['shipping_method'] = "flat.flat";
]]></add>
</operation>
</file>
</modification>
This method will only work if you want to force a shipping method and avoid "Warning Shipping Method Required" error.
Re: Order editing error: Warning: Shipping method required!
Posted: Fri Sep 24, 2021 12:31 pm
by Charles7764
carlaonic wrote: ↑Mon Mar 09, 2020 12:54 pm
I'm having this problem and I'm only using one shipping module. "Flat Rate shipping"
The error in the codebase is in
catalog/controller/checkout/shipping_method.php and it's the last OR clause of the if statement.
Code: Select all
Code: Select all
if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) {
If you're only using one shipping method like "Flat Rate" shipping then this vqmod will fix the problem. Forcing the posted shipping method to the desired method $this->request->post['shipping_method'] = "flat.flat";
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Force shipping rate</id>
<version>1.0</version>
<vqmver>2.X</vqmver>
<author>oasisfleeting</author>
<file name="catalog/controller/checkout/shipping_method.php">
<operation info="fix shipping method error">
<search position="before"><![CDATA[
if (!isset($this->request->post['shipping_method'])) {
]]></search>
<add><![CDATA[
$this->request->post['shipping_method'] = "flat.flat";
]]></add>
</operation>
</file>
</modification>
This method will only work if you want to force a shipping method and avoid "Warning Shipping Method Required" error.
Did you have a fix on this issue? Facing same issue but no response from anyone!!!
Re: Order editing error: Warning: Shipping method required!
Posted: Mon Oct 11, 2021 5:13 pm
by Roger79
Hello,
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.
Re: Order editing error: Warning: Shipping method required!
Posted: Thu Jan 20, 2022 9:17 pm
by khnaz35
Is this is happening with whole store or only some selected products?
Re: Order editing error: Warning: Shipping method required!
Posted: Thu Mar 24, 2022 6:54 pm
by upser
carlaonic wrote: ↑Mon Mar 09, 2020 12:54 pm
I'm having this problem and I'm only using one shipping module. "Flat Rate shipping"
The error in the codebase is in
catalog/controller/checkout/shipping_method.php and it's the last OR clause of the if statement.
Code: Select all
Code: Select all
if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) {
If you're only using one shipping method like "Flat Rate" shipping then this vqmod will fix the problem. Forcing the posted shipping method to the desired method $this->request->post['shipping_method'] = "flat.flat"
upsers;
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Force shipping rate</id>
<version>1.0</version>
<vqmver>2.X</vqmver>
<author>oasisfleeting</author>
<file name="catalog/controller/checkout/shipping_method.php">
<operation info="fix shipping method error">
<search position="before"><![CDATA[
if (!isset($this->request->post['shipping_method'])) {
]]></search>
<add><![CDATA[
$this->request->post['shipping_method'] = "flat.flat";
]]></add>
</operation>
</file>
</modification>
This method will only work if you want to force a shipping method and avoid "Warning Shipping Method Required" error.
Did you have a fix on this issue? Facing same issue but no response from anyone!!!
Re: Order editing error: Warning: Shipping method required!
Posted: Wed Dec 28, 2022 4:01 pm
by dhir1979
Hello guys ,
I also facing same error when when the user is registering and buying something. Then same error message displayed.
Re: Order editing error: Warning: Shipping method required!
Posted: Wed Dec 28, 2022 5:37 pm
by JNeuhoff
dhir1979 wrote: ↑Wed Dec 28, 2022 4:01 pm
Hello guys ,
I also facing same error when when the user is registering and buying something. Then same error message displayed.
Yours is NOT the same issue, this forum thread is several years old.
Please start a new forum thread, and provide some more details, e.g. OC version, theme, extensions, website URL etc, otherwise nobody will be able to help you here.
Re: Order editing error: Warning: Shipping method required!
Posted: Thu Aug 17, 2023 2:05 pm
by Zajukiolf
Thank you for pointing out the error in the codebase. I will review the last OR clause of the if statement in catalog/controller/checkout/shipping_method.php to fix the issue and prevent the "Warning Shipping Method Required" error.