7 Replies - 482 Views - Last Post: 04 October 2017 - 01:49 AM

#1 procreagency  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-October 17

Ecommerce conception

Posted 03 October 2017 - 12:12 PM

Hello,
i want create E-commerce web site with variable products, i mean:
if i add a product X, this product have an attribute of variation and the price of this product X is related with the attribut.
Example:

Product X1 have attribut weight i can setup this:
1/ weight=0.5kg ==> price=2euro
2/ weight=1kg ==> price=3euro

Product X2 have attribut size & type can setup this:
1/ size=0.5m & type=t1 ==> price=10euro
2/ size=0.5m & type=t2 ==> price=13euro
2/ size=1.5m & type=t1 ==> price=11.5euro

i hope my idea is clear..
My question how i can set this on mysql DB , how will be the conception? (attribut are dynamique ,admin choose list attributs and set price)

Is This A Good Question/Topic? 0
  • +

Replies To: Ecommerce conception

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13567
  • View blog
  • Posts: 54,133
  • Joined: 12-June 08

Re: Ecommerce conception

Posted 03 October 2017 - 12:25 PM

I would imagine the table would be a" product ID, ID, attribute ID, value, ID to rule it is chained too, and price.
Was This Post Helpful? 0
  • +
  • -

#3 procreagency  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-October 17

Re: Ecommerce conception

Posted 03 October 2017 - 12:54 PM

this if price related with one attribut! if i need multiple attribut?!
Was This Post Helpful? 0
  • +
  • -

#4 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2343
  • View blog
  • Posts: 9,400
  • Joined: 03-December 12

Re: Ecommerce conception

Posted 03 October 2017 - 01:36 PM

I would wonder why you were not using a platform designed with this in mind.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13567
  • View blog
  • Posts: 54,133
  • Joined: 12-June 08

Re: Ecommerce conception

Posted 03 October 2017 - 01:42 PM

That's the whole idea with the 'ID to chain it to another row'.

Use that as a look up for the same table, but different row, to pull that attribute.
Was This Post Helpful? 0
  • +
  • -

#6 procreagency  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-October 17

Re: Ecommerce conception

Posted 03 October 2017 - 01:48 PM

i not unterstand you!
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13567
  • View blog
  • Posts: 54,133
  • Joined: 12-June 08

Re: Ecommerce conception

Posted 03 October 2017 - 01:52 PM

My thinking is break this into two rows.
1/ size=0.5m & type=t1 ==> price=10euro

Row 1: 1/ size=0.5m
Row 2: type=t1 ==> price=10euro

From the 'chain_id' I can use that to join back on teh table to get row ID #2.
ID	ITEMID	ATTR_ID		CHAIN_ID	PRICE
1		1		1		2			0
2		1		2		0			10




Was This Post Helpful? 0
  • +
  • -

#8 procreagency  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-October 17

Re: Ecommerce conception

Posted 04 October 2017 - 01:49 AM

thanks for help i will do a test with this solution
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1