質問

製品の場合、カタログ価格ルールとティア価格があります。

カートにアイテムを追加すると、Magentoは常に最小の価格を必要とします。常にカタログ価格ルールに従って価格を取るように設定する方法はありますか?

私は検索しましたが、これに対する解決策は得られませんでした。これには管理設定はありますか?

役に立ちましたか?

解決

価格を駆動するコードはmage_catalog_model_product_type_priceで見つけることができます

public function getFinalPrice($qty=null, $product)
{
    if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
        return $product->getCalculatedFinalPrice();
    }

    $finalPrice = $product->getPrice();
    $finalPrice = $this->_applyTierPrice($product, $qty, $finalPrice);
    $finalPrice = $this->_applySpecialPrice($product, $finalPrice);
    $product->setFinalPrice($finalPrice);

    Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product, 'qty' => $qty));

    $finalPrice = $product->getData('final_price');
    $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);

    return max(0, $finalPrice);
}

_applytierpriceで

$finalPrice = min($finalPrice, $tierPrice);

_ApplySpecialPriceを通じて

$finalPrice     = min($finalPrice, $specialPrice);

関係する選択肢はなく、最低価格を返します。

私の見解では、これは顧客の期待にも一致しています!

この動作を変更したい場合は、イベントCatalog_Product_get_final_priceを観察し、$ product-> setData( 'final_price'、x.yz)を使用できます。あなたが望む価値に。

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top