0

I want to create a product feed in opencart. But I have problem, where I can't understand how can I periodically once in 3 hours update that feed.

Is there any examples or tutorials how to create automatic processes?

Because the solution what I am thinking of is to create controller witch updates feed upon execution -> create unix or winx cron-job, but as I scroll trough internet those feed extensions doesn't use those...

skmasq
  • 4,470
  • 6
  • 42
  • 77
  • I don't get it. I would imagine the feed is dynamically populated when you access the url, no? Why do you need a cron? As for creating custom feed, I would copy one of the existing files then edit, rename files and class Names etc. – B-and-P Jan 02 '13 at 14:41

1 Answers1

1

The XML feeds could be created in two general ways:

  1. have a service under specific URL that when hit will create the very up to date XML dynamicaly
  2. have a service that is manualy run at certain time that creates a static XML feed that is then accessed and read

I guess that You are asking about the second case while mixing the first case in.

To answer Your question - You would need to use the second case thus have a controller that creates a static XML feed file saved somewhere on the server. The action of that controller will then be called via crontab to update the XML file (or just to throw the old one away and create a new one).

I do not see any problem here... Do You?

shadyyx
  • 15,825
  • 6
  • 60
  • 95
  • so basically existing feeds doesn't populate automatically but instead when user is interacting with site? I'm asking this because I thought there is some kind of `cron-job` like implementation I can use for my own feeds. – skmasq Jan 03 '13 at 13:46
  • I doubt that. Sure not in original OpenCart distribution, unless somebody did implement this for You or You have some third-party extension installed. The XML feed is always freshly served on demand - on URL hit... – shadyyx Jan 03 '13 at 17:19
  • Damn I overthinked this all, all I need to do is update XML feed when someone enters it via URL, and if nothing is changed then saved XML file doesn't change. Am I correct? – skmasq Jan 03 '13 at 20:53