Background: I am building a custom shopping cart (loosely) based on Kiwee Commerce. I had trouble getting the Kiwee cart to function properly and it needed modification to use for the type of products we would be selling. I have everything pretty much working, cataloging, product detail, shopping cart page, checkout, shipping, billing. But I am having trouble with something as simple as the e-mail notification.
Here is my problem: Upon order confirmation, the external class file calls a function to send an order confirmation. In that function I would like to use something like $cnk = $modx->getChunk(’emailtpl’); and then use a str_replace("[+orderdata+]
You might look at class.phpmailer.php. It’s in \manager\includes\controls
-
☆ A M B ☆
- 24,524 Posts
And check out the eForm code; it does pretty much what you have in mind, I believe.
Ya, I have those, sending the email wasnt my main problem, I think my real problem is bringing in the template with the $modx-getChunk. I suppose it really isnt necessary, I could just make a call to the database and bring it in that way. I was just curious how to bring in the $modx functions like getChunk and getSnippet.
Thanks for your help guys, I do appreciate it.
-
☆ A M B ☆
- 24,524 Posts
$modx->getChunk(’chunk-name’);
$modx->runSnippet(’snippet-name, array(’param1’=>’value1’, ’param2’=>’value2’));
I guess my real problem is that my external class that is being called from an external php file and not directly from a page that is going through the parser. It isnt recognizing the $modx even when I put a global $modx statement. Which makes sense, i suppose if i think about it.
Again, I dont think it is that big of a deal. I can just pull the Chunk directly from the database.
Thanks for the help from everyone. I was just curious how to make my class recognize the $modx functions when called from an external file and not from a page containing a snippet.