1

Question is about Magento 1.8

While creating order in the admin panel -> Sales -> Orders -> Create New Order

When I add products, I can change the price to "Custom Price" and Update Items as below;

enter image description here

What I want

... What I want is to hook the event when we click "Update Items and Qty" to modify the price by some percentage.

What I have tried

I created a simple extension for observer for sales_quote_save_before but it's not firing the event, full config is below

<?xml version="1.0"?>
<config>
    <modules>
        <MyTest_Quote>
            <version>0.0.1</version>
        </MyTest_Quote>
    </modules>
    <adminhtml>
        <models>
            <MyTest_Quote>
                <class>MyTest_Quote_Model_Observer</class>
            </MyTest_Quote>
        </models>
        <events>
            <sales_quote_save_before>
                <observers>
                    <MyTest_Quote_price_observer>
                        <class>MyTest_Quote_Model_Observer</class>
                        <method>__set_quote_price</method>
                    </MyTest_Quote_price_observer>
                </observers>
            </sales_quote_save_before>
        </events>
    </adminhtml>
</config>

I may not be using the correct hook? Can you please help me with this, I want to interpret the the custom price added to modify it.

Thanks in advance.

0

1 Answer 1

1

The event exists, but this seems wrong ...

<adminhtml>
    <models>
        <MyTest_Quote>
            <class>MyTest_Quote_Model_Observer</class>
        </MyTest_Quote>
    </models>
    ...

Please try

<global>
    <models>
        <MyTest_Quote>
            <class>MyTest_Quote_Model</class>
        </MyTest_Quote>
    </models>
</global>

In your Observer you can access quote data via $observer->getQuote()->getData().

Edit: full class name also works, but i prefer <class>MyTest_Quote/observer</class> for observer section.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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