Example #1
0
 /**
  * Get Metafields of a product
  */
 public function getProductMetaFields()
 {
     $metafield = new \erdiko\shopify\models\Metafield();
     $productID = $_GET['product_id'];
     $data = $metafield->getProductMetaFields($productID);
     $this->setTitle('Shopify: Metafields');
     $this->setContent($this->getLayout('grid/metaDataListing', $data, dirname(__DIR__)));
 }
Example #2
0
 /**
  * Get Metafields of a product
  */
 public function getProductMetaFields()
 {
     $metafield = new \erdiko\shopify\models\Metafield();
     $productID = $_GET['product_id'];
     $message = "";
     $isError = FALSE;
     try {
         $data = $metafield->getProductMetaFields($productID);
     } catch (ShopifyApiException $e) {
         $response_headers = $e->getResponseHeaders();
         $message = "Error in getting product list :: " . $response_headers['http_status_code'] . ":" . $response_headers['http_status_message'];
         $isError = TRUE;
     } catch (ShopifyCurlException $e) {
         $message = "Error :: Shopify Curl Exception";
         $isError = TRUE;
     } catch (\Exception $e) {
         $message = $e->getMessage();
         $isError = TRUE;
     }
     if (!$isError) {
         $this->setTitle('Shopify: Metafields');
         $this->setContent($this->getLayout('grid/metaDataListing', $data, dirname(__DIR__)));
     } else {
         $this->setContent($this->getLayout('message', $message, dirname(__DIR__)));
     }
 }