Zen Cart Logo
Forums / All Other Contributions/Addons / Zen Lightbox addon [Support Thread]

Zen Lightbox addon [Support Thread]

Views: 952,658

Results 3,401 to 3,420 of 3,722
23 Aug 2013, 14:18
#3401
ehsi avatar

ehsi

New Zenner

Join Date:
Aug 2013
Posts:
49
Plugin Contributions:
0

Zen Lightbox addon [Support Thread]

Thank you for your suggestions.

Not to chaise my own tail for many hours to come, I installed zen cart and IH4 again afresh. The installation went as expected, and I do not see at the moment any problems. Currently, I do not have Lightbox installed but I will install it tomorrow after I see that the IH4 operates in all browsers as expected.

The only issue I currently have, which I have not experienced in my first installation of IH4, is that IH4 does not re-size the image when I am inserting it for a new product. Since I am inserting the largest image I have (about 180K) as my smallest/default image, IH4 inserts small, medium, and large images making them of the same size - 180K. This issue would not be a problem because I do not want to activate hover function, but this issue lets me know that something is wrong and has to be fixed before I go ahead and install Lightbox.

Could you please let me know what I am missing this time.

Thank you.

23 Aug 2013, 14:31
#3402
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

EHSI:

Thank you for your suggestions.

Not to chaise my own tail for many hours to come, I installed zen cart and IH4 again afresh. The installation went as expected, and I do not see at the moment any problems. Currently, I do not have Lightbox installed but I will install it tomorrow after I see that the IH4 operates in all browsers as expected.

The only issue I currently have, which I have not experienced in my first installation of IH4, is that IH4 does not re-size the image when I am inserting it for a new product. Since I am inserting the largest image I have (about 180K) as my smallest/default image, IH4 inserts small, medium, and large images making them of the same size - 180K. This issue would not be a problem because I do not want to activate hover function, but this issue lets me know that something is wrong and has to be fixed before I go ahead and install Lightbox.

Could you please let me know what I am missing this time.

Thank you.

Please carry this over to the correct thread http://www.zen-cart.com/showthread.php?194740-Image-Handler-4-%28for-v1-5-x%29-Support-Thread&p=1215719. This is not a Zen Lightbox discussion.

23 Aug 2013, 22:14
#3403
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

Daniel, I think this is the link you had us look at before: http://kitchenwarehouseltd.com/complete-kitchen-units/high-gloss/cream

If I understand right you want those lower images to come up in the lightbox also?

If right and they are in the actual description of the main product then you will most likely need to include the call for it when you insert the link for the image -- I think the naming of the images would probably not be an issue since they are not additional images but just added to description..

Have you tried this info from the readme:

===============================================

EZ-Pages
By default the lightbox effect will be applied to all links that point to images on your EZ-Pages. This functionality can easily be modified via the admin.
The gallery mode will automatically be used when more than one link to an image (on an EZ-Page) are located within the same parent element.
The only manual bit of coding required is the addition of captions (if you need them). You can add captions by including the rel="" attribute in your href tag. An example of this can be found below.

 **<a href="myimage.jpg" rel="here is my caption">My Image</a>**


 **Any page**
 The above EZ-Pages functionality can be added to any page of your website.
 To enable this, simple copy the **jscript_zen_lightbox.php** file (found at the root of the distribution) to the relevant **modules/pages** folder.
 For example, if you wanted to apply this functionality to the contact_us page you would copy the above file to: **includes/modules/pages/contact_us**  

===============================================

DannyVarley:

Yup I purposely removed the code so they cant get into the individual product pages, there was no need for them in my situation and it only made the buy experience longer. I could have also just listed them all as attributes but I chose this way over that for some important reasons I cant quite remember right now :P

I think for lightbox to work on those pictures I need to include the source on that code I pasted. Thats the only thing I cant figure out.

Daniel

24 Aug 2013, 15:17
#3404
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

niestudio:

finally got around to a workaround for this issue.
Not sure if it should be part of the ZCB or ZLB install by default, but maybe in the FAQ of this and of the tabbed plugin.
try adding this line to [includes/classes/zen_lightbox/autoload_default.php]
I added it as the first line inside of the document ready function

$('#productMainImageReview, #productAdditionalImages_tab').find("a").removeAttr("rel");

> 
> this should re-write the image links inside the tabbed sections to  remove the rel="colorbox" attribute so that the images do not get  linked/loaded into colorbox or lightbox (same code will work for either)
> 
> d


and here is the corrected class code.. Tested this and it works perfectly..


<?php /** * Zen Lightbox * * @author Alex Clarke ([email protected]) * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: autoload_default.php 2008-12-09 aclarke $ */ ?>

jQuery(function($) {
$("a[rel^='lightbox']").slimbox({<?php require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'zen_lightbox/options.php'); ?>}, function(el)
{
return [el.href, el.title /* + '<br /><a href="' + el.href + '">Download this image</a>'*/];
}, function(el) {
[B] $("#productMainImageReview a").removeAttr("rel");[/B]
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
<?php if (ZEN_LIGHTBOX_CLOSE_IMAGE == 'true' || ZEN_LIGHTBOX_PREV_NEXT == 'true') { echo ("$('#lbPrevLink').addClass('prevNoHover'); $('#lbNextLink').addClass('nextNoHover');");}?>
});
//--></script>


**What this change does:**
IF you are using TPP and have the reviews tab turned on, this will  prevent the reviews page default image from treated like an additional  product image and being grouped in with the rest of your product images  in the lightbox.

The issue is MUCH MORE obvious when you have a main product image and no  additional images.. Because the reviews page image is being treated as  an additional image, the net effect is that the lightbox will show 1 of 2  images. (the "second" image being the product reviews page image)
25 Aug 2013, 09:09
#3405
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

So I am back with more issue regarding product images and product reviews.. I think the issue I reported previously regarding the images and reviews may not be related to TPP at all.. I think the issues with having reviews on the tabs in TPP is caused because of an overall issue with how Colorbox (and Zen Lightbox) display/deal with reviews and product images together in general.

I reported this new find in the Zen Lightbox thread, but I'm reporting here too since I am seeing the SAME issue with both Colorbox and Zen Lightbox.

Not sure why, but the Lightbox and Colorbox add-ons are generating some weird/invalid HTML on the product reviews pages. You will see the model number appear in what appears to be some weird link to the left of the product image. Using Zen Lightbox, you can see what I am speaking of on this page:
http://clientlaserdiscvault**(dot)overthehillweb(dot)**com/index.php?main_page=product_reviews&products_id=8909

I found the EXACT same issue with the beta version of the Colorbox add-on as well. You can see the same issue using the Colorbox add-on on this page:
http://clienthairisle**(dot)overthehillweb(dot)**com/Hair-Extensions/Economy-Collection/Economy-Unprocessed/Indian-Remy-Micro-Thin-Machine-Weft-Virgin-Curly-Texture-3-Oz/reviews?number_of_uploads=0&

This weird link goes away when I turn off Lightbox or Colorbox.

Without Lightbox turned on this is the HTML created:

<div id="productReviewsDefaultProductImage" class="centeredContent back"> <div id="productMainImage" class="centeredContent back"> <script language="javascript" type="text/javascript"> <!-- document.write('<a href="javascript:popupWindow(\'http://myclient.com/index.php?main_page=popup_image&pID=8909\')"><img src="images/dasPic_24141.jpg" alt="National Geographic - Secrets of the Titanic [G52000]" title=" National Geographic - Secrets of the Titanic [G52000] " width="349" height="350" /> <br /><span class="imgLink">larger image</span></a>'); //--> </script> <noscript> <a href="http://myclient.com/index.php?main_page=popup_image&pID=8909" target="_blank"><img src="images/dasPic_24141.jpg" alt="National Geographic - Secrets of the Titanic [G52000]" title=" National Geographic - Secrets of the Titanic [G52000] " width="349" height="350" /><br /><span class="imgLink">larger image</span></a> </noscript> </div></div> ``` > > With Lightbox turned off this is the HTML created (note the mis-behaving HTML created is in red): > ``` <div id="productReviewsDefaultProductImage" class="centeredContent back"> <div id="productMainImage" class="centeredContent back"> <script language="javascript" type="text/javascript"> <!-- document.write('<a href="images/dasPic_24141.jpg" rel="lightbox-g" title="National Geographic - Secrets of the Titanic<br /><span class=\"smallText\">[G52000]</span>"><img src="images/dasPic_24141.jpg" alt="National Geographic - Secrets of the Titanic [G52000]" title=" National Geographic - Secrets of the Titanic [G52000] " width="349" height="350" /><br /><span class="imgLink">larger image</span></a>'); //--> </script> [B]<a href="images/dasPic_24141.jpg" rel="lightbox-g" title="National Geographic - Secrets of the Titanic<br /><span class=" smalltext"="">[G52000]"><img src="images/dasPic_24141.jpg" alt="National Geographic - Secrets of the Titanic [G52000]" title=" National Geographic - Secrets of the Titanic [G52000] " height="350" width="349"><br><span class="imgLink">larger image</span></a> [/B] <noscript> <a href="http://myclient.com/index.php?main_page=popup_image&pID=8909" target="_blank"><img src="images/dasPic_24141.jpg" alt="National Geographic - Secrets of the Titanic [G52000]" title=" National Geographic - Secrets of the Titanic [G52000] " width="349" height="350" /><br /><span class="imgLink">larger image</span></a> </noscript> </div></div> ``` > > Using either Colorbox or Zen Lightbox, the issue goes away when I turn off these add-ons. It seems clear that there is something with how both of these add-ons deal with product images and reviews that goes awry. > > Any thoughts??

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:

  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:

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.

25 Aug 2013, 09:27
#3406
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

Diva, I was so excited to see this because I have such a thing happening when writing reviews and then being redirected to that page when done---I am trying to get a confirmation placed within the body and not the header.

I do not have TPP installed at all.

sadness---it did not work for me:(

so I added a bandage to your bandage...LOL I removed

<span class="smallText">[' . $review->fields['products_model'] . ']</span>

[Attachment no longer available]

25 Aug 2013, 14:49
#3407
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

DarkAngel:

Diva, I was so excited to see this because I have such a thing happening when writing reviews and then being redirected to that page when done---I am trying to get a confirmation placed within the body and not the header.

I do not have TPP installed at all.

sadness---it did not work for me:(

so I added a bandage to your bandage...LOL I removed

<span class="smallText">[' . $review->fields['products_model'] . ']</span>

[Attachment no longer available]

Do I understand this correctly then, you don't have TPP installed, but you do have what, Zen Lightbox installed? And with Zen Lightbox active or inactive are you getting the extra model info as a result of $reviews->fields['products_model'] having data in it? Is the show products_model option off in the associated template's product type description? I can't say that I've used the review option, so not sure what settings are offered by default for control of what is passed on.

25 Aug 2013, 17:53
#3408
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

DarkAngel:

Diva, I was so excited to see this because I have such a thing happening when writing reviews and then being redirected to that page when done---I am trying to get a confirmation placed within the body and not the header.

I do not have TPP installed at all.

sadness---it did not work for me:(

so I added a bandage to your bandage...LOL I removed

<span class="smallText">[' . $review->fields['products_model'] . ']</span>

[Attachment no longer available]
I'm not sure I understand what you are saying here.. I dunno what you mean by "being redirected to that page when done---I am trying to get a confirmation placed within the body and not the header."

The code I have will not remove the product model number unless you have TPP installed. IF you are saying that the issue with the model number exists EVEN when you DO NOT have TPP installed, then the code I posted won't work, and your "bandage" is not the right fix. (You'll need to look at the code I posted to see why.. hint: the code I posted says If TPP is installed do this, else do this)

In any case please confirm that the model number display issue IS an issue if you have Zen Lightbox installed and DO NOT have TPP installed..

25 Aug 2013, 18:12
#3409
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

mc12345678:

Do I understand this correctly then, you don't have TPP installed, but you do have what, Zen Lightbox installed? And with Zen Lightbox active or inactive are you getting the extra model info as a result of $reviews->fields['products_model'] having data in it? Is the show products_model option off in the associated template's product type description? I can't say that I've used the review option, so not sure what settings are offered by default for control of what is passed on.

Here's the deal.. Reviews are a built in Zen Cart feature.. You "turn on" the reviews features by either activating the reviews sidebox or by showing the reviews buttons on the product information page by turning them on in the admin (Catalog > Product Types > [Product Type])
The Show Model Number option On/Off from the Catalog > Product Types > [Product Type] applies to whether or not the the model number will be displayed in the product details section of the product info page.

<!--bof Product details list  -->
<?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
  <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT .  $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>'  : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
<br class="clearBoth" />
<?php
  }
?>
<!--eof Product details list -->

The issue I was reporting was that on the products review pages the model number was not displaying correctly.. It's not extra information and there is no option to turn the model number off/on on the product reviews pages. The reviews pages will display the model number based on whether or not the model number field is NOT null.. I always thought that the issue with the model number display was cause by a combination of TPP and Zen Lightbox being installed.. Based on Dark Angel's post, it sounds like this issue occurs even when TPP is not installed.. (I need her to confirm this)

25 Aug 2013, 19:38
#3410
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

No TPP installed
Lightbox is installed
model is set to show in product page

I did chck your code Diva and saw the difference --- it was like what mine has so i just remved the bit about the model and then tried to write a review again.... code to right of image was gone

when I click write a review button, write a review, submit I then I click submit button and it takes me to index.php?main_page=product_reviews&products_id=followed by the number that is where it showed the code in the image I put into my post. That is why i said I was trying to get a confirmation of the review being successfully submitted. The code I got for it was a header code and I need the Thanks to show up in the body not header.

I thought it was due to installing the plugin called dgreviews but then I saw Diva's post and thought it must be something to do with lightbox.

I have just recently started using the reviews again but have LB installed in other shops I have set up also without TPP and tested it there and yes the code showed up there too.

I forgot to say that when I removd the code I checked the product pages and the model was still visible there just not when writing the review and submitting it. Also on the reviews page it appears right below the title just like to the right of the image I posted. It only removed the bit that was to the left.

25 Aug 2013, 19:48
#3411
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

also noticed that the code--in part--is in 2 places so I just edited the part you posted about.

25 Aug 2013, 20:27
#3412
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

Based on Dark Angel's post, it sounds like this issue occurs even when TPP is not installed.. (I need her to confirm this)

It is not TPP but in fact Zen Lightbox and the issue has been their since I can remember :smile:

25 Aug 2013, 20:56
#3413
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

Well, I certainly feel at a loss at the moment, not being in front of a device that would allow me to look up code. So, sounds like the Zen Lightbox installation adds the ability to show additional information based on the model number of the reviewed product being filled in; however, doesn't offer any additional flag(s) to prevent display of that additional information. (Thought the additional info was model number data, but I think I was corrected on that above by Diva Vocals). Other than allowing ZLB to work on the reviews page, I am not sure why there would be a need for everyone to have code that would show this "errant" data. It may have been something that just got slipped in when packaging the update.

As I said I'm not in front of a device that works with code, but was wondering how that header compared to the default header. It may be that the header just needs to have that logic check undone and restored to the default version.

It may also be that an option should be added to the ZLB configuration area to allow showing the model info when it is present for the product. I say that because if the option isn't in the default files, and only appears in ZLB, then it should be controlled by ZLB, otherwise a similar option could be added to the template style, but then that would have to be carried over with ZC upgrades.

25 Aug 2013, 21:10
#3414
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

DarkAngel:

No TPP installed
Lightbox is installed
model is set to show in product page

I did chck your code Diva and saw the difference --- it was like what mine has so i just remved the bit about the model and then tried to write a review again.... code to right of image was goneIf you used the code snippet I posted to fix the errant model number display, and made the change you made, this is not the RIGHT way to do it.. That's why I asked.. You could have simply NOT used my recent code and commented out lines 43-44 in the original header_php.php file.. (which is the fix I posted originally)

However, that said, mc12345678 got me to thinking that I need to look closer at all the page header module files for the reviews.. I noticed that the issue appears on the "reviews" page (index.php?main_page=product_review), but not the write reviews page (index.php?main_page=product_reviews_write).. This gave me a clue that the key to the RIGHT answer is in the "write reviews" page header_php.php file regardless as to whether or not you have TPP or Zen Lightbox or Zen Colorbox installed..

In other words, the issue is not really a Zen Lightbox , Zen Colorbox or TPP issue, but an issue in the default Zen Cart files that is "aggravated" by Zen Lightbox, and Zen Colorbox (and possibly Fual Slimbox, though I have not tested that module specifically)

So undo the change I posted earlier and your hack to it and standby.. I am testing something that should work. But I need to test it on a store that is ONLY running Zen Colorbox without TPP.. and I also need to make sure that when Zen Colorbox is turned off or not installed that the code doesn't break anything because if this is right, I am going to suggest it as core code change to the Zen Cart admins..

DarkAngel:

when I click write a review button, write a review, submit I then I click submit button and it takes me to index.php?main_page=product_reviews&products_id=followed by the number that is where it showed the code in the image I put into my post. That is why i said I was trying to get a confirmation of the review being successfully submitted. The code I got for it was a header code and I need the Thanks to show up in the body not header.

I thought it was due to installing the plugin called dgreviews but then I saw Diva's post and thought it must be something to do with lightbox.

I have just recently started using the reviews again but have LB installed in other shops I have set up also without TPP and tested it there and yes the code showed up there too.

I forgot to say that when I removd the code I checked the product pages and the model was still visible there just not when writing the review and submitting it.
Nothing to do with this or the Zen Colorbox module, and not even close to being part of the issue I am trying to fix/address.. I am simply trying to fix the way that the product model number is called for and displayed on the reviews page.. This has NOTHING to do with how the reviews confirmations are displayed, and it's unlikely that the lightbox module is affecting this either..

25 Aug 2013, 21:18
#3415
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

rbarbour:

It is not TPP but in fact Zen Lightbox and the issue has been their since I can remember :smile:

mc12345678:

Well, I certainly feel at a loss at the moment, not being in front of a device that would allow me to look up code. So, sounds like the Zen Lightbox installation adds the ability to show additional information based on the model number of the reviewed product being filled in; however, doesn't offer any additional flag(s) to prevent display of that additional information. (Thought the additional info was model number data, but I think I was corrected on that above by Diva Vocals). Other than allowing ZLB to work on the reviews page, I am not sure why there would be a need for everyone to have code that would show this "errant" data. It may have been something that just got slipped in when packaging the update.

As I said I'm not in front of a device that works with code, but was wondering how that header compared to the default header. It may be that the header just needs to have that logic check undone and restored to the default version.

It may also be that an option should be added to the ZLB configuration area to allow showing the model info when it is present for the product. I say that because if the option isn't in the default files, and only appears in ZLB, then it should be controlled by ZLB, otherwise a similar option could be added to the template style, but then that would have to be carried over with ZC upgrades.

DarkAngel:

also noticed that the code--in part--is in 2 places so I just edited the part you posted about.

My code was meant to go in a very specific location and nowhere else.. You need to undo everything you did.. your hack to my code is not right or even needed.. (see my post just above this one..)

rbarbour:

It is not TPP but in fact Zen Lightbox and the issue has been their since I can remember :smile:
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..

mc12345678:

Well, I certainly feel at a loss at the moment, not being in front of a device that would allow me to look up code. So, sounds like the Zen Lightbox installation adds the ability to show additional information based on the model number of the reviewed product being filled in; however, doesn't offer any additional flag(s) to prevent display of that additional information. (Thought the additional info was model number data, but I think I was corrected on that above by Diva Vocals). Other than allowing ZLB to work on the reviews page, I am not sure why there would be a need for everyone to have code that would show this "errant" data. It may have been something that just got slipped in when packaging the update.

As I said I'm not in front of a device that works with code, but was wondering how that header compared to the default header. It may be that the header just needs to have that logic check undone and restored to the default version.

It may also be that an option should be added to the ZLB configuration area to allow showing the model info when it is present for the product. I say that because if the option isn't in the default files, and only appears in ZLB, then it should be controlled by ZLB, otherwise a similar option could be added to the template style, but then that would have to be carried over with ZC upgrades.Zen Lightbox doesn't add any additional anything to the model number on the reviews page. The ONLY thing that Zen Lightbox does on the reviews page is to display the product image inside a lightbox.. Zen Lightbox MANGLES the model number, and that's the ONLY issue I am trying to address..

25 Aug 2013, 21:30
#3416
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

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:

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:
> ```
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:

  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:

$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 = '';
}
25 Aug 2013, 21:49
#3417
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

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:

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:
> ```
$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 "".

25 Aug 2013, 21:58
#3418
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

mc12345678:

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..:smile: 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..:smile:

25 Aug 2013, 22:17
#3419
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

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..:smile: 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..:smile:

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.

25 Aug 2013, 22:33
#3420
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Zen Lightbox addon [Support Thread]

change the code:

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

find:

  
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:

  
  $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 = '';
  }