Quote System

The Quote system relies on shipping method modules to provide the specific rates based on the customer's order in some way. The Shipping Quote module organizes the shipping modules so that the most appropriate ones are used and displayed most prominently.

Shipping method modules implement the shipping hooks. The Shipping Quote module takes the shipping type defined by the modules and associates them with the store's products. Different shipping methods may deal with the same shipping type, so it is good to use the same data whenever possible. Each module must still implement the hook_shipping_type() because it might be the only one enabled on a particular site to handle that shipping type. Because the Quote module stores the weights of shipping methods and types in a variable, as well as the enabled status of shipping methods, it is necessary for modules to set the weight of their shipping types and methods from them. These variables are called 'uc_quote_enabled', 'uc_quote_method_weight', and 'uc_quote_type_weight'. They are stored as associative arrays whose keys are the id of the appropriate object.

If the shipping method needs to know information about the products when it is time to generate a quote, hook_form_alter() and hook_nodeapi() can be used to collect and store information form the product edit page. Add a fieldset to $form['shipping'] under the shipping method's id. Take a look at other modules to see some tricks to get the fieldset to be collapsed when the product is of a different shipping type. When loading the information from the database, store the information as an array under the method id to avoid namespace conflicts.