0
我遇到的問題是,當嘗試將結算中的訂單應用折扣時,它會在magento管理訂單頁面底部應用正確的總折扣,但訂單項顯示$ 0折扣。Magento折扣沒有顯示在訂單項上,但總計是正確的
例如,可以說我有50%的促銷活動,有人購買2件商品,蘋果公司購買10美元,橙色購買5美元購物車總額爲15-50%= 7.50美元,這已經發生了,但是當你看看行項目折扣設置爲0,它應該是:蘋果數量:1價格10美元折扣5美元總計5美元 橙色數量:1價格5美元折扣2.50美元總計2.50美元;這裏是我的代碼:
$couponCode = (string) $this->getRequest()->getParam('coupon_code');
if ($this->getRequest()->getParam('remove') == 1) {
$couponCode = '';
}
$oldCouponCode = $this->_getQuote()->getCouponCode();
if (!strlen($couponCode) && !strlen($oldCouponCode)) {
$this->_goBack();
return;
}
try {
$this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);
$this->_getQuote()->setCouponCode(strlen($couponCode) ? $couponCode : '')
->collectTotals()
->save();
if ($couponCode) {
if ($couponCode == $this->_getQuote()->getCouponCode()) {
$this->_getSession()->addSuccess(
$this->__('Coupon code "%s" was applied.', Mage::helper('core')->htmlspecialchars($couponCode))
);
}
else {
$this->_getSession()->addError(
$this->__('Coupon code "%s" is not valid.', Mage::helper('core')->htmlspecialchars($couponCode))
);
}
} else {
$this->_getSession()->addSuccess($this->__('Coupon code was canceled.'));
}
echo $this->_getReviewHtml();
exit;
嗨感謝您的建議,它不是促銷規則它自己,因爲它只對這種特定的付款方式(自定義創建)我認爲它可能與觀察員 – user1920187