Jump to content

Adding differenct size and price options to an online store database


BarneyJoe

Recommended Posts

Hope someone can help with this.

 

At the moment I have an online store all up and running that sells oriental rugs, but based on the assumption that each design is available at a single size and a single cost.

 

The site has an admin section where the site owner can add new designs using a fairly simple insert form, filling in various details including size and cost, which adds a new record in a simple 'Carpets' table.

 

What would be the best practice to add in the ability to specify different sizes, with different prices? I'm presuming I'm going to need at least one new table, ie split it out into Carpets and Carpet_Sizes perhaps?

 

Carpets

Carpet_ID

Design_Ref

etc

 

Sizes

Carpet_ID

Size

Price

 

With a query Carpet_Sizes :

 

Carpet_ID, Design_Ref, Size, Price

1, ABC1, 6x4, 599

1, ABC1, 2x3, 199

1, ABC1, 5x4, 399

2, ABC2, 6x4, 899

2, ABC2, 2x3, 599

3, ABC3, 5x4, 799

3, ABC3, 6x8, 999

 

What would be the easist way to allow the owner to add this info when adding new designs? Using checkboxes perhaps?

I'm kind of clear on the database structure, but less sure how to go about the page where the owner can add new designs.

 

At the moment it's a single field for size and price - what would be the best way to go about entering different sizes and prices for each design?

 

 

I'm away from the code at the moment, but will post later.

 

But it's basically a single table, carpets :

 

Carpet_ID (PK, Int)

Carpet_Ref

Description

etc

Price

Size

 

And the form is a basic, standard input form that adds a record to the carpets table with the values entered.

 

What I want to be able to do is allow the user to specify different Sizes with different Prices of each carpet design.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.