Exemple #1
0
 /**
  * Update cart status
  *
  * @param Cart       $existingEntity
  * @param CartStatus $status
  */
 protected function updateCartStatus(Cart $existingEntity, CartStatus $status)
 {
     // allow to modify status only for "open" carts
     // because magento can only expire cart, so for different statuses this useless
     if ($existingEntity->getStatus()->getName() !== 'open') {
         $status = $existingEntity->getStatus();
     }
     $status = $this->strategyHelper->getEntityManager(MagentoConnectorInterface::CART_STATUS_TYPE)->getReference(MagentoConnectorInterface::CART_STATUS_TYPE, $status->getName());
     $existingEntity->setStatus($status);
 }
Exemple #2
0
 /**
  * Update cart status
  *
  * @param Cart $cart
  *
  * @return CartStrategy
  */
 protected function updateCartStatus(Cart $cart)
 {
     // allow to modify status only for "open" carts
     // because magento can only expire cart, so for different statuses this useless
     if ($this->existingEntity->getStatus()->getName() !== CartStatus::STATUS_OPEN) {
         $status = $this->existingEntity->getStatus();
     } else {
         $status = $cart->getStatus();
     }
     $cart->setStatus($status);
     return $this;
 }
Exemple #3
0
 public function testConstruct()
 {
     $this->assertNotEmpty($this->entity->getStatus());
     $this->assertEquals('open', $this->entity->getStatus()->getName());
 }