Hi guys, originally thought this was an ubercart issue, but have tracked this down to the multiprice module, here goes:

I seem to be missing all error messages and field highlighting when anonymous users checkout. This occurs on the checkout page when a required field is missing. I see the error messages when logged in as admin?

I've checked some of my other ubercart installs on other sites, and can't reproduce, ie: everything is working fine.
The only thing I can think of that I have done differently is install the site using the UberDrupal profile?

Is this a know issue, has anyone else experience it?

Comments

hixster’s picture

** bump ** has anyone experienced anything like this? I'm in a tight spot - my whole site is done -except checkout forms won't print error messages when certain fields aren't filled in (like credit card) Everything works totally fine if I disable uc_multiprice, as soon as I switch the module back on I dont get any error messages on the checkout page.
i've been through each module , one by one and have reinstalled a fresh drupal instance - but still no joy.
Struggling to debug this one as there is very little (no) clues, tried firebug, no javascript errors.

hixster’s picture

Title: No Error messages in checkout process for anonymous users(breaks messaging in checkout for non-shippable items) » No Error messages in checkout process for anonymous users

O.k. digging deeper i seem to have found the issue. I am selling non-physical products, ie software licenses.

- So, if I have a product with 'Product and its derivatives are shippable' switched OFF and multiprice ON - i get no error messages in the cart , if I click through to 'reivew order' without entering any details.
- If i switch ' Product and its derivatives are shippable.' ON and multiprice module is ENABLED - I get the correct error messages

- If I switch ' Product and its derivatives are shippable.' OFF and multiprice module is 'DISABLED" the checkout produces error messages.

So it seems something is awry if I'm trying to sell multiprice non shippable products?

hixster’s picture

Title: No Error messages in checkout process for anonymous users » No Error messages in checkout process for anonymous users(breaks messaging in checkout for non-shippable items)

changed title..

hixster’s picture

Title: No Error messages in checkout process for anonymous users » No Error messages in checkout process for anonymous users(breaks messaging in checkout for non-shippable items)

O.k , so looking at the module - it looks like the function uc_multiprice_checkout_validate is the culprit. I have't done much module development, but it looks like the checkout validation assumes we are checking out physical products and assumes there should be a $delivery_country field. Which isn't always the case.

function uc_multiprice_checkout_validate($form, &$form_state) {
  $delivery_country = check_plain($form_state['values']['panes']['delivery']['delivery_country']);
  if ($delivery_country != uc_multiprice_country_id()) {
    uc_multiprice_country_id($delivery_country);
    $_SESSION['messages'] = array();
    drupal_goto('cart/checkout');
  }
}

I wrapped the 'if' statement with a check to see if the $delivery country field is present and that seems to get things working. So the full function would be:


function uc_multiprice_checkout_validate($form, &$form_state) {
  $delivery_country = check_plain($form_state['values']['panes']['delivery']['delivery_country']);
  if($delivery_country) // added check for delivery field in deliver pane.
  {
	  if ($delivery_country != uc_multiprice_country_id()) {
		uc_multiprice_country_id($delivery_country);
		$_SESSION['messages'] = array();
		drupal_goto('cart/checkout');
	  }
  } // added 
}

Just wondering if this is the right way to go about this?

hixster’s picture

bumping

Docc’s picture

oef this validation needs some love. First it should return a proper error message.
Next the validation should be better indeed. Thinking if delivery is not there it should take the billing country as validation.... ill see if i can find some time to create a patch

hixster’s picture

Yep regarding the validation for sure - I just hacked something together to see if th.e error message would display

janton’s picture

thx this worked to get around the checkout bug for me! (so without shipment options)

timl’s picture

@hixter thanks for investigating this, I was having checkout issues as well (non physical product) and was also seeing no error messages. I just commented out the validation function to get this to work for me.

Appreciate that, would be nice to get this fixed and commited into dev since this is a show stopper probably for a lot of people who sell license subscriptions to multiple countries.

Otherwise, awesome module! Thanks for building this.

fonant’s picture

Yup, the fix in #4 works for me, where there are no shippable items in the cart.