1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)

ZenCart Google Merchant Feed Script

If you are tring to make a google merchant feed for your Zencart store this is the tutorial for you. Copy the script below and upload it to your server. You will have to edit a few things first.

  • Database Connection Setting
  • Database Prefix


Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

In the script below you can get your database connection setting from the includes > configure.php file. Replace the username, password and database. Next replace all the zen_ with your database prefix. You can see your database prefix in the configure.php file as well. You may need to add other things as well but this script will get you started in the right direction.

<?php $conn=mysqli_connect("localhost","username","password","database");
if (mysqli_connect_errno($conn))
echo "Failed to connect to MySQL: " . mysqli_connect_error();
$q = mysqli_query($conn,"SELECT * FROM zen_products_description");
header("Content-type: text/xml");
echo '<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<description>Google Merchant Feed</description>';
while($r = mysqli_fetch_array($q))
$q2 = mysqli_query($conn,"SELECT * FROM zen_products WHERE
products_id='$theid' ");
while($r2 = mysqli_fetch_array($q2))
$qdd4 = mysqli_query($conn,"SELECT categories_name, categories_id FROM
zen_categories_description WHERE categories_id='$mcid' ");
while($ddr4 = mysqli_fetch_array($qdd4))

$q3 = mysqli_query($conn,"SELECT * FROM zen_manufacturers WHERE
manufacturers_id='$mid' ");
while($r3 = mysqli_fetch_array($q3))
if ($r2['products_quantity'] > 0){$availability='in
stock';}else{$availability='out of stock';}
echo "<item>
<g:price>$price USD</g:price>
</item>";} ?></channel> </rss>
ZenCart Google Merchant Feed Script was last modified: January 19th, 2017 by Maximus Mccullough

Subscribe To My YouTube Channel:

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips


Cool People Share:
ZenCart Configuration

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.