oxwivi Posted February 21, 2012 Share Posted February 21, 2012 I'm in the process of documenting a 2.2 addon I ported to 2.3.1. One of the user-visible snippets in the product_info file is: if (tep_not_null($product_info['minorder']) && MINIMUM_ORDERS == 'true') { $products_name .= '<br><span class="smallText">MOQ: ' $product_info['minorder'] . '</span>'; } It adds another line directly below the model no. displaying what the MOQ is. I want to replace the 'MOQ:' part with language variable element, so I did: $products_name .= '<br><span class="smallText">' . MINIMUM_ORDER_QUANTITY . $product_info['minorder'] . '</span>'; And added define('MINIMUM_ORDER_QUANTITY', 'MOQ: '); to the product_info in the $language folder. (Only English, as that's the only language I use) Anyway, the result was that 'MOQ:' was replaced by 'MINIMUM_ORDER_QUANTITY'. Am I missing some other step to connect this variable to the language files? From other addons, I did not find any other step regarding similar variables. PS I know not any PHP and only following patterns and what I understood from following instructions. Link to comment Share on other sites More sharing options...
Dan Cole Posted February 22, 2012 Share Posted February 22, 2012 This doesn't look right to me.... $products_name .= Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Link to comment Share on other sites More sharing options...
MrPhil Posted February 22, 2012 Share Posted February 22, 2012 If you don't have any ' around MINIMUM_ORDER_QUANTITY, my best guess is that you put the define in the wrong language file. .= is "concatenate". $x .= 'string' is the same as $x = $x . 'string' Link to comment Share on other sites More sharing options...
oxwivi Posted February 22, 2012 Author Share Posted February 22, 2012 This doesn't look right to me.... Even if it doesn't look right to you, it's works. If you don't have any ' around MINIMUM_ORDER_QUANTITY, my best guess is that you put the define in the wrong language file. Double, triple-checked. There's only one $language file for product_info, so I don't think there's a mistake there. I don't understand the next line. Link to comment Share on other sites More sharing options...
Dan Cole Posted February 23, 2012 Share Posted February 23, 2012 .= is "concatenate". $x .= 'string' is the same as $x = $x . 'string' I get it...thanks MrPhil....dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.