Warning: Post typed as I wandered through my thought process. Please bear with me :unsure:
Ohhhh I see....the define you listed below tells the code which file to look in. I think I get it now!
define('FILENAME_ORDER_EDIT', 'edit_orders.php');
So, I would write it this way:
define('FILENAME_RECENT_PRODUCTS', 'recent_products.php');
But, as you said...there are several folders I could place such a file in (or several files I could add the define to). How do I determine how the define is being used in Zen Cart in order to determine where to place it?
Since this mod has no class folder, no functions folder, no extra datafiles folder or an extra configures folder....How do I determine which of those is the best one to create for the new defines file?
:::thinking:::: the file that calls this define is the one referenced in the error log: includes/templates/custom_template/templates/tpl_modules_recent_products.php. The code from that file which actually calls the define (if I understand all this correctly), is:
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_RECENT_PRODUCTS));
So....I'm guessing here....the above include is telling zen cart what the name of the module is? And the define statement is telling zen cart which file some of that mod's code is in?
Is that right? If so, I would think that adding the define statement to the language file would be appropriate?
Doing so would change language/english/extra_definitions/recent_products.php file from:
<?php
// recently viewed sidebox title name
define('BOX_HEADING_RECENTLY_VIEWED', 'Recently Viewed');
?>
to
<?php
// recently viewed sidebox title name
define('BOX_HEADING_RECENTLY_VIEWED', 'Recently Viewed');
// define file name
define('FILENAME_RECENT_PRODUCTS', 'recent_products.php');
?>
Is that right?
DivaVocals:
They usually go in a separate file.. Depending on the how it's being used in Zen Cart they could be in a language folder, a class folder, a functions folder, an extra datafiles folder or even an extra configures folder in Zen Cart.
Do a search through your store using the developers toolkit (search for "define(") to look for existing examples to see how you would construct one.
For Edit Orders there is one similar to what you are trying to do. From line 21 of admin/includes/extra_configures/edit_orders.php
define('FILENAME_ORDER_EDIT', 'edit_orders.php');
*Go that extra mile, you never know what's at the end of the road
* Empowerment Sanctuary