コード例 #1
0
$variant->color('Green');
$variant = $item->variant();
$variant->id('SKU0005');
//A SKU code for example, or any unique identifier (eg. could be the id from a database table)
$variant->size('M');
$variant->color('Blue');
$variant = $item->variant();
$variant->id('SKU0006');
//A SKU code for example, or any unique identifier (eg. could be the id from a database table)
$variant->size('M');
$variant->color('Red');
$variant = $item->variant();
$variant->id('SKU0007');
//A SKU code for example, or any unique identifier (eg. could be the id from a database table)
$variant->size('S');
$variant->color('Green');
$variant = $item->variant();
$variant->id('SKU0008');
//A SKU code for example, or any unique identifier (eg. could be the id from a database table)
$variant->size('S');
$variant->color('Blue');
$variant = $item->variant();
$variant->id('SKU0009');
//A SKU code for example, or any unique identifier (eg. could be the id from a database table)
$variant->size('S');
$variant->color('Red');
// Delete initial $item as we're using variants and it will not be needed
$item->delete();
// boolean value true outputs to browser as XML
GoogleShopping::asRss(true);