Beispiel #1
0
 /**
  * @param \Orm\Zed\Shipment\Persistence\SpyShipmentMethod $method
  * @param int $idShipmentMethod
  *
  * @return array
  */
 protected function getResult($method, $idShipmentMethod)
 {
     return [SpyShipmentMethodTableMap::COL_IS_ACTIVE => '<span class="label ' . ($method->isActive() ? 'label-success">Activated' : 'label-danger">Disabled') . '</span>', SpyShipmentMethodTableMap::COL_FK_SHIPMENT_CARRIER => $method->getShipmentCarrier()->getName(), SpyShipmentMethodTableMap::COL_NAME => $method->getName(), SpyShipmentMethodTableMap::COL_DEFAULT_PRICE => $this->formatPrice($method->getDefaultPrice()), SpyShipmentMethodTableMap::COL_AVAILABILITY_PLUGIN => $method->getAvailabilityPlugin(), SpyShipmentMethodTableMap::COL_PRICE_PLUGIN => $method->getPricePlugin(), SpyShipmentMethodTableMap::COL_DELIVERY_TIME_PLUGIN => $method->getDeliveryTimePlugin(), self::ACTIONS => implode(' ', $this->createActionUrls($idShipmentMethod))];
 }
Beispiel #2
0
 /**
  * @param \Orm\Zed\Shipment\Persistence\SpyShipmentMethod $method
  * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
  *
  * @return int
  */
 protected function getPrice(SpyShipmentMethod $method, QuoteTransfer $quoteTransfer)
 {
     $price = $method->getDefaultPrice();
     $pricePlugins = $this->plugins[ShipmentDependencyProvider::PRICE_PLUGINS];
     if (isset($pricePlugins[$method->getPricePlugin()])) {
         $pricePlugin = $this->getPricePlugin($method, $pricePlugins);
         $price = $pricePlugin->getPrice($quoteTransfer);
     }
     return $price;
 }