本文整理汇总了PHP中Mage_Sales_Model_Order_Item::getPriceInclTax方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Item::getPriceInclTax方法的具体用法?PHP Mage_Sales_Model_Order_Item::getPriceInclTax怎么用?PHP Mage_Sales_Model_Order_Item::getPriceInclTax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Item
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Item::getPriceInclTax方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sync
/**
* Sync the given order item to Klevu. Returns true on successful sync and
* the error message otherwise.
*
* @param Mage_Sales_Model_Order_Item $item
*
* @return bool|string
*/
protected function sync($item)
{
if (!$this->getApiKey($item->getStoreId())) {
return "Klevu Search is not configured for this store.";
}
$parent = null;
if ($item->getParentItemId()) {
$parent = Mage::getModel("sales/order_item")->load($item->getParentItemId());
}
$response = Mage::getModel("klevu_search/api_action_producttracking")->execute(array("klevu_apiKey" => $this->getApiKey($item->getStoreId()), "klevu_type" => "checkout", "klevu_productId" => Mage::helper("klevu_search")->getKlevuProductId($item->getProductId(), $parent ? $parent->getProductId() : 0), "klevu_unit" => $item->getQtyOrdered() ? $item->getQtyOrdered() : ($parent ? $parent->getQtyOrdered() : null), "klevu_salePrice" => $item->getPriceInclTax() ? $item->getPriceInclTax() : ($parent ? $parent->getPriceInclTax() : null), "klevu_currency" => $this->getStoreCurrency($item->getStoreId()), "klevu_shopperIP" => $this->getOrderIP($item->getOrderId())));
if ($response->isSuccessful()) {
return true;
} else {
return $response->getMessage();
}
}
示例2: _correctPrices
/**
* Set correct item prices ((original price / new qty) * old qty)
*
* @param Mage_Sales_Model_Order_Item $orderItem
* @param int $oldQty
* @param int $newQty
* @return Mage_Sales_Model_Order_Item
*/
protected function _correctPrices($orderItem, $oldQty, $newQty)
{
$orderItem->setPrice($orderItem->getPrice() / $newQty * $oldQty);
$orderItem->setBasePrice($orderItem->getBasePrice() / $newQty * $oldQty);
$orderItem->setOriginalPrice($orderItem->getOriginalPrice() / $newQty * $oldQty);
$orderItem->setBaseOriginalPrice($orderItem->getBaseOriginalPrice() / $newQty * $oldQty);
$orderItem->setPriceInclTax($orderItem->getPriceInclTax() / $newQty * $oldQty);
$orderItem->setBasePriceInclTax($orderItem->getBasePriceInclTax() / $newQty * $oldQty);
return $orderItem;
}