コード例 #1
0
ファイル: Autofill.php プロジェクト: arcavias/arcavias-core
 /**
  * Adds the addresses from the given order item to the basket.
  *
  * @param MShop_Order_Item_Base_Interface $order Basket object
  * @param MShop_Order_Item_Interface $item Existing order to fetch the addresses from
  */
 protected function _setAddresses(MShop_Order_Item_Base_Interface $order, MShop_Order_Item_Interface $item)
 {
     $addresses = $order->getAddresses();
     if (empty($addresses) && $this->_getConfigValue('autofill.orderaddress', true) == true) {
         $manager = MShop_Factory::createManager($this->_getContext(), 'order/base/address');
         $search = $manager->createSearch();
         $search->setConditions($search->compare('==', 'order.base.address.baseid', $item->getBaseId()));
         $addresses = $manager->searchItems($search);
         foreach ($addresses as $address) {
             $order->setAddress($address, $address->getType());
         }
     }
 }