Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default defines not loading correctly all the time

    Zen Cart: v1.3.9h

    I'm adding a new product type, and have got the preview_info.php working no problem when I create a new product or edit a product via the admin Catalog->Categories/Products page.

    The problem is for existing products that I have already created and I click on the "Preview" icon in the list view under the Catalog->Categories/Products page.

    My preview_info.php loads, but all the defines I use for my printout are not being translated to show the correct output.

    Example, in /admin/includes/languages/english/product_<my_type>.php I have:

    PHP Code:
      define('TEXT_DIMENSIONS_PREVIEW',          'Dimensions: %s'); 
    This appears correctly when I get to preview_info.php when creating a new product or editing an existing one.

    PHP Code:
     Dimensions200 x 100 x 50 mm 
    But when I click on the "Preview" icon, it displays incorrectly:

    PHP Code:
    TEXT_DIMENSIONS_PREVIEW 
    I have tracked down this "Preview" link to /admin/includes/modules/category_product_listing.php, but can't figure out what's wrong.

    It is definitely resolving to point to the correct preview_info.php that I have in /admins/includes/modules/product_<my_type>/preview_info.php, but some how, the defines php file is not getting included.
    Last edited by kamion; 30 Mar 2011 at 02:07 PM.

  2. #2
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: defines not loading correctly all the time

    Anyone has any ideas?

  3. #3
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: defines not loading correctly all the time

    Here's an easy way to reproduce this in the demo site v1.3.9h.

    First, check that the product_music type preview works correctly by clicking on the "preview icon" in the Categories/Product admin view of a product that is of product_music type. You will see the text "This product was added to our catalog on <whatever date>".

    Now:

    1) Change the name of the TEXT_PRODUCT_DATE_ADDED to TEXT_PRODUCT_DATE_ADDED_MUSIC for the product_music type in the define file \admin\includes\languages\english\product_music.php

    from:
    PHP Code:
    define('TEXT_PRODUCT_DATE_ADDED''This product was added to our catalog on %s.'); 
    to:
    PHP Code:
    define('TEXT_PRODUCT_DATE_ADDED_MUSIC''This product was added to our catalog on %s.'); 

    2) Update the admin/includes/modules/product_music/preview_info.php to use the new define name TEXT_PRODUCT_DATE_ADDED_MUSIC

    from:
    PHP Code:
    <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDEDzen_date_long($pInfo->products_date_added)); ?></td>
    to:
    PHP Code:
    <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED_MUSICzen_date_long($pInfo->products_date_added)); ?></td>

    Now, go back to the Categories/Products admin page and click on the Preview icon again for the product_music type product and you will see TEXT_PRODUCT_DATE_ADDED_MUSIC instead of the correct text.

  4. #4
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: defines not loading correctly all the time

    Can a mod move this to the bug report section? Thanks.

  5. #5
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: defines not loading correctly all the time

    I done some testing of this on a clean installation and it seems to be working perfectly.

    An easier test to confirm this is to change:
    PHP Code:
    define('TEXT_PRODUCT_DATE_ADDED''This product was added to our catalog on %s.'); 
    PHP Code:
    define('TEXT_PRODUCT_DATE_ADDED''This music product was added to our catalog on %s.'); 
    and the appearance of the extra word on the preview page confirms that the file is being loaded correctly.

    The only time that I saw symptoms similar to those you described were when I confused the definition for TEXT_PRODUCT_DATE_ADDED with that for TEXT_DATE_ADDED and then tried to load a genuinely undefined constant on the preview page.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #6
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: defines not loading correctly all the time

    Hi Kuroi,
    I too have tried this with a clean install of the v1.3.9h Zen Cart. This is what I've done along with screen shots, pleaes note the place where I click the "Preview" icon. I have done as you suggested and added extra words into the text.

    I changed /admin/includes/languages/english/product.php inserting the word "general" into the text:

    PHP Code:
    define('TEXT_PRODUCT_DATE_ADDED''This general product was added to our catalog on %s.'); 
    and /admin/includes/languages/english/product_music.php inserting the word "music" into the text:

    PHP Code:
    define('TEXT_PRODUCT_DATE_ADDED''This music product was added to our catalog on %s.'); 
    Click this Preview icon:



    You can see it picked up the "general product" define:


  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: defines not loading correctly all the time

    I cannot reproduce the problem and I get the same results as kuroi when I change the language files ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: defines not loading correctly all the time

    Clutching at straws here, but what is the URL of the page that you snapped for your second screenshot? What values do you have for type_handler for each product in your product_types table?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: defines not loading correctly all the time

    I checked your site and everything is working correctly ...

    A Product for Music says:
    This music product was added to our catalog on Monday 12 July, 2004.
    A Product General says:
    This general product was added to our catalog on Monday 12 July, 2004.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: defines not loading correctly all the time

    Hi Ajeh,
    Thanks for checking the site, did you click on the "Preview" icon with the red arrow as I indicated in my screen capture above from the Categories/Products list? It's not the preview through adding or editing a product.

    Thanks.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. shop not loading or loading after long time.
    By geel in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 11 Jul 2011, 05:46 PM
  2. Re: defines not loading correctly all the time
    By Blastedtgirl in forum General Questions
    Replies: 1
    Last Post: 8 Apr 2011, 12:46 PM
  3. Yahoo feed not loading all the products
    By luisitolozano in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Aug 2009, 05:08 PM
  4. Language File Not Loading, Fails to Translate Defines
    By jacdesigner in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 29 May 2008, 02:43 PM
  5. admin page not loading all the way -->
    By mac8mypc in forum General Questions
    Replies: 3
    Last Post: 24 Sep 2007, 09:34 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