Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7

Thread: Shopping Cart

  1. #1
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    what convetions would I use to add products to a shopping cart... arrays?

    If so how do I write the product id to the array along with the quantity and store this in a variable
    Regards Phil,


  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    You're being scatterbrained on what you want. You'll first need to devise a way to store information about products, most likely in a database.

    One of our more recent projects at work was to implement a storefront. It's not as easy as you may think, at least if you want it done right and with some modularity.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    modularity isnt an issue as it will be me maintaining and ive got a prosucts and categorys database and scripts that get cats and products
    Regards Phil,


  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Modularity is always important, no matter what the script. There's a 99% chance you'll need to modify the script in the future.

    You should post the schemas for the database first to make sure it's properly structured. If the database is wrong, it's downhill from there. Aside from overall planning, I would argue that the database is the most crucial component of system development.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    schema for the products database

    Code:
    CREATE TABLE `ccart_products` (
      `id` int(4) NOT NULL auto_increment,
      `parentId` int(4) NOT NULL,
      `name` varchar(255) NOT NULL,
      `description` text NOT NULL,
      `stockId` varchar(25) NOT NULL,
      `price` decimal(10,2) NOT NULL,
      `productWeight` decimal(10,2) NOT NULL,
      `stockLevel` int(7) NOT NULL,
      `useStock` binary(1) NOT NULL,
      `productImage` varchar(255) NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
    schema for categories

    Code:
    CREATE TABLE `ccart_cats` (
      `id` int(4) NOT NULL auto_increment,
      `name` varchar(255) NOT NULL,
      `parentId` int(4) NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB  AUTO_INCREMENT=4 ;
    Regards Phil,


  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I wouldn't use MySQL, but at least the schema looks alright. I don't see a relation between categories and products, though.

    Have you set up foreign key relationships properly? Also, with int(4) for IDs, once you list your 9999th product, you can't list another one.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    foreighn key ralationships as in I use a where clause in my sql to filter out for a certain category.. and I just used int(4) as I wasnt sure how many proucts I was going to be needing.. so that value can be changed easily later on.

    and as far as mysql what would u recommened
    Regards Phil,



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:16 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com