Post by zendframeworks » Fri Sep 23, 2016 6:00 am

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>';

Image
Image
Image

Attachments

shipping_method_error.jpg

shipping_method_error.jpg (72.94 KiB) Viewed 14140 times



Posts

Joined
Mon Jun 27, 2016 10:59 pm

Post by zendframeworks » Fri Nov 18, 2016 5:44 am

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


Posts

Joined
Mon Jun 27, 2016 10:59 pm

Post by thekrotek » Mon Nov 21, 2016 6:15 pm

Well, apparently you method is not available for anyone outside your custom geo zone. This is absolutely normal.

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 zendframeworks » Tue Nov 29, 2016 12:49 am

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".


Posts

Joined
Mon Jun 27, 2016 10:59 pm

Post by thekrotek » Tue Nov 29, 2016 4:44 am

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.

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 seekevin » 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

New member

Posts

Joined
Sun Mar 03, 2019 6:37 am

Post by thekrotek » Tue Jun 11, 2019 2:35 pm

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.

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 houree » Sat Feb 22, 2020 1:47 pm

this is a configuration issue not a bug!

Newbie

Posts

Joined
Fri Feb 21, 2020 5:59 pm

Post by bahytt » Tue Mar 03, 2020 1:24 pm

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.

Newbie

Posts

Joined
Tue Mar 03, 2020 1:22 pm

Post by carlaonic » 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.

Newbie

Posts

Joined
Sat Mar 07, 2020 7:42 pm

Post by Charles7764 » Fri Sep 24, 2021 12:31 pm

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!!!

Newbie

Posts

Joined
Thu Sep 23, 2021 1:41 pm

Post by Roger79 » Mon Oct 11, 2021 5:13 pm

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.

CredibleBH.com


Newbie

Posts

Joined
Mon Oct 11, 2021 5:03 pm

Post by khnaz35 » Thu Jan 20, 2022 9:17 pm

Is this is happening with whole store or only some selected products?

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by upser » Thu Mar 24, 2022 6:54 pm

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!!!

Newbie

Posts

Joined
Thu Mar 24, 2022 6:49 pm

Post by dhir1979 » 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.

Newbie

Posts

Joined
Sat Dec 24, 2022 1:10 pm

Post by JNeuhoff » Wed Dec 28, 2022 5:37 pm

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.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Zajukiolf » Thu Aug 17, 2023 2:05 pm

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.

Best regards.


Newbie

Posts

Joined
Thu Aug 17, 2023 1:44 pm
Who is online

Users browsing this forum: No registered users and 10 guests