In Store - Country Bug

Posts: 347
Joined: 10/16/2007

In Store Pickup works with the checkout default settings at:
admin/store/settings/checkout/edit/fields

The default value of the "Country" setting has a default check mark on the "enabled" side with no check mark on the "required" side. If "Country" is unchecked on the enabled side the error message shows.

Error is repeatable by either checking or unchecking "Country". Seems that country is required for In Store Pickup to work. In my case, orders are only shipped to the USA, thus no need for a country selection. Have not checked to see what would happen if Canada is removed only leaving the USA.

    * warning: call_user_func(): First argument is expected to be a valid callback in /var/www/jewelry/modules/shipping/uc_quote/uc_quote.module on line 875.
    * Invalid option selected. Recalculate shipping quotes to continue.

The code from line 875 more or less.

      $method = $methods[$quote_option[0]];
      $quote_data = array();
      ob_start();
      $quote_data[$method['id']] = call_user_func($method['quote']['callback'], $products, $details);
      $messages = ob_get_contents();
      ob_end_clean();
      if ($messages && variable_get('uc_quote_log_errors', false)){
        watchdog('quote', $messages, WATCHDOG_WARNING);
      }
      if (!isset($quote_data[$quote_option[0]][$quote_option[1]])){
        drupal_set_message(t('Invalid option selected. Recalculate shipping quotes to continue.'), 'error');
        return false;
      }

Seems odd that this should break the module. Perhaps a text warning block that states "country" has to be checked or else Store Pickup will not work properly. But some type of fix would seem most probable so other do not end up with the issue.

Jim

Posts: 28
Joined: 09/14/2007
Bug Finder

Just wanted to confirm this problem. I've decided only to ship to the U.S. for now, and a country selection on my checkout page is unnecessary.

When I disable the country field in Checkout Settings, though, I get the following error message when I click Review Order in checkout:

Invalid option selected. Recalculate shipping quotes to continue.

Re-enabling the country field eliminates the error.

My interim solution is to change line 409 in uc_cart/uc_cart_checkout_pane.inc to ...

$class = strtolower(str_replace(array(' ', '/', ':'), '', $title));
$output .= '<tr class="' . $class . '"><td class="field-label">';

... and then using display:none in my stylesheet to hide it.

Posts: 347
Joined: 10/16/2007

My solution was to just keep that item checked. That was in Uber 7E. Have not test it in Alpha 8 at this point.

Jim

Posts: 28
Joined: 09/14/2007
Bug Finder

I should've noted that my test was in Alpha 8.