/** * Sets the attributes in the given service item. * * @param \Aimeos\MShop\Order\Item\Base\Service\Iface $orderServiceItem Order service item that will be added to the basket * @param array $attributes Attribute key/value pairs entered by the customer during the checkout process * @param string $type Type of the configuration values (delivery or payment) */ protected function setAttributes(\Aimeos\MShop\Order\Item\Base\Service\Iface $orderServiceItem, array $attributes, $type) { $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/service/attribute'); foreach ($attributes as $key => $value) { $item = $manager->createItem(); $item->setCode($key); $item->setValue($value); $item->setType($type); $orderServiceItem->setAttributeItem($item); } }