当前位置: 首页>>代码示例>>PHP>>正文


PHP unknown_type::getBaseShippingAmount方法代码示例

本文整理汇总了PHP中unknown_type::getBaseShippingAmount方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown_type::getBaseShippingAmount方法的具体用法?PHP unknown_type::getBaseShippingAmount怎么用?PHP unknown_type::getBaseShippingAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在unknown_type的用法示例。


在下文中一共展示了unknown_type::getBaseShippingAmount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cancelInvoice

 /**
  * Cancel invoice
  *
  * @param   unknown_type $invoice
  * @return  unknown
  */
 public function cancelInvoice($invoice)
 {
     $this->setAmountPaid($this->getAmountPaid() - $invoice->getGrandTotal());
     $this->setBaseAmountPaid($this->getBaseAmountPaid() - $invoice->getBaseGrandTotal());
     $this->setShippingCaptured($this->getShippingCaptured() - $invoice->getShippingAmount());
     $this->setBaseShippingCaptured($this->getBaseShippingCaptured() - $invoice->getBaseShippingAmount());
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:14,代码来源:Payment.php

示例2: cancelInvoice

 /**
  * Cancel invoice
  *
  * @param   unknown_type $invoice
  * @return  unknown
  */
 public function cancelInvoice($invoice)
 {
     $this->setAmountPaid($this->getAmountPaid() - $invoice->getGrandTotal());
     $this->setBaseAmountPaid($this->getBaseAmountPaid() - $invoice->getBaseGrandTotal());
     $this->setShippingCaptured($this->getShippingCaptured() - $invoice->getShippingAmount());
     $this->setBaseShippingCaptured($this->getBaseShippingCaptured() - $invoice->getBaseShippingAmount());
     Mage::dispatchEvent('sales_order_payment_cancel_invoice', array('payment' => $this, 'invoice' => $invoice));
     return $this;
 }
开发者ID:Rinso,项目名称:magento-mirror,代码行数:15,代码来源:Payment.php

示例3: recalculateDiscounts

 /**
  * @author Jared Ty <jtyler@wdca.ca>
  * 
  * @param unknown_type $quote
  * @param unknown_type $address
  * @param unknown_type $item
  * @param unknown_type $rule_id
  */
 protected function recalculateDiscounts($quote, $address, $item, $rule_id)
 {
     $rule = $this->getRule($rule_id);
     $store = $item->getQuote()->getStore();
     //@nelkaake 17/03/2010 5:01:35 AM
     //@nelkaake -a 16/11/10:
     if (Mage::helper('rewards')->isBaseMageVersionAtLeast('1.4.1.0')) {
         $addrFixedCartRules = $address->getCartRules();
     }
     if (!$rule->getId()) {
         return $this;
     }
     if (!$rule->getActions()->validate($item)) {
         return $this;
     }
     Mage::getSingleton('rewards/salesrule_validator')->addItemAppliedRuleId($item, $rule_id);
     $qty = $item->getQty();
     if ($item->getParentItem()) {
         $qty *= $item->getParentItem()->getQty();
     }
     $qty = $rule->getDiscountQty() ? min($qty, $rule->getDiscountQty()) : $qty;
     $rulePercent = min(100, $rule->getDiscountAmount());
     $discountAmount = 0;
     $baseDiscountAmount = 0;
     //@nelkaake 17/03/2010 5:09:27 AM : is this the last item?
     $all_items = $item->getQuote()->getAllItems();
     $shipping_amount = $address->getShippingAmount();
     $base_shipping_amount = $address->getBaseShippingAmount();
     $itemPrice = $item->getDiscountCalculationPrice();
     if ($itemPrice !== null) {
         $baseItemPrice = $item->getBaseDiscountCalculationPrice();
     } else {
         $itemPrice = $item->getCalculationPrice();
         $baseItemPrice = $item->getBaseCalculationPrice();
     }
     Mage::getSingleton('rewards/redeem')->refactorRedemptions($all_items, false);
     switch ($rule->getSimpleAction()) {
         case 'to_percent':
             //@nelkaake -a 16/11/10: THIS TYPE OF DISCOUNT WAS ABANDONED BY MAGENTO
             //$rulePercent = max(0, 100-$rule->getDiscountAmount());
             //no break;
         //@nelkaake -a 16/11/10: THIS TYPE OF DISCOUNT WAS ABANDONED BY MAGENTO
         //$rulePercent = max(0, 100-$rule->getDiscountAmount());
         //no break;
         case 'by_percent':
             //@mhadianfard -c 16/11/10:
             $cartRules = $this->cart_fixed_rules;
             // WDCA CODE BEGIN
             //@nelkaake -a 28/11/10: First calculate the total discount on the cart
             if (!isset($cartRules[$rule->getId()])) {
                 $totalDiscountOnCart = $this->_getTotalPercentDiscount($item, $address, $rule, $qty);
                 $cartRules[$rule->getId()] = $totalDiscountOnCart;
                 //@nelkaake -a 28/11/10: if this was a by points spent
                 if ($rule->getPointsAction() == TBT_Rewards_Model_Salesrule_Actions::ACTION_DISCOUNT_BY_POINTS_SPENT) {
                     $this->_registerPointsSpentDiscount($rule, $cartRules[$rule->getId()]);
                 }
                 $addrCartRules = is_array($address->getCartFixedRules()) ? $address->getCartFixedRules() : array();
                 $addrCartRules[$rule->getId()] = $cartRules[$rule->getId()];
                 $address->setCartFixedRules($addrCartRules);
             }
             //@nelkaake -a 28/11/10: If we've already calculated the total discount on the cart, start trying to discount per item.
             if ($cartRules[$rule->getId()] > 0) {
                 list($discountAmount, $baseDiscountAmount) = $this->_getTotalPercentDiscountOnitem($item, $address, $rule, $cartRules, $qty);
                 if (!$this->isCfrProcessed($item, $rule_id)) {
                     $cartRules[$rule->getId()] -= $baseDiscountAmount;
                     $this->setIsCfrProcessed($item, $rule_id);
                 }
             }
             // WDCA CODE END
             $this->cart_fixed_rules = $cartRules;
             $address->setCartFixedRules($cartRules);
             break;
         case 'to_fixed':
             $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount());
             $discountAmount = $qty * ($item->getCalculationPrice() - $quoteAmount);
             $baseDiscountAmount = $qty * ($item->getBaseCalculationPrice() - $rule->getDiscountAmount());
             break;
         case 'by_fixed':
             if ($step = $rule->getDiscountStep()) {
                 $qty = floor($qty / $step) * $step;
             }
             $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount());
             $discountAmount = $qty * $quoteAmount;
             $baseDiscountAmount = $qty * $rule->getDiscountAmount();
             break;
         case 'cart_fixed':
             $cartRules = $this->cart_fixed_rules;
             // WDCA CODE BEGIN
             if (Mage::helper('rewards')->isBaseMageVersionAtLeast('1.4.2')) {
                 if (empty($this->_rulesItemTotals[$rule->getId()])) {
                     Mage::throwException(Mage::helper('salesrule')->__('Item totals are not set for rule.'));
                 }
//.........这里部分代码省略.........
开发者ID:rajarshc,项目名称:Rooja,代码行数:101,代码来源:Validator.php


注:本文中的unknown_type::getBaseShippingAmount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。