Editing a Module or Page for Checkout

maximumrock

Joined: 2008-11-04
Posts: 31
Posted: Tue, 2009-01-27 21:30

i made another post, but maybe it should be moved here instead? not sure..

But i have a checkout module on a photo store.. and instead of ADD PHOTO TO CART, i would like to rename that line to say "ADD ITEM TO CART" instead. Is there a simple way i can do this? I have a testing site to try out.. just looking for a few tips from the experts here or even alex himself!HAHA

thx

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2009-01-28 09:01

'photo' and 'Photo' are defined in modules/core/classes/GalleryPhotoItem.class line 193 (for G2.3)

If you want to keep 'photo' elsewhere though, and *just* change the 'Add photo to cart' then edit modules/checkout/module.inc line 859/860 from

			    array('text' => $this->translate(array('text' => 'Add %s To Cart',
							   'arg1' => $itemTypeNames[0])),

to

			    array('text' => $this->translate(array('text' => 'Add Item To Cart'
							   )),

Although this will mean that albums also have "Add Item to Cart" (if you have add Album to Cart enabled). Also, either change may screw up the translations for this command.

Who is this Alex of whom you speak?

 
maximumrock

Joined: 2008-11-04
Posts: 31
Posted: Wed, 2009-01-28 18:02
alecmyers wrote:
'photo' and 'Photo' are defined in modules/core/classes/GalleryPhotoItem.class line 193 (for G2.3)

If you want to keep 'photo' elsewhere though, and *just* change the 'Add photo to cart' then edit modules/checkout/module.inc line 859/860 from

			    array('text' => $this->translate(array('text' => 'Add %s To Cart',
							   'arg1' => $itemTypeNames[0])),

to

			    array('text' => $this->translate(array('text' => 'Add Item To Cart'
							   )),

Although this will mean that albums also have "Add Item to Cart" (if you have add Album to Cart enabled). Also, either change may screw up the translations for this command.

Who is this Alex of whom you speak?

Thanks man! oh, sorry, i meant Alec.. meaning YOU.. lol. you helped me out before last fall..

I wasnt aware that we could have "Add Album to Cart" disabled.. i will have to look for that..

So its safe to make this change from "photo" to "item"? what do you mean by the translations for that cmd getting screwed up.. thx for replying

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2009-01-28 18:18
Quote:
I wasnt aware that we could have "Add Album to Cart" disabled.

It's a separate permission - if you have assigned it, you get "add album to cart" under albums. If you haven't assigned the permission it won't appear.

Quote:
what do you mean by the translations for that cmd getting screwed up

The translation system looks for the text as it appears originally in the module. Suppose your language is German, then there's no translation for the exact text "Add Item to Cart" so it won't be translated and so will appear in English. Possibly in the middle of a page full of German. There is a translation for "Add %s to cart" and (probably) also a translation for "Item", but not for "Add Item to Cart" as a single piece of text.

Of course if you don't care about foreign languages (most of the translations for checkout don't exist anyway) then it doesn't matter.

 
maximumrock

Joined: 2008-11-04
Posts: 31
Posted: Thu, 2009-01-29 15:08

Thanks Alec! it worked. However, can you tell me where the option is to turn off "Add album to cart" on the gallery..Since i made the changes i wanted with having "item" in place of "photo"....it now says ADD ITEM TO GALLERY where it used to say add "album".... dont think i want that..

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-01-29 15:07

IT's permission based. Unless the user has the "[checkout] purchase album" permission on the album it doesn't appear. (I think it appears always for admins, as you have all permissions, ex-officio.)

 
maximumrock

Joined: 2008-11-04
Posts: 31
Posted: Sat, 2009-02-14 20:09

thx again alec.. its been working great!