Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default 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?

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,623
    Plugin Contributions
    123

    Default 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.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: New Product Type language definition location?

    Quote Originally Posted by swguy View Post
    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.

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: New Product Type language definition location?

    Quote Originally Posted by retched View Post
    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....
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,623
    Plugin Contributions
    123

    Default 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.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default 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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Can I add new product type filter to New Products drop down sort?
    By rwoody in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 17 Dec 2008, 08:42 PM
  2. New Product Type - issue with displaying new field
    By rwoody in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Nov 2007, 12:24 PM
  3. New product type = new category tree
    By labrat in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 18 Jun 2006, 02:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR