lindsayanng Posted December 13, 2009 Posted December 13, 2009 I know that there are a million addons out there for processing shipping. We have a standard flate rate for anything in our store, so it's pretty easy. HOWEVER, we just did a christmas photoshoot and some of our orders have an expedite fee for anyone who might want their items to ship by XMAS. Unfortunately there is no way to add a second flate rate shipping.. So i was hoping for some suggestions on addons that will do this. Basically i just need a little radio button that says "CLICK HERE TO GET YOUR PRODUCT SHIPPED TO YOU BEFORE DEC. 24TH" and add a fee if that is clicked. and you know what would be even cooler?? If I could set the fee to ONLY pop up on certain products with certain attributes (we dont use products but attributes as the products).. So for instance, if someone order photo #3254 and the attribute is MUG, then the fee would be an option.. but if they ordered the same photo but the attribute is 5x7 print, the option would NOT pop up I just had a look at the OSC Gift wrap which would definitely work fir the simple way.. I'm thinking there HAS to be a way to create an if statement to only show if the product has a particular attribute added A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted December 13, 2009 Author Posted December 13, 2009 ok.. I installed the gift wrap addon and it's working pretty well with no problems.. There is definitely something very ODD though, and I was hoping to maybe get some help here. basically, the addon has two options "Add Gift wrap" and "no gift wrap" in the admin If you set the "add gift wrap" option only, then the person checking out is automatically charged the amount for wrapping and not given the opportunity to NOT chose it. There is no radio button!! So basically I have it set so give the person the option to choose Gift Wrap (which i have worded as "expedited shipping") ffor $18 and then I have "no expedited shipping" for $0.00 This is stupid even IF you were using it for gift wrap. It should be either you check the radio if you want it or ignore it if you don't.. Anyways.. I found out that if, when you first arrive on the page, you do not check either box, it allows you to go through the checkout and it just doesn't charge you the extra fee. THIS IS GREAT!!! Well, it would have been great if i could figure out how to delete the second row that has the $0.00 wording on it! I can't find it for the life of me!!!! So here is the code for the addon: <!--BOF osc_Giftwrap --> <?php if (tep_count_giftwrap_modules() > 0) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_GIFTWRAP_METHOD; ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php $quotes1_size = sizeof($quotes1); if ($quotes1_size > 1) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <tr> <td class="main" width="50%" valign="top" colspan="4"><?php echo TEXT_CHOOSE_GIFTWRAP_METHOD; ?></td></tr> </tr> <?php } else { ?> <tr> <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_GIFTWRAP_INFORMATION; ?></td> </tr> <?php } $radio_buttons = 0; for ($i=0; $i<$quotes1_size; $i++) { ?> <tr> <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if (isset($quotes1[$i]['error'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="3"><?php echo $quotes1[$i]['error']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } else { $size = sizeof($quotes1[$i]['methods']); for ($j=0, $n2=$size; $j<$n2; $j++) { // set the radio button to be checked if it is the method chosen $checked = (($quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) ? true : false); if ( ($quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) || (tep_count_giftwrap_modules() == (int)1) ) { echo ' <tr id="defaultSelectedGift" class="moduleRowSelected" onmouseover="rowOverEffectGift(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffectGift(this, ' . $radio_buttons . ')">' . "\n"; } else { echo ' <tr class="moduleRow" onmouseover="rowOverEffectGift(this)" onmouseout="rowOutEffectGift(this)" onclick="selectRowEffectGift(this, ' . $radio_buttons . ')">' . "\n"; } ?> <td class="main" width="75%"><?php echo $quotes1[$i]['methods'][$j]['title']; ?></td> <?php if ( ($quotes1_size > 1) || ($n2 > 1) ) { if (DISPLAY_PRICE_WITH_TAX == 'true') { $gift_tax_rate_tmp = tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS); $gift_tax_amt_tmp = $quotes1[$i]['methods'][$j]['cost']; $gift_tax_amt_tmp += tep_calculate_tax($quotes1[$i]['methods'][$j]['cost'], $gift_tax_rate_tmp); ?> <td class="main"><?php echo $currencies->format($gift_tax_amt_tmp); ?></td> <?php } else { ?> <td class="main"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']); ?></td> <?php } ?> <td class="main" align="right"><?php echo tep_draw_radio_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'], $checked); ?></td> <?php } else { ?> <td class="main" align="right" colspan="2"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']) . tep_draw_hidden_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id']); ?></td> <?php } ?> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php $radio_buttons++; } } ?> </table></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } ?> </table></td> </tr> </table></td> </tr> <?php } ?> <!--EOF osc_Giftwrap--> and you can use the shopping cart here: My link A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
Bryce F Posted December 13, 2009 Posted December 13, 2009 Well, it's hard to say what the problem is without more information or access to your code. Maybe this will help though: I've had to manually calculate the order total on several occasions. The amount that gets billed is calculated in includes/classes/order.php. At the bottom of the file, you'll see the actual order total calculation. You may want to verify what switch/variable is causing the wrapping fee to be added on, and then find where that variable is being set (Something like Grep or Windows Grep is great for finding keywords/variables in a large number of files). As for not displaying a order total field with 0.00... I've done this before on one of my custom payment modules. Find your module in includes/modules/order_total/giftwrap_whatever.php. Then have a look at my module to see how to remove zero-cost lines: if ($teacher == 1){ $this->output[] = array('title' => $this->title . ' ('. $this->rate*100 .'%):', 'text' => "- " . $currencies->format($order->info['subtotal']*($this->rate), true, $order->info['currency'], $order->info['currency_value']), 'value' => $order->info['subtotal']*($this->rate)); }else{ $this->output[] = array('title' => '', 'text' => '', 'value' => '0' ); } My module removed the field if the customer was flagged as a "teacher," but you could change the check condition to say something like... if ($order->info['giftwrap_fee'] > 0){ display stuff normally }else{ $this->output[] = array('title' => '', 'text' => '', 'value' => '0' ); } Hope it helps!
Ben Nevis Posted December 13, 2009 Posted December 13, 2009 It is actually possible to have two or more flat rate modules if you still want to go down that route. Although it's relatively simple to create them, there is even an addon for it: http:// http://addons.oscommerce.com/info/1724 www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!
lindsayanng Posted December 13, 2009 Author Posted December 13, 2009 Bryce, thanks for the help. That should be enough to get myself rolling. I was just going to try and remove the output. The addon itself is not really designed very well. It seems to be a lot of code and much where it's not needed.. just my opinion though. I was HOPING i could just remove the area where the HTML output is because i think if i remove the ability to show "no gift wrap" it will default back to not showing a radio button and just automatically adding the cost of the gift wrap to the order. I will play a little more, thanks for offering up what you have done - i appreciate it. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
burt Posted December 13, 2009 Posted December 13, 2009 If you look at the "low order fee" order_total module, you could use it (obviously amended slightly) to add an "expedite fee". Shouldn't be an awful lot of coding..
lindsayanng Posted December 13, 2009 Author Posted December 13, 2009 I thought about using the low order fee, but I didn't feel like trying to find the code that looks for the order total and makes it only show based on the value of the items in their cart. This fee has nothing to do with the value of the items in the cart. The gift wrap fee is pretty close to what I need.. its an option fee that people can tick a radio button if they want it.. Just like gift wrap. The only weird thing with this addon is that instead of just "tick box if you want it, or leave it blank if you dont' They created two radios - one for yes, one for no.. which makes NO SENSE even for gift wrap. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
burt Posted December 13, 2009 Posted December 13, 2009 "low order fee" order_total module, you could use it (obviously amended slightly) The "obviously amended slightly" bit is meant to tell you that the module will need a recode to do something other than it's usual calculation based on order value. If you can avoid using a 3rd party contribution, you should do so. What I am talking about is possibly 10 extra lines of code; 1. add a checkbox on the shipping page [ ] expedite this order, extra $2.99 2. set a session if that is ticked 3. if session is active, use the order_total module to add in the $2.99 [or whatever] fee Rock and Roll.
lindsayanng Posted December 13, 2009 Author Posted December 13, 2009 yea.. but like i did need this done kind of last minute. We had done a shoot yesterday, and we wanted to get the pictures up ASAP. Once we got the pictures up, we realized that people are going to want them by XMAS, but because our vendors charge an expedite fee, we need to charge one as well as to not loose money on the deal. ANYWAYS, i needed something last minute and I had thought about (and looked at) the low order fee.. I figured out what I needed and played with it, but it wasn't goign to happen for me last night.. Instead I found any random contribution that does what I need it to kind of out of the box. The only change i need is more for cosmetic and less for usability. I REALLY just need to remove one little area of the output to make it look the way I wanted. In the future, i will work on the low order fee so that next XMAS I will have something more "standard" but i can't worry about that now. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
burt Posted December 13, 2009 Posted December 13, 2009 It should not take -you- more than 60 minutes to code it from scratch. You know enough not to have to rely on contributions.
Bryce F Posted December 14, 2009 Posted December 14, 2009 The only change i need is more for cosmetic and less for usability. I REALLY just need to remove one little area of the output to make it look the way I wanted. In the future, i will work on the low order fee so that next XMAS I will have something more "standard" but i can't worry about that now. So did you get this all sorted out and working? All outputs of these kinds of modules will appear in their respective $this->output[] arrays. You can just modify the output array directly from your includes/modules/order_total/my_module.php file. And in the file you pasted to us at the beginning you may want to change the line: <?php echo tep_draw_radio_field('giftwrap', $quotes1[$i]['id']...blah...blah to read: <?php echo tep_draw_checkbox('giftwrap', $quotes1[$i]['id']... ...and then do a bit of error checking to see what causes the extra shipping to trigger as I'd mentioned above. Good luck.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.