New Product Type language definition location?
I'm effectively trying to recreate a custom product type that I had in v1.5.3 in v.1.5.7c and I'm running into a problem with the language file.
I defined and created a product type called "product_cards_ufs" and have placed it's definition into the admin table. I made a collect info as /admin/includes/modules/product_cards_ufs/collect_info.php and a language file under /admin/includes/languages/english/product_cards_ufs.php.
I'm trying to test out the file now in the admin area but noticed that for some reason, my definitions are not being loaded. Where there is supposed to be the text defined as this:
PHP Code:
define('TEXT_UFS_DIFFICULTY', 'Difficulty:');
And I have the text of product_cards_ufs/collect_info.php as this:
PHP Code:
<?php echo TEXT_UFS_DIFFICULTY; ?> <br />
<?php echo zen_draw_input_field('difficulty', $pInfo->difficulty, 'class="form-control" id="difficulty" style="text-align:center; width: 105px;" min="0" max="9"', false, "number"); ?>
But on the collect_info in the admin, instead of seeing the defined text, I just see the constant name. Before I throw this language definition into extra_definitions, which I think is less than ideal, is there a place where this is supposed to be?
Re: New Product Type language definition location?
The `product_music.php` file contents were migrated to `admin/includes/languages/english/extra_definitions` in 1.5.6, so I think that's your answer.
Re: New Product Type language definition location?
Quote:
Originally Posted by
swguy
The `product_music.php` file contents were migrated to `admin/includes/languages/english/extra_definitions` in 1.5.6, so I think that's your answer.
That's what I was afraid of but so be it. Thanks.
Re: New Product Type language definition location?
Quote:
Originally Posted by
retched
That's what I was afraid of but so be it. Thanks.
why is this a problem? (curious minds are curious.)
you can just move the file intact to the extra_definitions folder and you are done. i think....
Re: New Product Type language definition location?
Extra definitions are global. These files are only needed locally when products of that type are being managed.
Re: New Product Type language definition location?
Alternatively and a way to go around your elbow to get to your thumb sort of way of doing it would be to incorporate this information as a ZC plugin loaded to the zc_plugins directory and using the admin path with the filename as product.php such as:
zc_plugins/PLUGINNAME/VERSION/admin/includes/languages/YOURLANGUAGE/product.php
If your "plugin" gets registered with the system, then this file will load in addition/after the base install of product.php and would allow that file *not* to be loaded on each page load, but instead only while handling/processing product in the admin.
Alternatively, you could have your collect_info.php file load the language file before use as an alternative as well... Yes it would make/extend the changes made to support your product type, but....
Using the above "plugin" method shouldn't get in the way of its catalog side use (at least for now) because your "install/remove" could handle all of the database manipulation needed to incorporate/remove that product type at least from the database. The catalog side (for now at least) still uses unique filenames for product types.
Now I also thought that either it is in 1.5.7 or perhaps 1.5.8 where an admin filename could have an extension and would also be loaded (such as your product_cards_utf.php) and any language file that begins with "product" would also be loaded... I've half-heartedly been trying to find the discussion I saw on that topic and apologize for spreading rumors of such a capability, but am still interested in finding out how/when I could take advantage of that operation.