Thread: Shopping cart

Shopping cart

From
"Andrus"
Date:
I'm looking for a open source PHP or C#/mod_modo/Apache shopping chart.

PostgreSQL database should contain items and item pictures or pictures
should stored in separate files.

User can pick items, enter quantities and send order which is stored in
database.

Any idea where to find source code for this ?

Andrus.


Re: Shopping cart

From
Ivan Sergio Borgonovo
Date:
On Wed, 22 Oct 2008 12:22:21 +0300
"Andrus" <kobruleht2@hot.ee> wrote:

> I'm looking for a open source PHP or C#/mod_modo/Apache shopping
> chart.
>
> PostgreSQL database should contain items and item pictures or
> pictures should stored in separate files.
>
> User can pick items, enter quantities and send order which is
> stored in database.
>
> Any idea where to find source code for this ?

I'm writing one especially based on postgresql but I'm still busy
with the current client to put the source in such a shape that could
be publicly published.

The ones I'm aware of are Zen Cart, OSCommerce, Ubercart and
Ecommerce (last 2 for drupal).
I think they *may* work with postgresql as well.

I think that anyway most of the popular prepackaged solutions don't
support transactions in the DB.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


Re: Shopping cart

From
Thomas Guettler
Date:
Hi,

http://www.satchmoproject.com/

But it is written in python. Not PHP or C#.

  Thomas

Andrus schrieb:
> I'm looking for a open source PHP or C#/mod_modo/Apache shopping chart.
>
> PostgreSQL database should contain items and item pictures or pictures
> should stored in separate files.
>
> User can pick items, enter quantities and send order which is stored
> in database.
>
> Any idea where to find source code for this ?
>
> Andrus.
>



--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


Re: Shopping cart

From
"Andrus"
Date:
Thomas,

> http://www.satchmoproject.com/
>
> But it is written in python. Not PHP or C#.

Thank you.
Unfortunately for me it seems that learning another language, Python +
Django to support shopping cart is too much.

Where to find Visual FoxPro, PHP or C#/mod_mono scripts for this?
Those languages are widely used and must also contain such common thing.

I have looked some PHP source code archives without success yet.

Andrus.


Re: Shopping cart

From
"Grzegorz Jaśkiewicz"
Date:

you'll have problems finding anything like that, mainly because people usually write that stuff themselves. So just that python or whatever code as an example, and write your own lib. You might actually learn something while doing it too. 

Re: Shopping cart

From
"Andrus"
Date:
Ivan,

Thank you.

> I'm writing one especially based on postgresql but I'm still busy
> with the current client to put the source in such a shape that could
> be publicly published.

What language are you using ?

> The ones I'm aware of are Zen Cart, OSCommerce, Ubercart and
> Ecommerce (last 2 for drupal).
> I think they *may* work with postgresql as well.

I studied their webpages.

1. Zen Cart - GPL license, php, mysql
Seems to have lot of modules and users. Fresh updates.
Installation manual in their web site wrote that it is for MySql only.
Site search for PostgreSQL returns no results.

2. OSCommerce - GPL license, php, mysql. Last change in Jan
2008, 2 releases per year.

Search for Postgres/PostgreSQL in doc does not return results.

3. Ubercart + Drupal  GPL license. Drupal developers accept patches for
PostgreSQL but do not support it.
Ubercart seems to be developed by single company which migrated from
OSCommerce. Fresh updates.
Forums contain some messageas about Ubercart usege with PostgreSQL.

4. Ecommerce   http://www.drupalecommerce.org/
Site contains few information, most pages redirect to drupal page.
Last update was 30 May
Seems to be incomplete and not finished.

So the only way is to use Ubercart + Drupal, right ?

> I think that anyway most of the popular prepackaged solutions don't
> support transactions in the DB.

Probably I do'nt need transactions.

Andrus.

Re: Shopping cart

From
justin
Date:
Andrus wrote:
> Thomas,
>
>> http://www.satchmoproject.com/
>>
>> But it is written in python. Not PHP or C#.
>
> Thank you.
> Unfortunately for me it seems that learning another language, Python +
> Django to support shopping cart is too much.
>
> Where to find Visual FoxPro, PHP or C#/mod_mono scripts for this?
> Those languages are widely used and must also contain such common thing.
>
> I have looked some PHP source code archives without success yet.
>
> Andrus.
If you are looking for Visual Foxpro and C# shopping carts  take a look
at www.west-wind.com

its not free code but its not a ripe off prices you normally see a few
hundred bucks for the source code
Also has a C# version in .net 2.0 and 1.1

plus it uses ODBC so it will work pretty much work with any database
draw back is windows only and IIS.  some people have gotten Apache to
work with Foxpro version

Re: Shopping cart

From
"Jonathan Bond-Caron"
Date:
On Wed Oct 22 07:01 AM, Andrus wrote:
>
> I have looked some PHP source code archives without success yet.
>

For PHP, your best option is http://www.magentocommerce.com/ --
http://svn.magentocommerce.com/source/branches/1.1

I've never used it but it's 'clean' code with commercial backing.




Re: Shopping cart

From
"Andrus"
Date:
Jonathan,

Thank you.

> For PHP, your best option is http://www.magentocommerce.com/ --
> http://svn.magentocommerce.com/source/branches/1.1

Magento is only for MySql.

My shopping cart must get products and add orders to existing PostgreSQL
database.
So I must re-write some parts of any shopping cart.

Only shopping cart which has PostgreSql support seems to be Drupal module
Ubercart  (http://www.ubercart.org/)
pointed by Ivan.
Amout of work adding existing PostgrSql database support to MySql or
PostgreSql cart PHP code is probably not much different.
However all other solutions require hosting separate MySql database which
probably increases support cost a lot.

So is'nt it best to use Drupal+Ubercart ?

Andrus.


Re: Shopping cart

From
Ivan Sergio Borgonovo
Date:
On Wed, 22 Oct 2008 15:42:48 +0300
"Andrus" <kobruleht2@hot.ee> wrote:

> > I think that anyway most of the popular prepackaged solutions
> > don't support transactions in the DB.

> Probably I do'nt need transactions.

You don't need transactions as much as you don't need a database
since you can work on flat file... but they are definitively comfort
when you've to keep your data coherent.

eg. what if a customer changes its order while it is closing it?

Surely you could add constraints and checks in your application...
but the DB seems a better place where to check if the data you're
storing are coherent.

As up to my knowledge Ubercart uses the workflow module to check
"constraints", but it doesn't exploit the features of the DB.

I'd say that a drupal cart will "mostly" work with PostgreSQL and
the changes you'll have to do to make it works may be minimal... but
somehow core is more DB friendly than most modules so you may have
some surprises.

Still no popular Free cart I know rely on DB coherency features
especially the ones written in PHP.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


Re: Shopping cart

From
"Jonathan Bond-Caron"
Date:
On Wed Oct 22 10:16 AM, Andrus wrote:
> Jonathan,
>
> Thank you.
>
>> For PHP, your best option is http://www.magentocommerce.com/ --
>> http://svn.magentocommerce.com/source/branches/1.1
>
> Magento is only for MySql.

Wow that's too bad/sad for the mySQL only. At least they are using innoDB.

> My shopping cart must get products and add orders to existing
> PostgreSQL database.
> So I must re-write some parts of any shopping cart.
>
> Only shopping cart which has PostgreSql support seems to be Drupal
> module Ubercart  (http://www.ubercart.org/) pointed by Ivan.
> Amout of work adding existing PostgrSql database support to MySql or
> PostgreSql cart PHP code is probably not much different.
> However all other solutions require hosting separate MySql database
> which probably increases support cost a lot.
>
> So is'nt it best to use Drupal+Ubercart ?

I'm not sure / have not used either. Magento seems to use Zend_Db as the
database abstraction so it seems like a matter of porting the schema.

Ubercart does look simpler, go whatever you find more interesting or faster
to do.

If there's no time constraints, I'd do as someone mentioned and build it
yourself. Open source or even commercial e-commerce solutions tend to get
very complicated in trying to be 'flexible'.

i.e.
CREATE TABLE shopping_carts
(
  carts_id serial NOT NULL,
  carts_date_created timestamp without time zone NOT NULL,
  carts_date_updated timestamp without time zone NOT NULL,
  carts_subtotal numeric(9,4) NOT NULL,
  carts_total numeric(9,4) NOT NULL,
  carts_tax1 numeric(9,4),
  carts_tax2 numeric(9,4),
  CONSTRAINT shopping_carts_pkey PRIMARY KEY (carts_id)
)
WITHOUT OIDS;

CREATE TABLE shopping_carts_products
(
  products_id serial NOT NULL,
  products_code character varying(64) NOT NULL,
  products_name character varying(100) NOT NULL,
  products_description character varying(1024),
  products_date_added timestamp without time zone NOT NULL,
  products_date_modified timestamp without time zone NOT NULL,
  products_taxable boolean NOT NULL DEFAULT true,
  products_qty double precision NOT NULL,
  products_price numeric(9,5) NOT NULL,
  shopping_carts_id integer NOT NULL,
  shopping_carts_pos smallint NOT NULL,
  CONSTRAINT shopping_carts_products_pkey PRIMARY KEY (products_id),
  CONSTRAINT shopping_carts_products_shopping_carts_id_fkey FOREIGN KEY
(shopping_carts_id)
      REFERENCES shopping_carts (carts_id) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE CASCADE,
  CONSTRAINT shopping_carts_products_products_code_key UNIQUE
(products_code)
)
WITHOUT OIDS;

CREATE TABLE products
(
  products_id serial NOT NULL,
  products_code character varying(64) NOT NULL,
  products_name character varying(100) NOT NULL,
  products_description character varying(1024),
  products_status int,
...
)
WITHOUT OIDS;

Displaying products and adding to a shopping cart is not much work, but the
product *management* and analytics / reporting will eat your time.

Best of luck!


Re: Shopping cart

From
"Andrus"
Date:
> I'm not sure / have not used either. Magento seems to use Zend_Db as the
> database abstraction so it seems like a matter of porting the schema.
> Ubercart does look simpler, go whatever you find more interesting or
> faster
> to do.

This is interesting.
If it better to modify Magento or Zend Cart (which seems to be more
powerful) by adding  PostgreSQL support or modify Ubercart which has already
PostgreSql support?
There was Google summer of code project proposal in this year of adding
Magento modules to Drupal but I havent found any information about its
results.

> If there's no time constraints, I'd do as someone mentioned and build it
> yourself. Open source or even commercial e-commerce solutions tend to get
> very complicated in trying to be 'flexible'.

I'm a programmer. Yes, I can create great application code.
Building shopping cart requires web design skills to create nice layout.
I do'nt have design skills. I can create ugly-looking cart  application.

So it seems better to me to get some ready layout so that only program logic
can replaced.

How to use some other layout template with PostgreSQL to create nice cart ?

> Displaying products and adding to a shopping cart is not much work, but
> the
> product *management* and analytics / reporting will eat your time.

Cart application must write order to existing database.
There are existing reports which take order data from this database.
So I'm mostly interested on creating nice layout.

Andrus.


Re: Shopping cart

From
Aarni
Date:
On Wednesday 22 October 2008 18:39:53 Jonathan Bond-Caron wrote:
>
> If there's no time constraints, I'd do as someone mentioned and build it
> yourself. Open source or even commercial e-commerce solutions tend to get
> very complicated in trying to be 'flexible'.
>
> i.e.
> CREATE TABLE shopping_carts
> (
>   carts_id serial NOT NULL,
>   carts_date_created timestamp without time zone NOT NULL,
>   carts_date_updated timestamp without time zone NOT NULL,
>   carts_subtotal numeric(9,4) NOT NULL,
>   carts_total numeric(9,4) NOT NULL,
>   carts_tax1 numeric(9,4),
>   carts_tax2 numeric(9,4),
>   CONSTRAINT shopping_carts_pkey PRIMARY KEY (carts_id)
> )
> WITHOUT OIDS;
>
> CREATE TABLE shopping_carts_products
> (
>   products_id serial NOT NULL,
>   products_code character varying(64) NOT NULL,
>   products_name character varying(100) NOT NULL,
>   products_description character varying(1024),
>   products_date_added timestamp without time zone NOT NULL,
>   products_date_modified timestamp without time zone NOT NULL,
>   products_taxable boolean NOT NULL DEFAULT true,
>   products_qty double precision NOT NULL,
>   products_price numeric(9,5) NOT NULL,
>   shopping_carts_id integer NOT NULL,
>   shopping_carts_pos smallint NOT NULL,
>   CONSTRAINT shopping_carts_products_pkey PRIMARY KEY (products_id),
>   CONSTRAINT shopping_carts_products_shopping_carts_id_fkey FOREIGN KEY
> (shopping_carts_id)
>       REFERENCES shopping_carts (carts_id) MATCH SIMPLE
>       ON UPDATE CASCADE ON DELETE CASCADE,
>   CONSTRAINT shopping_carts_products_products_code_key UNIQUE
> (products_code)
> )
> WITHOUT OIDS;
>
> CREATE TABLE products
> (
>   products_id serial NOT NULL,
>   products_code character varying(64) NOT NULL,
>   products_name character varying(100) NOT NULL,
>   products_description character varying(1024),
>   products_status int,
> ...
> )
> WITHOUT OIDS;
>
> Displaying products and adding to a shopping cart is not much work, but the
> product *management* and analytics / reporting will eat your time.
>
> Best of luck!

I agree with Jonathan and Grzegorz , you learn a lot doing it yourself and can
have all (and just) the functionality you need.

Cart system we built with linux / Pg / ColdFusion / Apache has a bit more
complex table structure than the above. Here's for the products (not in full
but to give an idea).

maincategories:
maincategory_id SERIAL PRIMARY KEY NOT NULL
mc_maincategory_name text NOT NULL
mc_maincategory_descr text
mc_maincategory_pic text
mc_published boolean
...

categories:
category_id SERIAL PRIMARY KEY NOT NULL
c_maincategory_id integer
c_category_name text NOT NULL
c_category_descr text
c_category_pic text
c_published boolean
...
"categories_c_maincategory_id_fkey" FOREIGN KEY (c_maincategory_id) REFERENCES
maincategories(maincategory_id) ON UPDATE CASCADE ON DELETE RESTRICT

subcategories:
subcategory_id SERIAL PRIMARY KEY NOT NULL
sc_maincategory_id integer
sc_category_id integer
sc_subcategory_name text NOT NULL
sc_subcategory_descr text
sc_subcategory_pic text
sc_published boolean
...
 "subcategories_sc_maincategory_id_fkey" FOREIGN KEY (sc_maincategory_id)
REFERENCES maincategories(maincategory_id) ON UPDATE CASCADE ON DELETE
RESTRICT
    "subcategories_sc_category_id_fkey" FOREIGN KEY (sc_category_id)
REFERENCES categories(category_id) ON UPDATE CASCADE ON DELETE RESTRICT

products:
product_id  SERIAL PRIMARY KEY NOT NULL
p_maincategory_id integer NOT NULL
p_category_id integer NOT NULL
p_subcategory_id integer
p_manufacturer_id integer NOT NULL
p_supplier_id integer NOT NULL
p_product_name text NOT NULL
p_product_code text NOT NULL
p_product_descr text
p_product_pic text
p_published boolean
...
 "products_p_category_id_fkey" FOREIGN KEY (p_category_id) REFERENCES
categories(category_id) ON UPDATE CASCADE ON DELETE RESTRICT
    "products_p_subcategory_id_fkey" FOREIGN KEY (p_subcategory_id) REFERENCES
subcategories(subcategory_id) ON UPDATE CASCADE ON DELETE RESTRICT
    "products_p_manufacturer_id_fkey" FOREIGN KEY (p_manufacturer_id)
REFERENCES manufacturers(manufacturer_id) ON UPDATE CASCADE ON DELETE RESTRICT
"products_p_supplier_id_fkey" FOREIGN KEY (p_supplier_id) REFERENCES
suppliers(supplier_id) ON UPDATE CASCADE ON DELETE RESTRICT

This way you can sort and display the products by maincats, cats and subcats
in the actual webshop. A product must belong to a main category and a category
under that main category, sub category under a category is optional. You would
of course have much more info in the products table: taxes, added, modified,
stock amount, next shipment, and what have you ...

Then add tables for orders, order rows, customers, delivery methods, payment
methods, suppliers, manufacturers, order statuses, taxes, maybe temp tables
for automatic updates from suppliers ...

As Jonathan said, the trick is not in getting the shop online but in the
management side of it all. The public shop interface is in fact only a small
proportion of the system.

Anyway, we did not use cart tables. The web application stores cart
information in session cookies until the point the order is finished and
approved and is then written to customers, orders and order rows. Two cookies,
or a cookie pair, one for the product id and one for the amounts. E.g. a
cookie for products "1,234,3472,555" and a cookie for amounts "2,1,1,3" means
you have 2 pcs of product id 1, 1 pcs product id 234 and so on.

And as mentioned, you have the freedom to choose your preferred API, be it
php, python, perl or what ever.

Please (Andrus) have a look at the shop, LinuxShop, in action at

http://www.linuxkauppa.fi/

It is in finnish but I think you will get the hang of it with no problems.
LinuxPood / LinuxKauplus, a web shop for linux compatible hardware.

With very best regards,

Aarni

--

Burglars usually come in through your windows.

Re: Shopping cart

From
Thomas Guettler
Date:
Aarni schrieb:
> As Jonathan said, the trick is not in getting the shop online but in the
> management side of it all. The public shop interface is in fact only a small
> proportion of the system.
>

Hi,

I know the OP wants to stick to a language he knows, but with django
(Python),
you have a quite good admin site.

I guess the OP would be more fast with django, even if he needs to learn
python on his way.

Andrus> Probably I do'nt need transactions.

But you don't want to waste several hours repairing a database which is
not consistent. (http://en.wikipedia.org/wiki/Database_transaction)

 HTH,
  Thomas

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


Re: Shopping cart

From
"Andrus"
Date:
Thank you.

> I know the OP wants to stick to a language he knows, but with django
> (Python),
> you have a quite good admin site.
>
> I guess the OP would be more fast with django, even if he needs to learn
> python on his way.

Major stopper for python usage is lack of hosting.
Where to find free hosting for this python cart ?
Will it support PostgreSQL well ?

Andrus.

Re: Shopping cart

From
Thomas Guettler
Date:
Andrus schrieb:
> Thank you.
>
>> I know the OP wants to stick to a language he knows, but with django
>> (Python),
>> you have a quite good admin site.
>>
>> I guess the OP would be more fast with django, even if he needs to learn
>> python on his way.
>
> Major stopper for python usage is lack of hosting.
> Where to find free hosting for this python cart ?
> Will it support PostgreSQL well ?
>
if you don't need postgres: google app engine.

But I guess you won't get free hosting with postgres support anywhere.

There are a lot of django friendly hosting companies:
  http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts

And a virtual root server does not cost much.

 Thomas

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de