本文整理汇总了PHP中Mage_Sales_Model_Quote_Address::getGwPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote_Address::getGwPrice方法的具体用法?PHP Mage_Sales_Model_Quote_Address::getGwPrice怎么用?PHP Mage_Sales_Model_Quote_Address::getGwPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote_Address
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote_Address::getGwPrice方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getGwTaxClassId
/**
* Get gift wrapping tax class id
*
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo|Mage_Sales_Model_Quote_Address $object
* @return int
*/
protected function _getGwTaxClassId($object)
{
if (!$object->getGwPrice() && !$object->getGwItemsPrice() && !$object->getGwPrintedCardPrice()) {
return 0;
}
if ($object instanceof Mage_Sales_Model_Quote_Address) {
$storeId = $object->getQuote()->getStoreId();
} else {
$storeId = $object->getStoreId();
}
return $this->_getWrappingTaxClass($storeId);
}
示例2: fetch
/**
* Assign wrapping totals and labels to address object
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Mage_Sales_Model_Quote_Address_Total_Subtotal
*/
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
$address->addTotal(array('code' => $this->getCode(), 'gw_price' => $address->getGwPrice(), 'gw_base_price' => $address->getGwBasePrice(), 'gw_items_price' => $address->getGwItemsPrice(), 'gw_items_base_price' => $address->getGwItemsBasePrice(), 'gw_card_price' => $address->getGwCardPrice(), 'gw_card_base_price' => $address->getGwCardBasePrice()));
return $this;
}
示例3: _checkAddressHasGifting
/**
* Determine if the address contains gifting amounts to send.
*
* @return bool
*/
protected function _checkAddressHasGifting()
{
return $this->_address->getGwId() && $this->_address->getGwPrice();
}
示例4: _addGwOrderAmount
/**
* Adds giftwraporder cost to request as item (for order)
*
* @param Mage_Sales_Model_Quote_Address $address
* @return int|bool
*/
protected function _addGwOrderAmount($address)
{
if (!$address->getGwPrice()) {
return false;
}
$lineNumber = $this->_getNewLineCode();
$storeId = $address->getQuote()->getStore()->getId();
//Add gift wrapping price(for entire order)
$gwOrderAmount = $address->getGwBasePrice();
$line = $this->_getNewDocumentRequestLineObject();
$line->setLineCode($lineNumber);
$gwOrderSku = $this->_getConfigHelper()->getGwOrderSku($storeId);
$line->setItemCode($gwOrderSku ? $gwOrderSku : self::DEFAULT_GW_ORDER_SKU);
$line->setItemDescription(self::DEFAULT_GW_ORDER_DESCRIPTION);
$line->setAvalaraGoodsAndServicesType($this->_getGiftTaxClassCode($storeId));
$line->setNumberOfItems(1);
$line->setlineAmount($gwOrderAmount);
$line->setDiscounted('false');
if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
$line->setTaxIncluded('true');
}
$this->_lines[$lineNumber] = $line;
$this->_setLinesToRequest();
$this->_lineToLineId[$lineNumber] = $gwOrderSku;
return $lineNumber;
}
示例5: fetch
/**
* Assign wrapping tax totals and labels to address object
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Enterprise_GiftWrapping_Model_Total_Quote_Tax_Giftwrapping
*/
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
$address->addTotal(array('code' => 'giftwrapping', 'gw_price' => $address->getGwPrice(), 'gw_base_price' => $address->getGwBasePrice(), 'gw_items_price' => $address->getGwItemsPrice(), 'gw_items_base_price' => $address->getGwItemsBasePrice(), 'gw_card_price' => $address->getGwCardPrice(), 'gw_card_base_price' => $address->getGwCardBasePrice(), 'gw_tax_amount' => $address->getGwTaxAmount(), 'gw_base_tax_amount' => $address->getGwBaseTaxAmount(), 'gw_items_tax_amount' => $address->getGwItemsTaxAmount(), 'gw_items_base_tax_amount' => $address->getGwItemsBaseTaxAmount(), 'gw_card_tax_amount' => $address->getGwCardTaxAmount(), 'gw_card_base_tax_amount' => $address->getGwCardBaseTaxAmount()));
return $this;
}
示例6: _applyGwTax
/**
* Apply gift wrapping tax
*
* @param Mage_Sales_Model_Quote_Address $address
* @param Mage_Core_Model_Store|int $store
* @param OnePica_AvaTax_Model_Action_Calculator $calculator
* @return $this
*/
protected function _applyGwTax(Mage_Sales_Model_Quote_Address $address, $store, $calculator)
{
if ($address->getGwPrice() > 0) {
$gwOrderItem = new Varien_Object();
$gwOrderItem->setId(Mage::helper('avatax/config')->getGwOrderSku($store->getId()));
$gwOrderItem->setProductId(Mage::helper('avatax/config')->getGwOrderSku($store->getId()));
$gwOrderItem->setAddress($address);
$baseGwOrderTax = $calculator->getItemTax($gwOrderItem);
$gwOrderTax = $store->convertPrice($baseGwOrderTax);
$address->setGwBaseTaxAmount($baseGwOrderTax);
$address->setGwTaxAmount($gwOrderTax);
if ($this->_getTaxDataHelper()->priceIncludesTax($store)) {
$gwBasePriceAmount = $address->getGwBasePrice() - $baseGwOrderTax;
$gwPriceAmount = $store->convertPrice($gwBasePriceAmount);
$address->setGwBasePrice($gwBasePriceAmount);
$address->setGwPrice($gwPriceAmount);
$address->setGrandTotal($address->getGrandTotal() - $gwOrderTax);
$address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseGwOrderTax);
}
$this->_addAmount($gwOrderTax);
$this->_addBaseAmount($baseGwOrderTax);
}
if ($address->getGwAddPrintedCard()) {
$gwPrintedCardItem = new Varien_Object();
$gwPrintedCardItem->setId(Mage::helper('avatax/config')->getGwPrintedCardSku($store->getId()));
$gwPrintedCardItem->setProductId(Mage::helper('avatax/config')->getGwPrintedCardSku($store->getId()));
$gwPrintedCardItem->setAddress($address);
$baseGwPrintedCardTax = $calculator->getItemTax($gwPrintedCardItem);
$gwPrintedCardTax = $store->convertPrice($baseGwPrintedCardTax);
$address->setGwPrintedCardBaseTaxAmount($baseGwPrintedCardTax);
$address->setGwPrintedCardTaxAmount($gwPrintedCardTax);
if ($this->_getTaxDataHelper()->priceIncludesTax($store)) {
$baseGwPrintedCardAmount = $address->getGwCardBasePrice() - $baseGwPrintedCardTax;
$gwPrintedCardAmount = $store->convertPrice($baseGwPrintedCardAmount);
$address->setGwCardPrice($gwPrintedCardAmount);
$address->setGwCardBasePrice($baseGwPrintedCardAmount);
$address->setGrandTotal($address->getGrandTotal() - $gwPrintedCardTax);
$address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseGwPrintedCardTax);
}
$this->_addAmount($gwPrintedCardTax);
$this->_addBaseAmount($baseGwPrintedCardTax);
}
return $this;
}