예제 #1
0
 /**
  * Migrates the services from the old basket to the current one.
  *
  * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object
  * @param array $errors Associative list of previous errors
  * @return array Associative list of errors occured
  */
 protected function copyServices(\Aimeos\MShop\Order\Item\Base\Iface $basket, array $errors)
 {
     foreach ($basket->getServices() as $type => $item) {
         try {
             $attributes = array();
             foreach ($item->getAttributes() as $attrItem) {
                 $attributes[$attrItem->getCode()] = $attrItem->getValue();
             }
             $this->setService($type, $item->getServiceId(), $attributes);
             $basket->deleteService($type);
         } catch (\Exception $e) {
         }
         // Don't notify the user as appropriate services can be added automatically
     }
     return $errors;
 }