psyphris Posted May 5, 2010 Share Posted May 5, 2010 Hey Everyone, I did some searching and couldn't find the answer to my question. I just installed Individual Product Shipping Prices 1.0 and it is working great. I would like to modify the shipping calculator so that it uses the most expensive base price and then the additional price for the rest of the items. Example: Currently Happening: Shoes ship @ 9.99 for first item, 4.99 for each additional, shirts ship @ 3.99 and 1.99/additional 2 x Nike = 9.99 + 4.99 2 x Shirt = 3.99 + 1.99 Total Shipping = 20.96 What I want to happen: 2 x Nike = 9.99 + 4.99 2 x Shirt = 1.99 + 1.99 Total Shipping = 18.96 Basically, it will use the most expensive base price and then every other item will be included at their additional price. Is there anyone out there that knows a way to do this? Thanks! Quote Link to comment Share on other sites More sharing options...
psyphris Posted May 5, 2010 Author Share Posted May 5, 2010 Another thought, does anyone still use this module? It's working fine for me so far but is there a better one out there? Quote Link to comment Share on other sites More sharing options...
psyphris Posted May 6, 2010 Author Share Posted May 6, 2010 I had a similar request from a client and came up with the following. You need to change includes\classes\shipping.php module Insert only the code delimited by the // BB Start and // BB End, the other code should serve to indicate where in the file you need to add this - around about line 84(ish): //phpmom.com// find shiptotoal and indvcount(# of products with indv shipping// function get_shiptotal() { global $cart; $this->shiptotal = ''; $products = $cart->get_products(); // BB Start - Set first shipping price = second shipping price for all prods other than first prod with max shipping price - Start by determining index of max shipping price $maxship = '0'; $i_maxship = 0; for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (($products[$i]['products_ship_price']) > $maxship) { $maxship = ($products[$i]['products_ship_price']); $i_maxship = $i; } } // Here we set all ship prices to second ship price for entries other than the index determined above for ($i=0, $n=sizeof($products); $i<$n; $i++) { if ($i != $i_maxship) { $products[$i]['products_ship_price'] = $products[$i]['products_ship_price_two']; } } // BB End - Set first shipping price for ($i=0, $n=sizeof($products); $i<$n; $i++) { // mod indvship//modified hadir // if ($products[$i]['products_ship_price']) { $products_ship_price = $products[$i]['products_ship_price'];//} $products_ship_price_two = $products[$i]['products_ship_price_two']; $products_ship_zip = $products[$i]['products_ship_zip']; So I found this and tried to implement it but it doesn't seem to work. Is there anything that could have been changed in updates to prevent this from working? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.