Hi,
thank you for your work on this module.

I have problem with condition: "Order has a shipping quote from a particular method".
1. Some default quotas are needed in a fake order (see attachment, in default_flatrate_method.patch is dirty (belive that explanatory) solution).
2. Missing js code for such action (change shipping method). I added something like following to .js:

Drupal.behaviors.uc_conditional_payment = function (context) {
  $("input[name='quote-option']", context).change(getPaymentOptions);
}

But I have trouble with IE and Chrome, becouse they "react with delay on change of shipping method".
Example:
SM .. shipping meth.
PM .. payment meth.

PM1 -> (SM1, SM2) // PM1 depends on SM1 and SM2
PM2 -> (SM1,)
PM3 -> (SM1, SM2, SM3)

When I select SM1 nothing happend (expect avaible PM1, PM2, PM3). Than I select SM2 and it is displayed PM1, PM2, PM3 (expected PM1, PM3). SM3 display PM1 and PM3 (exp. PM3) and so on.

Cheers,
Honza.

Comments

hstefl’s picture

Category: feature » bug
longwave’s picture

Thanks for the report. As you found, the order that AJAX events fire and return on the checkout page makes this somewhat complicated to implement; I am not really sure there is a way to do this cleanly, without making the JavaScript more complicated and possibly breaking compatibility with other modules that add JS to the checkout, I'm afraid :(

sin’s picture

Experimenting with payments depending on shipping methods. Some methods available only for certain cities. I found uc_quote_condition_order_shipping_method() always return FALSE with my shipping methods, but http://drupal.org/node/1157494 helps a lot.

I also have to add a call to getPaymentOptions() from uc_quote.js to get reliable shipping change tracking. So my solution is to add uc_conditional_payment support to uc_quote.

I also add a default method to fake order like this:

function uc_conditional_payment_get_def_shipping_method() {
  $methods = array_keys(module_invoke_all('shipping_method'));
  return $methods[0];
}