cancel
Showing results for 
Search instead for 
Did you mean: 

Bundle Options Price Dispayed wong in the cart after Observer Event

Bundle Options Price Dispayed wong in the cart after Observer Event

We used event checkout_cart_product_add_after for update group price in cart page.

we get proper group price in event but, after event go to the cart page at that time Bundle Option price displayed wrong (Not displayed Group price ).

 

public function changePrice($observer) 
{
    $event = $observer->getEvent();
    $item = $event->getQuoteItem();
    $product = Mage::getModel('catalog/product')->load($item->getProductId());

    $selectedCustomerEmail = Mage::getSingleton('core/session')->getMySessionVariable();   

    $customer = Mage::getModel("customer/customer");                      
                $customer->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
                $customer->loadByEmail($selectedCustomerEmail);

    $customerGroupId = $customer->getGroupId(); 

    $grp_price = $product->getData('group_price'); 


    $group_price = $grp_price[$customerGroupId]['price'];

    $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode(); 
    $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();

    $priceTwo = Mage::helper('directory')->currencyConvert($group_price, $baseCurrencyCode, $currentCurrencyCode);

    $finalPrice = $priceTwo;

    if($finalPrice > 0){
        $item->setCustomPrice($finalPrice);
        $item->setOriginalCustomPrice($finalPrice);
        $item->getProduct()->setIsSuperMode(true);
        $item->save();
    }
}
8 REPLIES 8

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

Hi @Ashish_k_php,

 

Can you explain the rule or case that needs this modification?

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

 @Damian Culotta  Thanks for the reply.

One Sales Person LoggedIn then after that Sales Person selected one Existing Customer for Quick Quote and need to applied Existing Customer group price on cart page.

But when Sales person Select Existing Customer at that time we add product in cart page at that time displayed Sales Person Group price But we need to Selected Existing Customer group price in the cart.

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

Hi @Ashish_k_php,

 

The Sales person is using the frontend or backend?

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

Hi @Damian Culotta

The Sales person is using the frontend.

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

Hello @Damian Culotta
If you have any idea then replay or share here.

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

@Damian Culotta You have any idea related to this.

Please share here.

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

Hi @Ashish_k_php,


Sorry but I think I don't have all the information or I can't be able to see the big picture here.

I can't understand why you use the frontend instead the backend to set orders.

Since I can't understand the whole workflow I can't imagine if the solution is right, or worng or even if there is another approach to explore.

Re: Bundle Options Price Dispayed wong in the cart after Observer Event

We used frontend due to our client custom functionality.