' . print_r($product, true) . ''; exit; foreach ( $product->sizes->size as $size ) { $item = $channel->addChild('item'); $item->addChild('g:id', (string)$size['code'], 'http://base.google.com/ns/1.0'); $item->addChild('title', $product->description->name); $item->addChild('g:link', $product->card['url'], 'http://base.google.com/ns/1.0'); $item->addChild('g:image_link', $product->images->large->image[0]['url'], 'http://base.google.com/ns/1.0'); $item->addChild('g:gtin', (string)$size['code_producer'], 'http://base.google.com/ns/1.0'); $item->addChild('g:product_type', $product->category_idosell['path'], 'http://base.google.com/ns/1.0'); $item->addChild('g:condition', 'new', 'http://base.google.com/ns/1.0'); $item->addChild('g:availability', $size['available'], 'http://base.google.com/ns/1.0'); // price $item->addChild('g:price', $size -> price['gross'] . ' PLN', 'http://base.google.com/ns/1.0'); // brand $item->addChild('g:brand', $product -> producer['name'], 'http://base.google.com/ns/1.0'); // size $item->addChild('g:size', $size['name'], 'http://base.google.com/ns/1.0'); // g:item_group_id $item -> addChild('g:item_group_id', $product['id'], 'http://base.google.com/ns/1.0'); // g:shipping_weight $item -> addChild('g:shipping_weight', $size['weight'] . ' g', 'http://base.google.com/ns/1.0'); } } $xml->asXml('feed-main.xml'); echo '
wygenerowano https://cdn.projectpro.pl/rovicky-pl/feed-main.xml
';