出於某種原因,我的可配置產品在購物車頁面上出現兩次「延期訂單」消息。我追查到這個法師代碼的錯誤信息:延期消息出現兩次
if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_YES_NOTIFY) {
if (!$this->getIsChildItem()) {
$result->setMessage(
Mage::helper('cataloginventory')->__('This product is not available in the requested quantity. %s of the items will be backordered.', ($backorderQty * 1))
);
} else {
$result->setMessage(
Mage::helper('cataloginventory')->__('"%s" is not available in the requested quantity. %s of the items will be backordered.', $this->getProductName(), ($backorderQty * 1))
);
}
}
我收到了這些消息。這就像它爲相同的產品檢查兩次,一次爲可配置,一次爲簡單。
我想這是在代碼中,我應該需要更改配置問題,而不是東西。什麼會導致這種奇怪的行爲?
您可以嘗試添加一些的var_dump($本)或後續代碼var_dump代碼($這個 - >調試())語句轉換核心文件暫時試圖找出如果被多次調用。上面的邏輯不能同時運行這兩行。 此外,請確保可配置的產品數量已正確設置。全部嘗試0。嘗試1.等。如果沒有進入你的系統,這將是很難診斷。 – CarComp
該代碼運行兩次,因此將打印兩條消息。一個用於簡單產品(可配置產品的子代),另一個用於可配置產品本身。 –