2 replies [Last post]
arbel's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 08/12/2007
Juice: 331
Was this information Helpful?

Hi,

I'm working on a shipping modules and I'd like to what the arrays passed by the hook to the callback function look like...

one is the products and one is the details, but what keys to they have etc...

any way to find this out about any array -> php function?

Thanks

Idan

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: hook_shipping_method() callback variables...

This is what I use, because you can use it on form submits.

<?php
  drupal_set_message
('<pre>'. print_r($variable, true) .'</pre>');
?>

For your specific question, take a look at uc_quote_request_quotes(). That's where the callback is actually called, and it constructs those arrays from the cart and POST data from AJAX.

abhay85's picture
Offline
Joined: 03/30/2010
Juice: 3
uc_quote

@lyle

I am trying to get quotes for shipping through , function uc_quote($products, $details, $method) , but its not getting called when I try to select a country which does not have states. The function gets called only when I select a country which has a state related to it. Is this something related to ajax call for getting state for a specified country. Can you let me know why the function _shipping_method() does not do call back to uc_quote($products, $details, $method) when a quote is requested for country without state .

Thanks.