N0frills Posted May 31, 2010 Share Posted May 31, 2010 I was trying to add more data from those that are communicated within the notification message "new order" form TM4B. From what I've seen, the module possesses txt models where to insert the names of variables, just like the email notifications. Can you help me with some advices about which file modify and how? Maybe adding the right variable in tm4b.php? I would like to be able to add the list of ordered products. Thank you. Link to comment Share on other sites More sharing options...
rocky Posted June 1, 2010 Share Posted June 1, 2010 You'd need to write code like the following in the hookNewOrder function of tm4b.php before the $templateVars: $productsDetail = $order->getProductsDetail(); $products = ""; foreach ($productsDetail as $product) $products .= ($products == "" ? "" : ", ") . $product['product_quantity'] . 'x ' . $product['product_name']; Then add the following to the $templateVars: '{products}' => $products, Then add the following to your sms_new_order.txt files: Products: {products} I haven't tested this code, but it should display text like the following in your SMS: Products: 1x Product One, 1x Product Two Link to comment Share on other sites More sharing options...
N0frills Posted June 1, 2010 Author Share Posted June 1, 2010 Thanks, but after making the changes you suggested, I get this error: "Parse error(s) in module(s) 1. tm4b". Link to comment Share on other sites More sharing options...
rocky Posted June 1, 2010 Share Posted June 1, 2010 There must be a PHP error in the code you changed. I can't see any errors in the code I wrote above. Does the error provide a line number and error message? Link to comment Share on other sites More sharing options...
N0frills Posted June 1, 2010 Author Share Posted June 1, 2010 Sorry, but I just solved, I have placed the variable in the wrong position. Now I just have to modify the module to add customer address and the type of shipment. Thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now