CodeIgniter Forums
Setting up shipping tables - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Setting up shipping tables (/showthread.php?tid=26728)



Setting up shipping tables - El Forum - 01-21-2010

[eluser]megabyte[/eluser]
So I am looking for advice, a point in the right direction or a system to use.

I have built several custom shops, but this time the client wants to have shipping set up by:

country

and have prices for calculating by:

amount of order
total weight of order
percentage of order


Now at first glance it seemed like an easy thing to do, but how to organize it is where I am having troubles.


Do I go by country then by (amount. weight, percentage) or the reverse


also, they want to be able to over ride the shipping method on a per user account basis. This is also quite easy, its just planning how to organize the entire thing.

any help would be appreciated.


Setting up shipping tables - El Forum - 01-22-2010

[eluser]rogierb[/eluser]
If shipping is calculated by counry, you go by country. Not by weight or anything else. That you use an index on that column is a different story.

As for overriding, I would setup one table for the whole thing.

something like
who
who_id
amount
weight
percentage
etc...

Where who is a number that specifies who the record belongs to (company, user, default, the dog, whatever)
and who_id the ID belonging to who (again, company, user etc)