[checkout] permissions

6fish

Joined: 2008-04-24
Posts: 13
Posted: Sat, 2008-05-17 20:40

HI

I would like the default permissions to be set so that group 'Everybody' can purchase entire albums, but NOT individual shots

is this possible ? if so how can i achieve it ... without manually changing the permission for individual shots

thanks

nigel

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 1506
Posted: Sat, 2008-05-17 23:48

There's really no such distinction possible. Firstly adding an album to your cart simply adds all the contained images in one go. There's nothing then to stop the purchaser removing all but one of them, leaving the same effect as adding a single item.

Secondly, I'm not sure (I'll check) but in order to add the contents of an album in any meaningful sense the user is required to have '[checkout]Purchase Item' on the individual images in the album, for the same reason.

It sounds like you want albums to be purchaseable as individual and complete entities. Checkout as it stands doesn't recognise that concept, although it could be modified to do so.

Login or register to post comments
6fish

Joined: 2008-04-24
Posts: 13
Posted: Sun, 2008-05-18 08:24

Hi

thanks for your reply

regarding removing items from cart - i have simply removed the tick-boxes from the checkout page

the user still has the option to empty basket - which is fine

regarding your second point - i have tested turning off permissions to buy individual items - but still allowing permission to buy entire album - and it seems to work ... all items in the album are still added to the cart when a user selects 'add album to cart'

so i think i just need a faster way to change permissions of individual items so they cannot be purchased alone?

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 1506
Posted: Sun, 2008-05-18 09:40
6fish wrote:
regarding your second point - i have tested turning off permissions to buy individual items - but still allowing permission to buy entire album - and it seems to work ... all items in the album are still added to the cart when a user selects 'add album to cart'

I should check which version of checkout you're using then - in the latest version (0.3.3_beta3) you definitely need the permission on individual items to add them to your cart - even adding them one album at a time. It may be true for older versions too. (If you're using 0.3.3 then I suspect you haven't set the permissions quite how you think you have.)

Another way to achieve the same end is to leave the permission set on everything and allow the 'add to cart' link to appear *only* for album items (kind of the opposite of the 'Enable Add Album...' checkbox in the admin page) - which you can do by editing function getItemLinks() in modules/checkout/module.inc at line 586 (for 0.3.3) from:

if (GalleryUtilities::isA($item, 'GalleryAlbumItem') && !$params['canAddAlbum']) {
			continue;
        }

to:

if (!GalleryUtilities::isA($item, 'GalleryAlbumItem')) {
			continue;
        }

That would be a site-wide change that would prevent 'add to cart' being shown under anything but albums. The user could still add single items by some judicious spoofing; but then again they could do that to remove single items even though you've removed the checkbox from the template.

Login or register to post comments
6fish

Joined: 2008-04-24
Posts: 13
Posted: Sun, 2008-05-18 21:06

HI

thats worked great thanks ... i think i am pretty much there now

i have updated to 0.3.3

one thing which has stopped working is the item price / total price has disapeared

however, if i make payment with paypal, then the total amount is still correct

would it help if i sent you the URL ?

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 1506
Posted: Sun, 2008-05-18 21:32
6fish wrote:
would it help if i sent you the URL ?

No, just go to the module admin page and click save, that should fix the problem.

Login or register to post comments
6fish

Joined: 2008-04-24
Posts: 13
Posted: Sun, 2008-05-18 21:55

well ... what do you know

that worked fine as well

thankyou !

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 1506
Posted: Sun, 2008-05-18 22:00

;-)

Login or register to post comments