Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Flash & Magento: Changing User Address (Shipping / Billing) and refreshing quote items
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hello People,

we are developing a only flash frontend for with magento and i have one last issue i dont get working. we have different stores for different
countries, products have different prices for each store. so if user change his address we have to reload the quote so the new prices for added products should appear.

id did following:

/*
* Before i set the new address
*/

//Load customer
$customer Mage::getModel('customer/customer')->load(Mage::getSingleton('customer/session')->getCustomerId());
//Get Storeid by Address
$store $this->getStoreIdByUser();
//Init new store                    
Mage::app()->init($store,'store');                    

//Get Customer quote                        
$quote Mage::getModel('sales/quote');
$quote->load($this->_getSession()->getQuoteId());            
                
// Set Customer
$quote->setCustomer($customer);
// Set new Store
$quote->setStore(Mage::app()->getStore());
//Set new Store id to quote
$quote->setStoreId(Mage::app()->getStore()->getId());
//Set new Addresses
$address $quote->getShippingAddress();                
$address->addData($customer->getDefaultShippingAddress()->toArray())->save();
$address $quote->getBillingAddress();                
$address->addData($customer->getDefaultBillingAddress()->toArray())->save();                

//Clear Session            
Mage::getSingleton('checkout/session')->clear();
//Load customer Quote
Mage::getModel('checkout/session')->loadCustomerQuote();

If i check the quote in database all changes are comitted, only the new product prices and names didnt change.
Any ideas how to say the quote to update also products. If i test this by the normal frontend, adding products, changing
store, all datas change.

Excuse my bad english smile

cheers

stefan

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top