/** * Edit Metafield of a blog */ public function getEditBlogMetaField() { $metafield = new \erdiko\shopify\models\Metafield(); $blogID = $_GET['blog_id']; $metaFieldID = $_GET['id']; $args = array("metafield" => array("id" => $_GET['id'], "value" => $_GET['value'], "value_type" => $_GET['value_type'])); $message = "successfully processed the request"; try { $metafield->updateBlogMetaField($blogID, $metaFieldID, $args); } catch (ShopifyApiException $e) { $response_headers = $e->getResponseHeaders(); $message = "Error in editing Metafield :: " . $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__))); }