Forums / Upgrading to 1.5.x / Updating Mod for 150 - Little Problem

Updating Mod for 150 - Little Problem

Results 1 to 20 of 62
31 Mar 2012, 23:51
#1
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Updating Mod for 150 - Little Problem

Hi There,

I'm attempting to update the Recently Viewed Items mod to be compatible with ZC150.

However, after install, the product images showing in the sidebox are full sized images, instead of smaller thumbs, even though the code in templates/YOUR_TEMPLATE/sideboxes/tpl_recent_products.php calls a smaller image:

[php] $content .= '<a href="' . zen_href_link(zen_get_info_page($recent_products->fields["products_id"]), 'products_id=' . $recent_products->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br />' . $recent_products->fields['products_name'] . '<br />' ; [/php]You can see the issue in my test store. Just view a couple products and you'll see the issue straight away.

This mod worked just fine for me in ZC139. All I did to update it to 150 was copy the mod's code from old outdated ZC files (dating back to 1.3.8) into their new 150 counterparts....but obviously I've still messed up somewhere.

Suggestions?
01 Apr 2012, 03:20
#2
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

Re: Updating Mod for 150 - Little Problem

I'm not familiar with the mod, but when looking at the source of the recently viewed, did you notice that the alt and title tags were both "80", it seems almost as though the code you have above is missing the alt and title variables, isn't there supposed to be either a null or the product title passed through eg

zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], 'title or empty', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

Do you have your working copy available for us to play with?


ScriptJunkie:

Hi There,

I'm attempting to update the Recently Viewed Items mod to be compatible with ZC150.

However, after install, the product images showing in the sidebox are full sized images, instead of smaller thumbs, even though the code in templates/YOUR_TEMPLATE/sideboxes/tpl_recent_products.php calls a smaller image:

[php] $content .= '<a href="' . zen_href_link(zen_get_info_page($recent_products->fields["products_id"]), 'products_id=' . $recent_products->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br />' . $recent_products->fields['products_name'] . '<br />' ; [/php]You can see the issue in my test store. Just view a couple products and you'll see the issue straight away.

This mod worked just fine for me in ZC139. All I did to update it to 150 was copy the mod's code from old outdated ZC files (dating back to 1.3.8) into their new 150 counterparts....but obviously I've still messed up somewhere.

Suggestions?
01 Apr 2012, 12:56
#3
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

nigelt74:

I'm not familiar with the mod, but when looking at the source of the recently viewed, did you notice that the alt and title tags were both "80", it seems almost as though the code you have above is missing the alt and title variables, isn't there supposed to be either a null or the product title passed through eg

zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], 'title or empty', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

Do you have your working copy available for us to play with?


Yes, I noticed that too (the 80 showing up as the title and alt tags). I think that's very weird...AND it happens to be the image dimensions I have set in config>images for my small image size. I haven't been able to locate that bit of code in order to edit it or try and understand which other bit of code may be generating it. (no luck with developer's toolkit).

I'm attaching the zip file so anyone who's interested can take a look at it.

Thanks for taking the time to respond to the thread and peek at the code. I know how busy you are :smile:
01 Apr 2012, 20:44
#4
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

And here's the text from the error log that's being generated:

[31-Mar-2012 22:09:27]
PHP Warning:  include(includes/modules/FILENAME_RECENT_PRODUCTS_MODULE.php) [<a 
href='function.include'>function.include</a>]: failed to open stream: No such file or directory in 
/xxx/xxx/public_html/2testzc/includes/templates/atestcustom/templates/tpl_modules_recent_products.php 
on line 12


[31-Mar-2012 22:09:27]
PHP Warning:  include(includes/modules/FILENAME_RECENT_PRODUCTS_MODULE.php) [<a 
href='function.include'>function.include</a>]: failed to open stream: No such file or directory in 
/xxx/xxx/public_html/2testzc/includes/templates/atestcustom/templates/tpl_modules_recent_products.php 
on line 12


[31-Mar-2012 22:09:27] 
PHP Warning:  include() [<a href='function.include'>function.include</a>]: Failed opening 
'includes/modules/FILENAME_RECENT_PRODUCTS_MODULE.php' for inclusion 
(include_path='.:/usr/lib/php:/usr/local/lib/php') in 
/xxx/xxx/public_html/2testzc/includes/templates/atestcustom/templates/tpl_modules_recent_products.php on line 12
02 Apr 2012, 02:26
#5
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

Re: Updating Mod for 150 - Little Problem

Umm that seems to be working fine on my test site, working exactly as it should the images in the sidebox are exactly the size they should be.

And there don't appear to be any errors being generated at all
02 Apr 2012, 02:41
#6
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

nigelt74:

Umm that seems to be working fine on my test site, working exactly as it should the images in the sidebox are exactly the size they should be.

And there don't appear to be any errors being generated at all


Hmmm....I don't understand that because I just took a look again in FF, IE, Chrome, and Opera. Got the same results each time (huge blown up images in the recently viewed sidebox) in all browsers and four new error logs in the cache.

I'm going to try reinstalling and see what happens.
02 Apr 2012, 02:52
#7
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

Re: Updating Mod for 150 - Little Problem

Yeah, i am currently updating an old test shop thats online from 1.39 to 1.5 to double check it.

It worked beautifully on my local server, however Image handler was installed, although i tested it with IH4 turned on and turned off, i just want to eliminate that having an effect.

----------------- Edit

I didn't install the optional file, i might just try that and see f it has an effect
02 Apr 2012, 03:23
#8
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

nigelt74:

Yeah, i am currently updating an old test shop thats online from 1.39 to 1.5 to double check it.

It worked beautifully on my local server, however Image handler was installed, although i tested it with IH4 turned on and turned off, i just want to eliminate that having an effect.

----------------- Edit

I didn't install the optional file, i might just try that and see f it has an effect


Did a complete uninstall (including db files) and then a reinstall. Same results (huge image file, same error log in cache).

I also tried both with and without the optional file, no change in results.

Also though about IH's influence, as did you...but ruled out that IH "makes" it work because I recall having this mod installed on both a 138 and a 139 (updated from 138) installation long before I discovered and installed IH.

The difference between this 150 install and my 139 install (besides the ZC version difference)...is that the 150 is a fresh vanilla install whereas the 139 is an update of a 138.
02 Apr 2012, 04:02
#9
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

I took a look at the pre-updated fileset for this mod and compared it against the old original I had tucked away in my 138 mod files.

Turns out the reason the mod worked on my 138 and 139 store is because it's a completely different mod.

The mod I had installed on my old stores is "Recently Viewed Sidebox" and the mod I downloaded to update to ZC150 is "Recently Viewed Items".

Further, "Recently Viewed Sidebox is SO old that it's not even available in the download section anymore - it doesn't even have a readme or comments in the files so I have no clue who wrote it. From the comments, I can see that whoever wrote it based it on the Best Sellers Sidebox mod...but other than that, it's a mystery.

Anyway...before either of us spend anymore time trying to solve the "Recently Viewed Item" mod...I'm going to give the "Recently Viewed Sidebox" mod a whirl on the 150 installation, even though it's really old, and see what happens.
02 Apr 2012, 04:19
#10
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

Re: Updating Mod for 150 - Little Problem

Ok it failed miserably on my second test shop

SO
Try this, it works for me


zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)


becomes


zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], $recent_products->fields['products_name'],SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)


The solution in my first post regarding a null field also works, but this one is reader friendly by filling the alt and title tags
02 Apr 2012, 04:30
#11
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

Re: Updating Mod for 150 - Little Problem

You should see it working here

grumpykiwi.com/

once you have browsed a few products obviously (embarrasingly i forgot to do that originally)
02 Apr 2012, 05:09
#12
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

Great, will give that a try in just a moment and get back to you :)

Thanks!


Ok it failed miserably on my second test shop

SO
Try this, it works for me

[PHP]zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)[/PHP]
becomes


[PHP]zen_image(DIR_WS_IMAGES . $recent_products->fields['products_image'], $recent_products->fields['products_name'],SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)[/PHP]
The solution in my first post regarding a null field also works, but this one is reader friendly by filling the alt and title tags

Nigel
Webzings Design
The last couple of Zen-Cart sites we have worked on, Darncat Designs, Sweet Brucies
02 Apr 2012, 05:52
#13
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

Ok...here's where we're at....

Recently Viewed SIDEBOX mod works perfectly in ZC150
Recently Viewed ITEMS also works in ZC150, insofar as the sidebox is concerned...and that is thanks to the change in code that you posted.


However, the difference in functionality between these two mods is that the Recently Viewed ITEMS mod is supposed to add a centerbox so that users can have recently viewed items in a centerbox beneath the "also purchased" centerbox. That's what the optional file is for.

That functionality is not working, so at this point, the two mods are essentially the same.

I'm going to go ahead and submit the Recently Viewed SIDEBOX mod to the downloads section (after I write a readme for it).

If I can get the Recently Viewed ITEMS mod to display the centerbox, then I will submit that one too...so folks will have a choice between showing their additional items in a sidebox, a centerbox, or both.

Thanks so much for your help!!
02 Apr 2012, 06:48
#14
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

Re: Updating Mod for 150 - Little Problem

Do you know there is a spelling mistake in the optional files?

the final folder is named template rather than templates

3. Optional Install File\includes\templates\YOUR_CUSTOM_TEMPLATE\template

i am fairly sure it should be templates
02 Apr 2012, 06:54
#15
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

nigelt74:

Do you know there is a spelling mistake in the optional files?

the final folder is named template rather than templates

3. Optional Install File\includes\templates\YOUR_CUSTOM_TEMPLATE\template

i am fairly sure it should be templates


You're right...I was in the process of adding/naming that directory when my grandson climbed in to my lap so the "S" never got added. Thanks for catching it!
02 Apr 2012, 07:05
#16
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

Re: Updating Mod for 150 - Little Problem

hmmm

just noticed in your error message


includes/modules/FILENAME_RECENT_PRODUCTS_MODULE.php


Thats not the name of a file is it, doesn't that mean a define or something is incorrect?
02 Apr 2012, 07:18
#17
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

nigelt74:

hmmm

just noticed in your error message

[PHP]includes/modules/FILENAME_RECENT_PRODUCTS_MODULE.php][/PHP]

Thats not the name of a file is it, doesn't that mean a define or something is incorrect?



Wow, that's really obvious...can't believe I missed it! Thanks! I made the correction to the file and will test tomorrow and post results back here.

Thanks again for all your help!
02 Apr 2012, 15:33
#18
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

Changed includes/modules/FILENAME_RECENT_PRODUCTS_MODULE.php

to

includes/modules/FILENAME_RECENT_PRODUCTS.php



Changed line 12 of /includes/templates/atestcustom/templates/tpl_modules_recent_products.php from

[PHP]include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_RECENT_PRODUCTS_MODULE));[/PHP]

to

[PHP]include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_RECENT_PRODUCTS));[/PHP]


Same result:
  • Centerbox won't display
  • Same error being thrown
  • Sidebox displays as expected
02 Apr 2012, 15:45
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Updating Mod for 150 - Little Problem

If either FILENAME_RECENT_PRODUCTS_MODULE or FILENAME_RECENT_PRODUCTS is defined somewhere, the uppercase will be replaced by its defined value when used... so it appears you are missing a define.
02 Apr 2012, 15:45
#20
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Updating Mod for 150 - Little Problem

Ok...here's where I get lost because I'm not a coder.....but shouldn't defines be in the language file? Or can they be anywhere? Perhaps the missing define should be on line 12 of the file mentioned in the error?

And..how do I go about writing a define statement? Can I just google that?