Post by JhauraW » Wed Jun 20, 2012 2:47 am

What's the best way to retrieve the latest product (desc, price, image) from OpenCart for display on our Wordpress blog front page?

I assume it's via RSS on the Product Feeds. If so, how can you pull just one single item from the feed without loading the whole thing? Is there a variable you can add at the end of the feed url?

Thank you.

Newbie

Posts

Joined
Fri Mar 16, 2012 10:47 am

Post by Avvici » Thu Jun 21, 2012 6:05 am

This is one post among many concerning Open Cart + Word Press
http://forum.opencart.com/viewtopic.php?t=3991

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by JhauraW » Thu Jun 21, 2012 6:34 am

Hi avvici,

Thank you. I've read all those, but none address my question. Thanks anyway. I figured it out on my own.

I created a "Latest Items" feed that lets you limit the # of items returned. The use PHP SimpleXML to grab one item in Wordpress.

I've attached the feed file. To install in OC, simply FTP it into the /catalog/controller/feed/ directory.

Usage is:
SITEURL/index.php?route=feed/latest

Or optionally append &limit=int:
SITEURL/index.php?route=feed/latest&limit=1

Wish there was better WP integration and support from the community here...

Attachments

OpenCart Latest Item Feed with Limit


Newbie

Posts

Joined
Fri Mar 16, 2012 10:47 am

Post by Avvici » Thu Jun 21, 2012 6:53 am

Nice one. Love SimpleXml :)

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by a2z » Wed Jul 25, 2012 3:22 am

Hi, Thanks for the excellent mod. Is it possible to have the image included in the RSS?

a2z
New member

Posts

Joined
Tue May 01, 2012 9:43 am

Post by JhauraW » Wed Jul 25, 2012 4:03 am

Hi a2z. Yes it can. It already pulls all the related product info including images. However to show these items in a standard RSS reader, someone needs to reformat the xml tags from google base/shopping (the ones with g:) into standard rss 2.0 elements. I don't have time right now...sorry.

Newbie

Posts

Joined
Fri Mar 16, 2012 10:47 am

Post by a2z » Wed Jul 25, 2012 6:53 am

Thanks for the quick update. I will live with the feed as it is right now. I tried to change the tags myself, but with my knowledge of RSS feeds, it seemed impossible :).

If you ever get to update it with image tags, Please do post an update on this thread.

a2z
New member

Posts

Joined
Tue May 01, 2012 9:43 am
Who is online

Users browsing this forum: No registered users and 19 guests