Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add variable defined by language file


oxwivi

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...