I'm trying to get a product's image url to display in my XML feed.
I've used the code from the sitemap to create the XML page, and have got it to output most of the other product details (name, price, sku, etc).
None of the image code that is used else where in lemonstand seems to do the job. The feed just throws me errors with everything.
Here is my feed url: http://www.mensgear..../feed-shopping/
This is my XML code so far:
<?
echo '<?xml version="1.0" encoding="UTF-8"?>';
$page_list = Cms_Page::create()->where('is_published=1')->where('navigation_visible=1')->where('security_mode_id <> "customers"')->find_all(); // only published, visible and accessible for guests
$category_list = Shop_Category::create()->find_all();
$product_list = new Shop_Product(null, array('no_column_init' => true, 'no_validation' => true)); // isn't a necessity, but prevents loading some service objects during loading
$product_list = $product_list->apply_filters()->find_all();
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<Products>
<? foreach($product_list as $product): ?>
<Product>
<Merchant_SKU><?= h($product->sku) ?></Merchant_SKU>
<Manufacturer><? if ($product->manufacturer): ?><?= h($product->manufacturer->name) ?><? endif ?></Manufacturer>
<Product_Name><?= $product->name ?></Product_Name>
<Product_URL><?= site_url($product->page_url('/product')) ?></Product_URL>
<? if ($product->is_discounted()): ?>
<Current_Price><?= format_currency($product->get_discounted_price(1)) ?></Current_Price>
<? else: ?>
<Current_Price><?= format_currency($product->price()) ?></Current_Price>
<? endif ?>
<Original_Price><?= format_currency($product->price()) ?></Original_Price>
<Product_Description><![CDATA[<?= h($product->short_description) ?>]]></Product_Description>
<Category_Name></Category_Name>
<Image_URL></Image_URL>
<Stock_Availability><? if (!$product->is_out_of_stock()): ?>In Stock<? endif ?><? if ($product->is_out_of_stock()): ?>n<? endif ?></Stock_Availability>
<Shipping_Rate></Shipping_Rate>
<? $price = $product->price();?>
<? $format = substr($price, 0, 1);?>
<? $price = substr($price, 1);?>
</Product>
<? endforeach ?>
</Products>
</urlset>And these are the snippets I've tried without success:
<?= $image_url ?> <?= $product->images[0]->getThumbnailPath(100, 350, false) ?> <? $image_url = $product->image_url(0, 130, 130); if ($image_url): ?><?= $image_url ?><? endif ?> <? foreach ($product->images as $image): ?><?= $image->getThumbnailPath(100, 100) ?><? endforeach ?>
I've tried every other mish mash I can think of (sadly I don't know PHP well enough)
Any help would be brilliant. I've been trying for days to get this to work.

Help











