Re: Handling Fee as Percentage?
Well thank you so much for your time !!! I really do appreciate the help.....I'm stumped here!
If I take the code out that does the 1.75 and just add the 1.75 into the shipping module under admin/module/shipping, usps, it shows it either logged in or not, I just cant add the 3% like I wanted... but took it out of the code.......can't show one price in the estimator then they log in and see a higher fee....would run them off...........
ugggghhh...I'll keep searching, if I find anything I'll post so that maybe it can help someone else if they have the same issue.
Thanks again!
Re: Handling Fee as Percentage?
Try this code instead and see if it works for both your shipping_estimator and the checkout_shipping ...
Code:
global $cart;
$chk_cart_total = $_SESSION['cart']->show_total();
echo 'Cart total: ' . $chk_cart_total . ' Cost: ' . $cost . ' Extra: ' . ($chk_cart_total * .03 + 1.75) . ' = ' . (($chk_cart_total * .03 + 1.75) + $cost) . '<br>';
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + ($chk_cart_total * .03 + 1.75) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? $usps_handling_fee * $shipping_num_boxes : $usps_handling_fee) );
Re: Handling Fee as Percentage?
WWAAAAAAAAAHOOOOOOOOOOO !!!!!! :clap:
It works!
Thank you so very much for your time helping me figure this out !!!! I am so very grateful. Couldn't have done it without you.
Re: Handling Fee as Percentage?
Thanks for the update that this works for you ... :smile:
Re: Handling Fee as Percentage?
Hi, I'm trying to do this with 1.5.1 UPS module. I need to add 15% handling fee to the UPS fee estimate.
The solution proposed here seems like what I need: http://www.zen-cart.com/showthread.p...868#post392868
but the shipping module appears different in 1.5.1. I can't find the exact code they replaced. I did find something on line 269 that seems like the place it needs to be changed, but the code they used in the example above doesn't work.
Any ideas?
Re: Handling Fee as Percentage?
Are you wanting the handling fee to be 15% of the Order Total or 15% of the Shipping Cost?
Re: Handling Fee as Percentage?
Hi thanks for replying. 15% of the shipping cost.
Re: Handling Fee as Percentage?
To make handling 15% of the shipping cost, you can customize the UPS shipping file:
/includes/shipping/ups.php
with the code:
Code:
// EOF: UPS USPS
$cost = preg_replace('/[^0-9.]/', '', $cost);
$new_handling = $cost * .15;
$methods[] = array('id' => $type,
'title' => $this->types[$type],
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? $new_handling * $shipping_num_boxes : $new_handling) );
Re: Handling Fee as Percentage?
The code is a little different than the code you have here, I wonder if it is because my UPS module file is UPSXML.php instead of UPS.php? How can I get the UPS.php module? I don't know why I ended up with this one.
Re: Handling Fee as Percentage?
Ok, never mind, I found the ups.php module. I was also able to find and change the code. The prices I'm getting from the 2 different modules are different though, even with the 15% factored in. I wonder which is more accurate? Seems like the regular UPS module is giving me higher price quotes.