Question

When creating an order from admin that includes a configurable product, the option is displayed using the admin value of the attribute.

In my case, I use a different admin value and frontend value.

Does anyone know of a way to force the use of the frontend value?

Thanks

Was it helpful?

Solution

To achieve this, you need to override this method Mage_Adminhtml_Sales_Order_CreateController::configureProductToAddAction().
You need to replace :

$helper->renderConfigureResult($this, $configureResult);

with

Mage::app()->setCurrentStore($sessionQuote->getStore()->getId());
$helper->renderConfigureResult($this, $configureResult);
Mage::app()->setCurrentStore(0);

This is needed because in order to retrieve the option values, Magento uses the same blocks as it does in the frontend. At least this one Mage_Catalog_Block_Product_View_Type_Configurable. And somewhere in the process of retrieving the options I'm sure it checks for the current website. Basically the code above just sets the current store to the one used for the order, renders the values and sets the current store back to admin.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top