cdfcool Posted April 20, 2009 Posted April 20, 2009 Hi Friends, i have a small problem with the global maximum weight for shippings, because our carrier has different max. weights for several countries. I made an additional field in the countries-table called country_max_weight. In the ....classes/shipping.php there is a splitting function for packets bigger than the max weight, but this global function is unusual for me. Now i need help to read out the database-field in that file and use it instead of the global maximum weight. This would allow to calculate correct shippings to all countries with their individual max weights that our carrier will handle.... the way to calculate looks like this: if ($shipping_weight > $country_max_weight) { // Split into many boxes $shipping_num_boxes = ceil($shipping_weight/$country_max_weight); $shipping_weight = $shipping_weight/$shipping_num_boxes; } Can somebody explain me the way to read out the database-field ad give the value to the $country_max_weight? Perfect would be, if the customer´s country would match with it´s maximum weight in the table.... ;-)
Daemonj Posted April 21, 2009 Posted April 21, 2009 You will need to query the countries table to obtain the destination countries max shipping weight. Then assign that value to the $country_max_weight. "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
cdfcool Posted April 21, 2009 Author Posted April 21, 2009 You will need to query the countries table to obtain the destination countries max shipping weight. Then assign that value to the $country_max_weight. Hi Jim, can you explain me how? Can this be done in the .../shipping.php only or is it neccessary to do this in more files than that one? My PHP-Knowhow is very poor, so i need really help here. I´ve found out how to make the additional fields and the in- and output there, but at that point my way has ended here. :blink:
cdfcool Posted April 25, 2009 Author Posted April 25, 2009 Nobody? Sorry, it´s very urgent to solve this problem, but i´m too stupid to do it :-(
Recommended Posts
Archived
This topic is now archived and is closed to further replies.