Shopping Cart Module

ryanh

Joined: 2005-01-27
Posts: 29
Posted: Sat, 2005-02-05 14:26

I've just had an idea for another website I'm developing to integrate gallery with it's ordering system.
This site features a lot of photos of products (suprise!) and I'd like to incorporate gallery and the cart module for the browsing and purchasing of items.

I've tinkered with the cart in G2 and it doesn't seem that I can provide a check out URL, or prices for photos. I'm assuming this is still under development, but is the end use of this cart module to be able to integrate with a site like 2checkout or paypal?

Thanks,
Ryan

 
volksport
volksport's picture

Joined: 2002-10-06
Posts: 239
Posted: Sat, 2005-02-05 17:31

The cart module is a framework. A plugin will decide how it functions. We don't currently offer one yet, but someone in the forums has started a paypal one. That might be of use to you.

 
samokk

Joined: 2003-06-25
Posts: 33
Posted: Sat, 2005-02-05 19:54

instead of having another cart module framework, wouldn't it be possible to integrate some existing cart framework, that already has lots of gateways, to g2 ?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-02-07 23:19

that's a cool idea.. a new module to relay 'add-to-cart' requests to some other system? let's see it!

 
AussieJohn
AussieJohn's picture

Joined: 2005-01-12
Posts: 9
Posted: Wed, 2005-02-09 02:29

This sounds like a great idea, and very much like what I am after as well.

A way to specify a url to pass the values to so when someone adds an
item to the cart, it will pass the correct values to the carts page...

and from there on in, the cart can handle the rest.

John

 
rabid

Joined: 2005-02-10
Posts: 2
Posted: Thu, 2005-02-10 06:30

What is the effort estimate to inegrate a pre-existing shopping cart module like Zen cart ??

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-02-10 07:02

it's easy to create a G2 module that adds an "add to cart" command for each item that calls some php code.. you can then load up whatever details you need about the selected G2 item and pass that off to Zen cart, then redirect to a view cart page.
if you want to integrate the Zen cart so it fits better in G2 that will take some additional work....

 
AussieJohn
AussieJohn's picture

Joined: 2005-01-12
Posts: 9
Posted: Fri, 2005-02-11 08:33

Easy for harder for others to create a module.

I'm looking into doing exactly what you described, writing a module for a
3rd party cart to add an 'add to cart' command to each item/album which
can then be passed on to the shopping cart.

I am having some trouble finding where to start...
I've looked through the Development Docs, I'm still a bit confused...
does any one have a Gallery API reference laying around somewhere
that I could use ?

Thanks,

John

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-02-11 16:36

if you found the dev docs in Wiki you'll see an API Documentation link.. click GalleryCore package and then GalleryCoreApi and GalleryModule files will be of most interest. there's also a g2 dev starter kit link there.
but here's why it's easy.. make your own directory under modules and copy modules/cart/module.inc there.. change the classname and id and you've got an installable module that does the basic interaction with G2 that you'll need!
- "add to cart" link for items
- system content block to show some info about cart contents in sidebar
- event handler so if a gallery item is deleted you can remove it from all carts
Now you just need to change those methods (getItemLinks, loadSystemContent, handleEvent) to work with the cart system you'd like to use.
AussieJohn, please start a new topic in the G2 dev forum and we'll continue to provide assistance to get you going...