Пример #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();
     }
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function setStore(StoreInterface $store)
 {
     $this->set('store_id', $store->id());
     return $this;
 }
Пример #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;
 }