marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
hooks in Product Thumbnail Grid Layout?

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « hooks in Product Thumbnail Grid Layout? »
Welcome, Guest. Please Login or Register.
12/18/17 at 18:42:18
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   hooks in Product Thumbnail Grid Layout?
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: hooks in Product Thumbnail Grid Layout?  (Read 1147 times)
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
hooks in Product Thumbnail Grid Layout?
« on: 01/12/07 at 01:43:51 »
Reply with quote Modify message

I was thinking of some pretty useful applications for hooks inside the Product Thumbnail Grid Layout (in particular, extending the Scottoons method for        Using CPSHOP info on other site pages -- no file parsing necessary.)

Apparently this is not implemented. At least, it's not working for me.

Could it be implemented?

p.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: hooks in Product Thumbnail Grid Layout?
« Reply #1 on: 01/19/07 at 12:46:14 »
Reply with quote Modify message

I looked through cpdata.lib. gethooks() is being called with $content passed in. So I'm at a loss as to why the hooks I'm placing in the grids aren't being expanded.

Am I doing something stupid?

Help?!

p.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: hooks in Product Thumbnail Grid Layout?
« Reply #2 on: 01/19/07 at 12:47:56 »
Reply with quote Modify message

Where are you trying to implement it?
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: hooks in Product Thumbnail Grid Layout?
« Reply #3 on: 01/19/07 at 21:53:42 »
Reply with quote Modify message

In the cphooks directory I have the hook file

froogle_store.cgi.all.test.txt

with 766 permissions and the contents


Code:
<div>inside the hook</div>


In cpadmin for froogle_store.cgi I have set the product thumbnail grid as:


Code:
<td>Here<[hook:test]>Hook</td>


and saved with empty cache.

My understanding is that because there is a froogle_store.cgi.all.test.txt hook file in the cphooks directory
<[hook:test]> should be evaluated for every product on every product thumbnail page.

The result on every product thumbnail page is:


Code:
<table cellpadding=3 cellspacing=0 border=0 width="527"><tr>
<td>HereHook</td>
<td>HereHook</td>
<td>HereHook</td>
</tr>
<tr>
<td>HereHook</td>
<td>HereHook</td>
<td>HereHook</td>
</tr>


Cheers,

p.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: hooks in Product Thumbnail Grid Layout?
« Reply #4 on: 01/23/07 at 14:04:45 »
Reply with quote Modify message

Finally figured it out.

[NOTE: this change was incorporated into cpshop 2.4]

[NOTE2: this change doesn't fix hooks in grid thumbnails for all hook types. See the post below to get pno, pno.all, type and sectionid hooks working in grid thumbnails.]

A pair of identical lines in cppage.lib are stripping the hook tags out of thumbnail cells before gethooks is called. The repair is to change both occurrences of:


Code:
$cell =~ s/<\[(.*?)\]>/$LINE{$1}/g;


in cppage.lib to


Code:
$cell = gethooks($cell);
$cell =~ s/<\[(.*?)\]>/$LINE{$1}/g;


cheers,

p.
« Last Edit: 02/23/07 at 10:26:22 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: hooks in Product Thumbnail Grid Layout?
« Reply #5 on: 01/23/07 at 16:30:54 »
Reply with quote Modify message

Ooops.  Deleted.
« Last Edit: 01/23/07 at 17:12:44 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: hooks in Product Thumbnail Grid Layout?
« Reply #6 on: 02/23/07 at 10:24:06 »
Reply with quote Modify message

Oops.

The fix above (incorporated into 2.4 by Marty) works only for some hook types, but not for pno, sectionid, pno.all and type hooks.
There are two hook implementation issues to deal with.

1. Product Number hooks don't work as documented. You need to specify both the Cafe Press shopid & the productnumber in the hook file name. EG:

cpshop.cgi.pno.criticalgraphic.1234567.morecolors.txt

would be the hook filename for product # 1234567 in my shop at http://www.cafepress.com/criticalgraphic

2. The gethooks() function requires that the $target global variable has a value for pno, type, pno.all and sectionid hooks to work. However, $target is NULL when displaying thumbnail pages. The fix is a bit of a kludge, but simple enough.

In cppage.lib (cpshop ver. 2.4) find both lines of code that look like this:



Code:
$cell = gethooks($cell);


change them to this



Code:
if (!$target) {$target = "yep";}
$cell = gethooks($cell);
if ($target eq "yep") {$target = "";}



Go into cpadmin and save all changes for your store, making sure to clear the caches.

Now hooks should work fine in cpshop.

cheers,

p.
« Last Edit: 02/23/07 at 10:27:22 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Pages: 1 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright © 2000-2001, X-Null. All Rights Reserved.