0

I am doing this:

public function setQuoteShippingMethod (Varien_Event_Observer $observer) {
        $item = $observer->getEvent()->getQuoteItem();

       //to have more code
    }

but it takes the last item (product) in the quotation (i.e. I have 4 items). I want to take the object of the whole quotation (bundle product), so I manipulate its shipping method.

I am observing checkout_cart_product_add_after. The point is - I have a quotation in the Customer Account's quotes - and when you open(view) the quotation - you can click "Add to cart". That's where my method is caught.

  • What event are you observing? – Marius Mar 14 '14 at 12:43
  • @Marius - updated. :) – Syspect Mar 14 '14 at 12:46
  • 1
    try with $item = $observer->getEvent()->getQuoteItem(); $quote = $item->getQuote()...if I understood correctly the question – Marius Mar 14 '14 at 12:47
  • Ah, I see. I tried also with $observer->getEvent()->getQuote() and didn't work, so I was wondering what's wrong. Thanks! – Syspect Mar 14 '14 at 12:52
0

Based on the comments it seams that this solves the problem:

$item = $observer->getEvent()->getQuoteItem();
$quote = $item->getQuote()
//do stuff with $quote

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.