Skip to content

Metafield on Product post #323

Open
Open
@Lollichkeit

Description

@Lollichkeit

My Code:

...
$metafield = [
        'namespace' => "custom",
        'key' => "message",
        'value' => $message,
        'owner_resource' => "product",
        'owner_id' => $product_id,
        'value_type' => 'single_line_text_field',
];

$metafields = shopify->Product($product_id)->Metafield->post($metafield);
...

My Error:
Fatal error: Uncaught PHPShopify\Exception\ApiException: Not Found in /.../phpclassic/php-shopify/lib/ShopifyResource.php:540 Stack trace: #0 /home/svsqauxl/vendor/phpclassic/php-shopify/lib/ShopifyResource.php(419): PHPShopify\ShopifyResource->processResponse(Array, 'metafield') #1 /... .php(213): PHPShopify\ShopifyResource->post(Array) #2 /... .php(126): PHPProduct->updateMetaProducte() #3 {main} thrown in /.../phpclassic/php-shopify/lib/ShopifyResource.php on line 540

Please help me to upload the metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions