I would like to remove the links for "add album to cart" but leave the add photo to cart links.
I thought that this could have been done with permissions but I have not been able to find it. So....
I have attempted to modify the function getItemLinks in /cart/module.inc but am not successfull.
Ideas?
Dave
Posts: 7934
I think this should work (off the top of my head). Modify modules/cart/module.inc and in the getItemLinks function change the foreach loop to something like this:
foreach ($items as $item) { // Add this new code if (GalleryUtilities::isA($item, 'GalleryAlbumItem')) { continue; } // .. don't change anything elsePosts: 134
Make a change in modules/cart/module.inc. Change: foreach ($items as $item) {
into: foreach ($items as $item) { if (!GalleryUtilities::isA($item, 'GalleryAlbumItem')) {
and a bit below that change } to }}
This is what the forum told me to do and it works, But I am no mr.Bharat off course!!!
Posts: 14
Mr. Harat,
I have tried your suggestion as well as the other code change alluded to in this string, and have been unsuccessful in both attempts. Do you know of anything that would be overriding my changes to the module.inc file?
Here is the code from the getItemLinks function in the module.inc file:
function getItemLinks($items, $wantsDetailedLinks, $permissions) {
$links = array();
foreach ($items as $item) { if (!GalleryUtilities::isA($item, 'GalleryAlbumItem')) {
$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(GalleryStatus::success(), $links);
}
}
?>
Posts: 14
One thing that I left out was that I am utilizing the Paypal checkout module. I noticed in another post that vdd said that his "Add Album to cart" links reappeared after he activated the checkout modules. Just thought this might help with a fix. Thanks in advance for any help.
Posts: 134
So you want the same thing as I want.
Changing as I described works for the zip cart module and removing "add album to cart" works with what I wrote .
When I installed the Checkout modules then add "album to cart" comes back and I have looked everywhere to make a change and I am good enough
to arrange that and my question here on the forum is not yet answered
I have to wait
Posts: 61
I am also looking to remove the "add album to cart" link and have not been successful with the suggestions posted here. I am also using the Paypal Cart. Any further suggestions that will help eliminate this link, since it is a kick in the kidney to customers who click the link, accidently loading an entire album full of 100 or more photos into their cart.
Thank you,
Fidel
Posts: 16
Me too. I have searched and searched with no luck. Mostly I would like to remove 'add album to cart' but also would love to change the order/ edit the links in sidebar.
(Paypal checkout cart)
Thanks.
Posts: 431
Hi Guys,
Sorry for the delay in answering this - I hadn't noticed the question related to the PayPal checkout modules.
To remove the link from albums, you need to edit modules/checkout/module.inc in the getItemLinks() function (near the bottom of the module, probably around line 250 in the current released version). Change this:
foreach ($items as $item) { if (isset($permissions[$item->getId()]['checkout.purchase'])) {to this...
foreach ($items as $item) { if (GalleryUtilities::isA($item, 'GalleryAlbumItem')) { continue; } if (isset($permissions[$item->getId()]['checkout.purchase'])) {... by adding the code in bold. This is a bit of a hack, but it will work OK for now. I am looking at putting an admin option in a future release to specify what item types to show links for (hence allowing albums to not have the link).
Hope this helps.
Posts: 16
Perfect! Thanks much!
Posts: 61
Turnbulm,
So far, that appears to be a useful piece of code that does exactly what we were looking for. Thanks for the hard work.
Fidel Gonzales
Posts: 4
That worked sweet! Thank you!
Posts: 9
Hello Brett,
I allow myself to write you back as I have a post from you that expresses that finally
you succeed to cancel the voice Add Album to Cart in Menalto. There are so many post
that I am lost...
I am a photographer and intend to use Menalto Checkout Module but...
I'd like to have a nice and clean interface.
http://www.golferspirit.com/galerie/main.php
I am asking which files must be edited to :
- avoid the mention : 'Add Album to Cart' under the first level of a categorie
like Wedding or Sports etc...
- translating the mention : 'Add to Cart' in french
I did not find the files where to do that but I have translated the rest !
- Adding an icone of a caddy under the small photos and under the big one
once the person has clicked to see it better.
- Resolve the problem of the form that occurs at the end of the paiment process
when the client has filled the form : 'An error as occured'...
If you can help me to resolve one of these problem, I would be so thankful.
Skyfox
Posts: 10
I want to remove "Add Photo to Cart" and "Views" link too...Please suggest
Posts: 134
see
http://gallery.menalto.com/node/36914
Posts: 41
Hi all,
I'm really struggling with the problem of removing the shopping cart icon/text from my album pages. I have removed the link to add albums to the cart, but I cannot get the link to disappear for individual items. I have added the
text in the proper place, but to no avail.
Not only does the link to add the photos to the cart still show, but it's a different icon/text than what is displayed on my photo pages. I have no idea how this happens, seeing as both are called from the navigator.tpl. If I could even sync them, that would be better, but I really want to remove the icon from the album pages.
Any suggestions?
If someone is able to help me out, I've got a site in development that I can point you to for a working example, but I'd rather not post the link for the world yet.
Many thanks in advance for any advice!
matt
Posts: 5
I removed mine by simply going to siteadmin, modules, scroll down till you see cart and select deactivate.
regards,
burntpixel
Posts: 49
But if you want to use the cart for some albums, surely that defeats the cart totally?
Posts: 3
Was there any update on how to do this for the latest version of software?
We have tried turnbulm's suggestion but it doesn't work.
We don't want to deactivate the Cart module entirely - just remove the option to 'Add Album to Cart'.
Posts: 10
I cant see modules!
Posts: 10
I want specific folders to have carts and some not to - does anyone know how to do this?
Posts: 4338
And the Lazarus prize for the best resurrection of a long-dead thread goes to...
If you're using checkout, use the permissions feature: withdraw the [checkout] Purchase Item or [checkout] Purchase Album permissions from the folders you don't want people to buy from.
Posts: 10
Well that was easy enough - why couldnt people of just said that instead of all that jargon about coding and all that confusing poor inocent people hehe
Posts: 4338
The cart module doesn't use permissions in the same way. Checkout wasn't the module used by the person who opened this thread, it didn't exist at the time. Even checkout didn't have the permissions thing sorted at the time of the last post previous to yours, which was nearly three years ago. Hence my comment about Lazarus and resurrections. You could have found the answer I gave you already in any of the dozen or so other threads on the same topic if you'd searched for them.
And if I read "why couldn't of" one more time instead of "why couldn't have" I shall scream. Does nobody learn grammar any more?