0

I want to set up product in which some custom options. For this i have created custom options from product, but for price i want to take it from customer and use that price in cart.

Product like this http://www.getrxd.com/gift-card.html

Please give some solution.

1
0

Use observer for this logic:

In your module config.xml

<events>
<sales_quote_add_item>
    <observers>
        <customer_price>
            <type>singleton</type>
            <class>OBSERVER_CLASS_NAME</class>
            <method>customerPrice</method>
        </customer_price>
    </observers>
</sales_quote_add_item>
</events>

In method:

public function customerPrice($observer) {
    $event = $observer->getEvent();
    $quote_item = $event->getQuoteItem();
    $new_price = '10'; /*GET_CUSTOMER_PRICE_FROM SESSION*/
    $quote_item->setOriginalCustomPrice($new_price);
    $quote_item->save();
}

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.