Author Topic: ERROR - Please select another Shipping Method  (Read 11646 times)

chakkos

  • Beginner
  • *
  • Posts: 8
ERROR - Please select another Shipping Method
« on: December 13, 2010, 14:16:56 pm »
For some time now I was getting error message "Please select another Shipping Method" and whatever shipping method the client selected the same error message would display.
The above error message will only appear in very rare cases and I could not pin-point what was causing it. After some investigation I concluded that this problem appeared because the zip code of the client was not in the valid zip code interval. I come from Cyprus and all zip codes are numeric and 4 digit length, so I set my zip start range to 0 - 99999, which should cover all cases but still the problem was occurring at random intervals. The only thing I could think of going wrong is in the following file "administrator\components\com_virtuemart\classes\shipping\standard_shipping.php" in lines 329 and 334 the following check is made
Code: [Select]
if(($db->f( "shipping_rate_zip_start" ) > $zip ) {
$vmLogger->debug( 'The ZIP ' . $zip . ' is smaller than the supported ZIP code range of this shipping rate.' ) ;
$valid = false ;
}
the "shipping_rate_zip_start" field in the database is defined as varchar(32) shouldn't it be casted to int before making the comparison? I believe the correct way would have been
Code: [Select]
if( is_numeric( $zip ) && is_numeric($db->f( "shipping_rate_zip_start" )) && is_numeric($db->f( "shipping_rate_zip_end" ))) {
if((int)$db->f( "shipping_rate_zip_start" ) > $zip ) {
$vmLogger->debug( 'The ZIP ' . $zip . ' is smaller than the supported ZIP code range of this shipping rate.' ) ;
$valid = false ;
}
if((int)$db->f( "shipping_rate_zip_end" ) < $zip ) {
$vmLogger->debug( 'The ZIP ' . $zip . ' is higher than the supported ZIP code range of this shipping rate.' ) ;
$valid = false ;
}
}

I will implement it like this and I would let you know after some time if this has resolved my problem.
If anyone could thing of something else that causes the above problem please let me know.

Rachelwu

  • Beginner
  • *
  • Posts: 7
    • thepearlmart Pearl Wholesale
Re: ERROR - Please select another Shipping Method
« Reply #1 on: December 14, 2010, 06:50:01 am »
Chakkos, I'm so glad that I found your post today and solved my problem. In China mainland, Hongkong and Macau, the zipcode is 6 digit. After changing the zipcodes to 0-999999, my store is working.

QubeSys Technologies

  • Jr. Member
  • **
  • Posts: 288
  • Joomla & Magento Services
Re: ERROR - Please select another Shipping Method
« Reply #2 on: March 02, 2011, 16:36:58 pm »
That doesnt work.
Blissful!

chakkos

  • Beginner
  • *
  • Posts: 8
Re: ERROR - Please select another Shipping Method
« Reply #3 on: March 02, 2011, 19:54:13 pm »
What do you mean it doesn't work QubeSys?
Did you try changing the zipcodes or did you try the code change?

By the way after the code change I never had this problem again.

QubeSys Technologies

  • Jr. Member
  • **
  • Posts: 288
  • Joomla & Magento Services
Re: ERROR - Please select another Shipping Method
« Reply #4 on: March 02, 2011, 20:06:52 pm »
What version of VM are you using ?
I dont see any such code.
Blissful!

chakkos

  • Beginner
  • *
  • Posts: 8
Re: ERROR - Please select another Shipping Method
« Reply #5 on: March 02, 2011, 21:55:09 pm »
I use VM 1.1.5

QubeSys Technologies

  • Jr. Member
  • **
  • Posts: 288
  • Joomla & Magento Services
Re: ERROR - Please select another Shipping Method
« Reply #6 on: March 03, 2011, 03:26:00 am »
Ok, I too use the VM 1.1.5 .
Blissful!

QubeSys Technologies

  • Jr. Member
  • **
  • Posts: 288
  • Joomla & Magento Services
Re: ERROR - Please select another Shipping Method
« Reply #7 on: March 03, 2011, 03:55:03 am »
Attached is my file from 1.1.5 package

[attachment cleanup by admin]
Blissful!

chakkos

  • Beginner
  • *
  • Posts: 8
Re: ERROR - Please select another Shipping Method
« Reply #8 on: March 03, 2011, 22:21:14 pm »
The code that needs to be changed is in function rate_id_valid and as in my original post check line 329 you will find the code that need to be replaced there. You have exactly the same code.
PS: this problem appears only if zip code entered is numeric and in some cases not always

QubeSys Technologies

  • Jr. Member
  • **
  • Posts: 288
  • Joomla & Magento Services
Re: ERROR - Please select another Shipping Method
« Reply #9 on: March 03, 2011, 22:22:38 pm »
yes my case comes in that "SOME CASE" category, which no one knows.
Blissful!

chakkos

  • Beginner
  • *
  • Posts: 8
Re: ERROR - Please select another Shipping Method
« Reply #10 on: March 03, 2011, 22:41:32 pm »
Try my solution for some time and if it works I think we should report it to the virtuemart team to include it in future releases.
Most probably they did not pick that up because not many countries use numeric zip codes.

QubeSys Technologies

  • Jr. Member
  • **
  • Posts: 288
  • Joomla & Magento Services
Re: ERROR - Please select another Shipping Method
« Reply #11 on: March 03, 2011, 22:42:15 pm »
Already tried mate.
Blissful!

pencaitland

  • Beginner
  • *
  • Posts: 24
Re: ERROR - Please select another Shipping Method
« Reply #12 on: March 26, 2011, 11:55:20 am »
I've had this issue too, with Australian zipcodes; I had left the start and end fields empty; I have now entered '00000' and 99999 (ie from string to number) this has solved the immediate error, but is there anywhere a guide to the correct way to configure these fields?
As far as I can tell, this error check in the code applies to USA codes only, where shipping rates might be based on the zips; could the check just be limited to 'country = USA', or are there other countries that need the same zip-based shipping rate systems?

The same error message, by the way, can be generated by wrongly configuring the weight ranges; overlapping entries, for instance, will cause it