예제 #1
0
 /**
  * Shipping rates sorting callback
  *
  * @param \XLite\Model\Shipping\Rate $a First shipping rate
  * @param \XLite\Model\Shipping\Rate $b Second shipping rate
  *
  * @return integer
  */
 protected function compareRates(\XLite\Model\Shipping\Rate $a, \XLite\Model\Shipping\Rate $b)
 {
     $aMethod = $a->getMethod();
     $bMethod = $b->getMethod();
     $aRate = $a->getTotalRate();
     $bRate = $b->getTotalRate();
     return 'auctionInc' === $aMethod->getProcessor() && 'auctionInc' === $bMethod->getProcessor() ? $aRate === $bRate ? 0 : ($aRate < $bRate ? -1 : 1) : parent::compareRates($a, $b);
 }
예제 #2
0
파일: Rate.php 프로젝트: kingsj/core
 /**
  * Get total rate
  *
  * @return float
  */
 public function getTotalRate()
 {
     $total = parent::getTotalRate();
     if (!\XLite::isAdminZone() && $this->getMethod()) {
         $total = \XLite\Module\CDev\VAT\Logic\Shipping\Tax::getInstance()->calculateRateCost($this, $total);
     }
     return $total;
 }
예제 #3
0
 /**
  * Get rate markup
  *
  * @param \XLite\Model\Shipping\Rate $rate Shipping rate
  *
  * @return float
  */
 protected function getTotalRate(\XLite\Model\Shipping\Rate $rate)
 {
     return $rate->getTotalRate();
 }
예제 #4
0
 /**
  * Shipping rates sorting callback
  *
  * @param \XLite\Model\Shipping\Rate $a First shipping rate
  * @param \XLite\Model\Shipping\Rate $b Second shipping rate
  *
  * @return integer
  */
 protected function compareRates(\XLite\Model\Shipping\Rate $a, \XLite\Model\Shipping\Rate $b)
 {
     $aRate = $a->getTotalRate();
     $bRate = $b->getTotalRate();
     return $aRate == $bRate ? 0 : ($aRate < $bRate ? -1 : 1);
 }