Page 343 of 373 FirstFirst ... 243293333341342343344345353 ... LastLast
Results 3,421 to 3,430 of 3726
  1. #3421
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by DivaVocals View Post
    Found a better solution to this issue than what I posted previously..

    Issue:
    If you have both Tabbed Products Pro, and Zen Lightbox installed AND your products have model numbers defined, the problem outlined above will manifest itself.

    To fix this in the includes/modules/pages/product_reviews/header_php.php file replace this:
    Code:
      if (zen_not_null($review->fields['products_model'])) {
         $products_name = $review->fields['products_name'] . '<br  /><span class="smallText">[' .  $review->fields['products_model'] . ']</span>';
      } else {
        $products_name = $review->fields['products_name'];
      }
    with this:
    Code:
    if (TPP_GLOBAL_ENABLE_TABS == '1') {  
      if (zen_not_null($review->fields['products_model'])) {
        $products_name = $review->fields['products_name'];
      }
    
      } else {
      if (zen_not_null($review->fields['products_model'])) {
         $products_name = $review->fields['products_name'] . '<br  /><span class="smallText">[' .  $review->fields['products_model'] . ']</span>';
      } else {
        $products_name = $review->fields['products_name'];
      }
    }
    What this change does:
    If you have Tabbed Products Pro and Zen Lightbox installed, the model number field will NOT display on the product reviews page.

    I realize this is pretty much a bandaid solution, but coming up with a solution that allows the product model field to display when both TPP and Zen Lightbox are installed and active is over my paygrade to execute. I don't know if the issue is in the TPP code, or the ZenLight box code or if a change needs to be made in both. Again, someone smarter than me will need to figure this out. So I am sharing a down and dirty solution that works.
    Okay.. I think I found it.. the key to the answer was in the includes/modules/pages/product_reviews_write/header_php.php file..

    The includes/modules/pages/product_reviews/header_php.php file was using different code to display the model number. And this code would display the model number incorrectly when Zen Lightbox (or Zen Colorbox) was installed and active..


    Here's the correct fix:

    To fix this in the includes/modules/pages/product_reviews/header_php.php file replace this:
    Code:
      if (zen_not_null($review->fields['products_model'])) {
         $products_name = $review->fields['products_name'] . '<br   /><span class="smallText">[' .   $review->fields['products_model'] . ']</span>';
      } else {
        $products_name = $review->fields['products_name'];
      }
    with this:
    Code:
    $products_name = $review->fields['products_name'];
    
    if ($review->fields['products_model'] != '') {
      $products_model = '<br /><span class="smallText">[' . $review->fields['products_model'] . ']</span>';
    } else {
      $products_model = '';
    }
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #3422
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by DivaVocals View Post
    Okay.. I think I found it.. the key to the answer was in the includes/modules/pages/product_reviews_write/header_php.php file..

    The includes/modules/pages/product_reviews/header_php.php file was using different code to display the model number. And this code would display the model number incorrectly when Zen Lightbox (or Zen Colorbox) was installed and active..


    Here's the correct fix:

    To fix this in the includes/modules/pages/product_reviews/header_php.php file replace this:
    Code:
      if (zen_not_null($review->fields['products_model'])) {
         $products_name = $review->fields['products_name'] . '<br   /><span class="smallText">[' .   $review->fields['products_model'] . ']</span>';
      } else {
        $products_name = $review->fields['products_name'];
      }
    with this:
    Code:
    $products_name = $review->fields['products_name'];
    
    if ($review->fields['products_model'] != '') {
      $products_model = '<br /><span class="smallText">[' . $review->fields['products_model'] . ']</span>';
    } else {
      $products_model = '';
    }
    Regarding the location that this was installed, and with consideration of default database settings of a new install, would the products_model value be set to NULL as a default or blank as the new code suggests? (Ie. Was this field in the tested database one that automatically fills with a blank when no model number is provided or as a Null as the original/core code suggests?) Perhaps the logic shold be switched such that it tests if null || == "" to show without the model_number info else show with the model_number. That way the database could have either setting independent of version history and the fix would still work.

    Or I guess could keep the same logic sequence and use an AND (&&) for both tests because I didn't think that NULL evaluated to "".
    Last edited by mc12345678; 25 Aug 2013 at 10:53 PM.

  3. #3423
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by mc12345678 View Post
    Regarding the location that this was installed, and with consideration of default database settings of a new install, would the products_model value be set to NULL as a default or blank as the new code suggests? (Ie. Was this field in the tested database one that automatically fills with a blank when no model number is provided or as a Null as the original/core code suggests?) Perhaps the logic shold be switched such that it tests if null || == "" to show without the model_number info else show with the model_number. That way the database could have either setting independent of version history and the fix would still work.
    Blank not null.. and this code isn't new, I simply ported over the same code that is used on the "write reviews" page so that "write reviews" and "read reviews" handle the display of the product name and model number the exact same way. Trust me.. what I posted IS the right answer.. The "write reviews" page worked correctly, the "read reviews" page did not.. So porting over the "write reviews" code solves the issue on the "read reviews" page..

    Now is a better method for both pages to display the product name and model number?? Dunno.. there very well might be.. But the issue here is that the code being used by "write reviews" is not problematic, and the code on the "read reviews" is. My solution addresses that much..

    Are improvements to this code on both pages possible?? Maybe.. I'll let someone smarter than I figure that out.. it not the issue I was trying to solve..
    Last edited by DivaVocals; 25 Aug 2013 at 11:04 PM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  4. #3424
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by DivaVocals View Post
    Blank not null.. and this code isn't new, I simply ported over the same code that is used on the "write reviews" page so that "write reviews" and "read reviews" handle the display of the product name and model number the exact same way. Trust me.. what I posted IS the right answer.. The "write reviews" page worked correctly, the "read reviews" page did not.. So porting over the "write reviews" code solves the issue on the "read reviews" page..

    Now is a better method for both pages to display the product name and model number?? Dunno.. there very well might be.. But the issue here is that the code being used by "write reviews" is not problematic, and the code on the "read reviews" is. My solution addresses that much..

    Are improvements to this code on both pages possible?? Maybe.. I'll let someone smarter than I figure that out.. it not the issue I was trying to solve..
    Gotcha. There is LOTS of code involved to give us this highly useful, functional, open source product. Bound to be something minor somewhere that could be different/incorrectly present something. Being a questioning type individual, still wonder if there is something in ZLB that should be modified to allow capturing of that change to the core/default code.

    I guess though, with the above fix, the problem that many have lived with will go away, and if someone really wants the model info to show up adjacent to the product name in ZLB while on the review page or elsewhere, then they can add that variable if they so desire.

    Good catch everyone, good code review, and glad to see the community pitch in.

  5. #3425
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Zen Lightbox addon [Support Thread]

    change the code:

    /includes/modules/pages/product_reviews/header_php.php

    find:
    PHP Code:
    if (zen_not_null($review->fields['products_model'])) {
        
    $products_name $review->fields['products_name'] . '<br /><span class="smallText">[' $review->fields['products_model'] . ']</span>';
      } else {
        
    $products_name $review->fields['products_name'];
      } 
    change to:
    PHP Code:
      $products_name $review->fields['products_name'];

      if (
    $review->fields['products_model'] != '') {
        
    $products_model '<br /><span class="smallText">[' $review->fields['products_model'] . ']</span>';
      } else {
        
    $products_model '';
      } 

  6. #3426
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by mc12345678 View Post
    Gotcha. There is LOTS of code involved to give us this highly useful, functional, open source product. Bound to be something minor somewhere that could be different/incorrectly present something. Being a questioning type individual, still wonder if there is something in ZLB that should be modified to allow capturing of that change to the core/default code.

    I guess though, with the above fix, the problem that many have lived with will go away, and if someone really wants the model info to show up adjacent to the product name in ZLB while on the review page or elsewhere, then they can add that variable if they so desire.

    Good catch everyone, good code review, and glad to see the community pitch in.
    Why??? This issue REALLY ISN'T a ZLB issue.. Activating ZLB simply reveals an issue in Zen Cart's core code. The core code used to manage the display of the product name and model number on the "read reviews" page SHOULD match the code used for the "write reviews" page. If it does, then ZLB won't behave incorrectly on the "read reviews" page. The ONLY thing ZLB should do on ANY of the reviews pages (and does do) is to display the product image inside a lightbox. There's no change to ZLB required.. a change to the Zen Cart core code IS needed, and the only change to ZLB should be an instruction in the ZLB readme that this change needs to be made ONLY if the shopowners uses reviews and model numbers on their products..

    The code change I posted SHOULD be included in the Zen Cart core, and I will report my findings on this to the admin to that effect.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  7. #3427
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by DivaVocals View Post
    Not a ZLB issue or TPP issue.. See my post above this.. It's a Zen Cart core code issue which is "aggravated" by ZLB..
    Ultimately ZLB code messed with Zen Stock Code

  8. #3428
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by rbarbour View Post
    change the code:

    /includes/modules/pages/product_reviews/header_php.php

    find:
    PHP Code:
    if (zen_not_null($review->fields['products_model'])) {
        
    $products_name $review->fields['products_name'] . '<br /><span class="smallText">[' $review->fields['products_model'] . ']</span>';
      } else {
        
    $products_name $review->fields['products_name'];
      } 
    change to:
    PHP Code:
      $products_name $review->fields['products_name'];

      if (
    $review->fields['products_model'] != '') {
        
    $products_model '<br /><span class="smallText">[' $review->fields['products_model'] . ']</span>';
      } else {
        
    $products_model '';
      } 
    You apparently missed where I already posted this EXACT same change.. (see a few posts above yours on this page: http://www.zen-cart.com/showthread.p...69#post1216069)

    I also included a detailed explanation for the change..
    Last edited by DivaVocals; 25 Aug 2013 at 11:44 PM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  9. #3429
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by DivaVocals View Post
    You apparently missed where I already posted this EXACT same change.. I also included a detailed explanation for the change..
    Yep sure did, back to the Jack and tables for me!

  10. #3430
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox addon [Support Thread]

    Quote Originally Posted by rbarbour View Post
    Ultimately ZLB code messed with Zen Stock Code
    Because the stock code is incorrect to begin with..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 

Similar Threads

  1. Free Shipping Rules addon [Support Thread]
    By numinix in forum Addon Shipping Modules
    Replies: 36
    Last Post: 2 Dec 2016, 01:56 PM
  2. v151 Reviews Reply addon [Support Thread]
    By mikestaps in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 17 Oct 2014, 01:29 AM
  3. Jquery Lightbox [Support thread]
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 257
    Last Post: 2 Aug 2012, 10:57 PM
  4. File Upload Required addon [Support Thread]
    By 1100101 in forum All Other Contributions/Addons
    Replies: 21
    Last Post: 10 Dec 2011, 03:00 AM
  5. [Support Thread] IE only JavaScripts and Stylesheets Addon
    By Meshach in forum All Other Contributions/Addons
    Replies: 16
    Last Post: 31 May 2011, 08:18 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