[PGtheme] incorrect AddToCart for album items in album.tpl?

febrile

Joined: 2006-01-13
Posts: 3
Posted: Wed, 2006-03-29 18:51

Using PGtheme V1.0RC7
... + latest *.tpl files from gallery.menalto.com/node/33603
... + latest theme.inc fix for G2.1 compatibility http://gallery.menalto.com/node/33603?from=850#comment-172468,
the AddToCart icons for album item actions add the whole album to cart rather than just the relevant item.

My naive hack is to look around line 900 in album.tpl for

Quote:
{if $theme.params.ItemsActions}
...
{if ($theme.checkout ==1)}
<a href="{g->url arg1="controller=checkout.AddToCart" arg2="itemId=`$theme.item.id`" arg3="return=`$theme.item.id`"}"
{else}
<a href="{g->url arg1="controller=cart.AddToCart" arg2="itemId=`$theme.item.id`" arg3="return=`$theme.item.id`"}"
{/if}
{* NOTE: THIS APPEARS IN 4 PLACES *}
...
{/if}

and change `$theme.item.id` to `$child.id` in these links.

This works for me, but as a newbie I can't claim it's the right/best way.
febrile

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Wed, 2006-03-29 19:00

febrile, found the error after installing the updated shopping-cart too.
I've changed the $theme.item.id to $child.id in the loop displaying the album items as you described - only the ones one the nav-top can stay untouched.

CU
Lutz

Gallery version = 2.1 core 1.1.0
PHP version = 5.1.1 apache2handler
Webserver = Apache/2.2.0 (Win32) DAV/2 PHP/5.1.2 mod_ssl/2.2.0 OpenSSL/0.9.8a
Database = mysql 5.0.18-nt-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de