Hi all,
I am new to Modx, generally I develop my projects using PHP built from a library of classes I have developed over time. I came across Modx and it looks pretty promising.
I am however, a bit lost at the moment. Project I am currently working on requires a product manager, what this entails is two forms, one where products can be manually entered into the database and another which uses the Amazon API using ASIN code to grab all the information I need.
I am just wondering what is the best way to go about integrating this sort of thing into modx?
Also, how can I get the retrieve the results from the database?
Thanks in advance,
MjMAC87
All PHP code in MODx has to be inside a snippet or plugin (most likely a snippet in your case). In the snippet code, you can still use your own classes and do pretty much whatever you want in PHP. MODx uses xPDO for access to the MODx database. If you have local tables, you can import them into the local database (with some extra work to set up the proper xPDO classes) and use xPDO or you can use PDO or old-fashioned DB access in PHP. The Amazon API should work as before as long as you’re accessing it from inside a snippet.
You might want to take a look at FormIt for creating your forms (or you can use your existing forms after moving the PHP code into one or more snippets).
The information here is for MODx Evolution, but it should give you some sense of the process of porting a site to
http://bobsguides.com/porting-your-site-to-modx.html" target="_blank" rel="nofollow">MODx:
http://bobsguides.com/porting-your-site-to-modx.html. The process is pretty much the same for Revolution except that the tag syntax is slightly different.
There’s some information here on using xPDO with your own DB tables in MODx:
http://bobsguides.com/custom-db-tables.html.
Welcome to MODx.
Hey, thanks for the reply!
Using the resources you gave me, I have managed to get somewhere with the xPDO stuff. I can get and create new records in the database. But how do I go about updating records through XPDO?
There’s also a short tutorial here on setting up an existing custom DB table to work with xPDO:
http://bobsguides.com/custom-db-tables.html.
And some info. here on using xPDO to communicate with the DB:
http://bobsguides.com/revolution-objects.html