/** * {@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(); } }
/** * {@inheritdoc} */ public function setStore(StoreInterface $store) { $this->set('store_id', $store->id()); return $this; }
/** * {@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; }