Exemplo n.º 1
0
 /**
  * edit all the store metafields
  */
 public function getEditStoreInfo()
 {
     $meta = new \erdiko\shopify\models\Metafield();
     $data = $meta->getStoreInfo();
     $idArray = $data['id'];
     $keys = $data['keys'];
     $message = "successfully processed the request";
     try {
         foreach ($keys as $key) {
             $args = array("metafield" => array("id" => $idArray[$key . '_id'], "value" => $_GET[$key], "value_type" => "string"));
             $meta->updateMetafield($idArray[$key . '_id'], $args);
         }
     } catch (ShopifyApiException $e) {
         $response_headers = $e->getResponseHeaders();
         $message = "Error in Editing Store Info :: " . $response_headers['http_status_code'] . ":" . $response_headers['http_status_message'];
     } catch (ShopifyCurlException $e) {
         $message = "Error :: Shopify Curl Exception";
     } catch (\Exception $e) {
         $message = $e->getMessage();
     }
     $this->setContent($this->getLayout('message', $message, dirname(__DIR__)));
 }