edschaum Posted October 19, 2002 Posted October 19, 2002 I use the UPS and USPS modules for shipping, and I've had some difficulty setting up the Gift Certificates so that the buyer does not incur a shipping charge. After playing around a bit, I came up with something that seems to work very well, so I thought I'd ask to see if what I'm doing is ok. The Goal: No shipping charge when someone buys (only) a gift certificate. I don't have table rate active, so I can't set up a 0 weight:0 cost shipping rate. Step one - Any item that I don't want to charge shipping for has a weight of Zero. All other products have a weight of at least 1. Step two - I went into checkout_payment.php and changed: <?php if (MODULE_SHIPPING_INSTALLED) { $shipping_modules->cheapest(); ?> to this: <?php if ((MODULE_SHIPPING_INSTALLED) && ($total_weight != 0)) { $shipping_modules->cheapest(); ?> This seems to not only prevent the display of the shipping options section when the weight is zero, it also prevents any shipping cost from being added to the total! If the weight is not zero, then the shipping options display and calculate as normal. If you're thinking about doing this, be very careful, I don't really know what I'm doing and this could have consequences that I'm not aware of. :shock: Ed
Ian Posted October 19, 2002 Posted October 19, 2002 Your right, For your particular circumstance this works. But others who say use table-price would not use this. The problem of shipping and Gift Vouchers is a common one. Your idea is of course great for any one using weight based shipping where they can set weights for all products. Well worth posting. If anyone has problems with shipping and other methods I do have hacks to fix. Trust me, I'm an Accountant.
edschaum Posted October 19, 2002 Author Posted October 19, 2002 Funny thing is, I thought I was going to have to add the table rate module in order to make this work. There's only one other thing needed to make it work with all(?) shippng methods...but I got stuck.. and it turned out that the one thing I did solved both problems for me. Anyway, if you have a table rate selection of 0:0, you can have zero shipping for zero pounds. And if I was using table rate, I think I would have been finshed, because it was working nicely - gift certificate table rate shipping was zero, and a one pound product would have a shipping cost of whatever I set it for (0:0,1:5,2:6,etc). I originally thought that if I added the table rate thing, I'd have to supress it when people made regular purchases, and I was trying to figure out how to keep the table rate from displaying under those conditions, but got hung up on one part. I realized that all I needed to do was to have shopping_cart.php simulate the output of checkout_address.php with the table rate box UNCHECKED, but I couldn't figure out how to do it :( I tried adding hidden form variables in shopping_cart.php but that didn't work either (it seems like shipping_quote_all and shipping_quote_table are the items that need to be manipulated. So for people using multiple shipping modules, it might be possible to suppress one or more shipping modules under certain conditions.
Ian Posted October 19, 2002 Posted October 19, 2002 Im a sense this arugument also applies to download products, and not just gift vouchers. Both are 'virtual' items, as far as shipping is concerned. The only way to have a truly generic solution would be if there was a way to flag this fact in the products details. Trust me, I'm an Accountant.
Guest Posted October 19, 2002 Posted October 19, 2002 Ian said Both are 'virtual' items, as far as shipping is concerned. The only way to have a truly generic solution would be if there was a way to flag this fact in the products details. Actually, I think that is a wonderful idea. A simple tick box in the product set up area that distinquishes "virtual" from "hard goods" and then there is no shipping for anything "virtual". Definately something to consider for the future.
xaraya Posted November 23, 2002 Posted November 23, 2002 I've set up gift certificates using Ian's Gift Voucher in his latest November loaded snapshot but cannot find the following code in checkout_payment.php from incurring a shipping charge for virtual items. I assume it no longer exists in the latest snapshot? Code: <?php if (MODULE_SHIPPING_INSTALLED) { $shipping_modules->cheapest(); ?> to this: Code: <?php if ((MODULE_SHIPPING_INSTALLED) && ($total_weight != 0)) { $shipping_modules->cheapest(); ?> I noticed Kim has gift certificates on her site http://www.bird-e-toys.com/osc/catalog/default.php Kim, how did you achieve selling gift certificates without adding shipping costs? I would be eternally greatful to find out :)
Guest Posted November 23, 2002 Posted November 23, 2002 Greg, I can't take credit for getting it to work, Ian made a special mod to make my shipping table work...What shipping method are you using? If you are using a weight based module you should be able to use a 0 weight has $0 cost. 0:0 as the first entry in your list. Hope this helps, if not get a hold of Ian.
xaraya Posted November 23, 2002 Posted November 23, 2002 I'm using UPS for shipping and have set shipping weight to 0. Thanks for the tip. I wonder if your module could be adapted to UPS... I think I'll give Ian a rest today... he's spent a bit of time helping some of us quite a bit lately :D
xaraya Posted November 23, 2002 Posted November 23, 2002 I'm using UPS for shipping and have set shipping weight to 0. Thanks for the tip. I wonder if your module could be adapted to UPS... I think I'll give Ian a rest today... he's spent a bit of time helping some of us quite a bit lately :D
xaraya Posted November 23, 2002 Posted November 23, 2002 sorry for the double post... the forum tripped out with some memory error. Must be getting pretty bandwidth intensive here :shock:
Guest Posted November 23, 2002 Posted November 23, 2002 I'll be glad to send you the code. You wanna' look at it?
Guest Posted December 6, 2002 Posted December 6, 2002 I think I have found the place to insert the code to bypass shipping on carts with only GV's. Hopefully I haven't duplicated anyone work :) On line 26 in checkout_payment.php // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } change to // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping') && ($cart->show_weight() > 0)) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } Thanks everyone
xaraya Posted December 6, 2002 Posted December 6, 2002 I can't believe the solution was this simple... I'll let you know if this works. Thank You :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.