Skip to content

Instantly share code, notes, and snippets.

@joelpittet
Created May 1, 2015 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelpittet/233b866eddbd1c806784 to your computer and use it in GitHub Desktop.
Save joelpittet/233b866eddbd1c806784 to your computer and use it in GitHub Desktop.
<?php
$product = (object) array(
'revision_id' => '10179',
'sku' => 'LOGO',
'title' => 'LOGO Sticker',
'revision_uid' => '317',
'status' => '0',
'revision_timestamp' => 1430447213,
'data' => FALSE,
'product_id' => '10170',
'type' => 'product',
'language' => 'en-US',
'uid' => '317',
'created' => '1417075201',
'changed' => 1430447213,
'commerce_price' => array(
'und' => array(
array(
'amount' => 0,
'currency_code' => 'USD',
'data' => 'a:2:{s:11:"include_tax";b:1;s:10:"components";a:0:{}}',
),
),
),
'field_taxable_price' => array(
'und' => array(
array(
'amount' => 0,
'currency_code' => 'USD',
'data' => 'a:2:{s:11:"include_tax";b:1;s:10:"components";a:0:{}}',
),
),
),
'is_new' => FALSE,
'original' => (object) array(
'revision_id' => '10179',
'sku' => 'LOGO',
'title' => 'LOGO Sticker',
'revision_uid' => '0',
'status' => '0',
'revision_timestamp' => '1430197202',
'data' => FALSE,
'product_id' => '10170',
'type' => 'product',
'language' => 'en-US',
'uid' => '317',
'created' => '1417075201',
'changed' => '1430197202',
'commerce_price' => array(
'und' => array(
array(
'amount' => '0',
'currency_code' => 'USD',
'data' => array(
'include_tax' => TRUE,
'components' => array(),
),
),
),
),
'field_taxable_price' => array(
'und' => array(
array(
'amount' => '0',
'currency_code' => 'USD',
'data' => array(
'include_tax' => TRUE,
'components' => array(),
),
),
),
),
),
);
commerce_product_save($product);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment