Где в коде я могу изменить «специальную цену» или просто изменить цену за каждый товар magento show?Magento catalogue цена продукта
Я нашел, как изменить цену в кассе,
config.xml:
<frontend>
<events>
<checkout_cart_product_add_after>
<observers>
<unique_event_name>
<class>discounts/observer</class>
<method>modifyPrice</method>
</unique_event_name>
</observers>
</checkout_cart_product_add_after>
</events>
</frontend>
и наблюдатель:
<?php
class <namespace>_<module>_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 = $this->_getPriceByItem($item);
// Set the custom price
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
// Enable super mode on the product.
$item->getProduct()->setIsSuperMode(true);
}
protected function _getPriceByItem(Mage_Sales_Model_Quote_Item $item)
{
$price = null;
$price = 10;
return $price;
}
}
этот набор кодов все цена до 10 $, но только в "Моя тележка".
Сначала я хочу изменить frontend -> events -> THIS EVENT
, но ничего не могу найти.
Я знаю это, просто покажите свой рабочий код, эту часть кода изменения цены в кассе, я не могу найти, как изменить его на сайте! –
Извините, я не понимаю ваш вопрос :( –