Exemplo n.º 1
0
 /**
  * delete all the store metafields
  */
 public function getDeleteStoreInfo()
 {
     $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) {
             $meta->deleteMetafield($idArray[$key . '_id']);
         }
     } catch (ShopifyApiException $e) {
         $response_headers = $e->getResponseHeaders();
         $message = "Error in deleting 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__)));
 }