Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function markAsDefault(StoreInterface $store)
 {
     $config = $this->configFactory->getEditable('commerce_store.settings');
     if ($config->get('default_store') != $store->uuid()) {
         $config->set('default_store', $store->uuid());
         $config->save();
     }
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function setStore(StoreInterface $store)
 {
     $this->set('store_id', $store->id());
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function getCartId($order_type, StoreInterface $store, AccountInterface $account = NULL)
 {
     $cart_id = NULL;
     $cart_data = $this->loadCartData($account);
     if ($cart_data) {
         $search = ['type' => $order_type, 'store_id' => $store->id()];
         $cart_id = array_search($search, $cart_data);
     }
     return $cart_id;
 }