"add to cart" link only for photos & movies -- but NOT albums (I have searched!!!)

penguins66

Joined: 2007-08-30
Posts: 32
Posted: Sun, 2007-12-02 14:24

How can I have the "add to cart" link appear only for photos & movies -- but not for albums?

After several searches through previous posts, I believe this is possible by editing module.inc in the cart directory. I cannot, however, find any instructions for how to do this. First, in editing module.inc, I create a local directory, correct? Second, what edits do I make to achieve my goal?

I believe the edits involve this section of module.inc, but I'm not sure...

Quote:
/**
* @see GalleryModule::getItemLinks
*/
function getItemLinks($items, $wantsDetailedLinks, $permissions) {
$links = array();
foreach ($items as $item) {
if (isset($permissions[$item->getId()]['cart.add'])) {
$itemTypeNames = array_merge($item->itemTypeName(), $item->itemTypeName(false));
/* Specific translations: _('Add Album To Cart') _('Add Photo To Cart') */
$links[$item->getId()][] =
array('text' => $this->_translate(
array('text' => 'Add %s To Cart',
'arg1' => $itemTypeNames[0]), $itemTypeNames[2]),
'params' => array('controller' => 'cart.AddToCart',
'itemId' => $item->getId(), 'return' => true));
}
}

return array(null, $links);
}

My website is http://www.feeney.net/gallery/ I am using Gallery 2.2.3 and have very little coding knowledge (enough to tinker, but not to write).

Thank you in advance! :)

 
penguins66

Joined: 2007-08-30
Posts: 32
Posted: Sun, 2007-12-02 19:04

Got it! My original search terms were too broad. For others who want to make these changes, check out:

http://gallery.menalto.com/node/35784
and
http://gallery.menalto.com/node/60796

Be sure to make the changes directly to module.inc -- not a copy in a "local" directory. Figuring that our slowed me up a bit. Apparently, .inc files need to be edited directly.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2007-12-02 21:47

This thread as well:
http://gallery.menalto.com/node/37707

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team