Пример #1
0
 /**
  * Get commodity
  * 
  * @param \XLite\Module\XC\PitneyBowes\Model\PBParcel $parcelItem Parcel item
  * 
  * @return array
  */
 protected function getInboundParcelCommodity($parcelItem)
 {
     $orderItem = $parcelItem->getOrderItem();
     return array("merchantComRefId" => $orderItem->getSku(), "quantity" => $parcelItem->getAmount(), "size" => array("weight" => $orderItem->getWeight(), "weightUnit" => $this->getWeightUnit()));
 }
Пример #2
0
 /**
  * Get order
  *
  * @param \XLite\Module\XC\PitneyBowes\Model\PBParcel $parcel ProfileTransaction
  *
  * @return string
  */
 protected function getOrderNumber(\XLite\Module\XC\PitneyBowes\Model\PBParcel $parcel)
 {
     return $parcel->getOrder()->getOrder()->getOrderNumber();
 }
Пример #3
0
 /**
  * Count available for parcel order items
  * 
  * @param \XLite\Model\OrderItem                        $orderItem  Order item
  * @param \XLite\Module\XC\PitneyBowes\Model\PBParcel   $parcel     Current parcel  OPTIONAL
  * 
  * @return integer
  */
 public function getAvailableAmount(\XLite\Model\OrderItem $orderItem, $parcel = null)
 {
     $getAmountInParcels = $this->getAmountInAllParcels($orderItem);
     if (null !== $parcel) {
         $getAmountInParcels -= $parcel->getAmountInParcel($orderItem);
     }
     return $orderItem->getAmount() - $getAmountInParcels;
 }