構成.xml
<sales_quote_collect_totals_before>
<observers>
<discount>
<class>discount/observer</class>
<method>discountMethod</method>
</discount>
</observers>
</sales_quote_collect_totals_before>
Observer.php
public function discountMethod($observer)
{
$quote = $observer->getEvent()->getQuote();
$quote->setGrandTotal(1);
$quote->setBaseGrandTotal(1);
$quote->save();
}
既に config.xml と Observer.php を作成しましたが、そのコードはまったく機能しません。$quote->getData() は以下を示します:
[grand_total] => 1
[base_grand_total] => 1
しかし、ページのGrandTotalにはまだ真の価格が表示されています
デフォルトの Magento 1.6.2を使用しています。checkout/onepage/indexでは、[続行]をクリックするたびに関数がトリガーされますが、見積もり時に grandTotal / BaseGrandTotal を設定する方法がわかりません。