にカートページに追加している間、私は、製品ページで製品の異なる価格を追加するためにカスタマイズされたコードを書かれています中変更価格Magentoの
<?xml version="1.0"?>
<config>
<global>
<models>
<price>
<class>custom_price_Model</class>
</price>
</models>
<events>
<checkout_cart_product_add_after>
<observers>
<custom_price_observer>
<class>price/observer</class>
<method>modifyPrice</method>
</custom_price_observer>
</observers>
</checkout_cart_product_add_after>
</events>
</global>
</config>
コード:アプリ/コード/ローカル/カスタム/価格/モデル/ Observer.php
class custom_price_Model_Observer
{
public function modifyPrice(Varien_Event_Observer $obs)
{
// Get the quote item
$item = $obs->getQuoteItem();
// Ensure we have the parent item, if it has one
$item = ($item->getParentItem() ? $item->getParentItem() : $item);
// Load the custom price
$price = "30";
// Set the custom price
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
// Enable super mode on the product.
$item->getProduct()->setIsSuperMode(true);
}
まだその作業はありません。親切に助けてください。
magentoはその特定の商品(製品)IDを使用して商品価格を取得するので、このためにオブザーバーを使用する必要があります。 –
私は、製品の価格だけでなく、すべての電子メールを更新したいと思います。どのようにこれを達成することができます..? @NewBeeInMagento –
あなたはオブザーバーを使用する必要があります –