2

I need to add a value to Mage_Shipping_Model_Rate_Request depending on user selection.

To be more detailed: the frontend shows a checkbox depending on the selection (or not) of the checkbox my shipping model (extends Mage_Shipping_Model_Carrier_Tablerate) should recalculate different rates in the overloaded public function collectRates(Mage_Shipping_Model_Rate_Request $request).

Question.

  • Where can i inject the value of the user input from?
  • Which class should i overwrite/observe?
-2

Store the user data as a quote/order custom option.

As an example:

http://inchoo.net/magento/custom-product-option-and-its-use-case-in-magento/

where the customer can choose the Delivery Date.

Cheers

1

You can add your value to the request in requestShippingRates method in Mage_Sales_Model_Quote_Address model. File path to the model is app/code/core/Mage/Sales/Model/Quote/Address.php. You should override this model and in the requestShippingRates method add something like this:

$request->setMyValue($this->getMyValue());

To override use this answer on magento stackexchange.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.