Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HOW-TO: add radio buttons at checkout_shipping


TerryK

Recommended Posts

I will work on this for you when I get some time. I just got hired to build a large SQL database running web site for a local company (using osC) and need to start on that. I really need the money right now like real bad.

 

I will also work on turning it into a contribution in Terry K's name of course.

 

I have a BIG suggestion for this...

I just lost a sale because a customer was going through checkout and seen the backorder box on the shipping option screen and canceled his order. The order is still in the Recover Carts section.

 

He sent an e-mail wanting to know when the item he was ordering will be back in stock or if it was in stock. Looking at the site as a customer, I can see how the "typical" general public will think this.

 

So... This is what I thought of. IF there are items marked as being on backorder in the cart, then and only then print out the backorder instructions box. If everything in the cart has stock ( stock > 0 ) then do not display it at all or default to one of the options in the background.

 

What do you think? We all know how the "general public" is so you can see what I mean. This happened to me 2 days after installing this.

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Quick fix: Make a bolded colored font statement that occasionally some items may be out of stock. We have a brick-n-mortar store, and inventory control is not easy with nearly 10k products. Even if we had an inventory that was 100% accurate, it couldn't possibly account for when someone is walking around the store with an item, ready to go up to our checkout counter, and someone else browsing the shop has it in their osC shopping cart. You can't plan for that w/o tying into a very expensive system that detects when someone takes an item off the rack.

 

Try rewording things in big bright letters.

 

-jared

Link to comment
Share on other sites

  • 3 months later...

Update: I've been having an occasional problem that after updating some orders (inconsistent problems are the most annoying, don't you think?), the backorder instructions aren't displayed in the order any longer.

 

Here's what I did to fix it: in admin/orders.php, find this:

    $orders_history_backorder_query = tep_db_query("select backorders from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID). "'");

 

and change it to this:

    $orders_history_backorder_query = tep_db_query("select backorders from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID). "' and orders_status_id = 1");

 

Fixed it for me!

 

FWIW, I was seeing this problem mostly when customers had updated their own orders with my Customer Comments contrib.

 

-jared

Link to comment
Share on other sites

BTW,

 

Terry, did you ever make this into a contribution? If not, you should.  It's great!

 

-jared

 

Hmm, I have done the mods but the customers selected handling method doesnt appear in the order email, admin or in the databse for that matter. What could i have done wrong?

 

Any ideas?

Will

Link to comment
Share on other sites

Hmm, I have done the mods but the customers selected handling method doesnt appear in the order email, admin or in the databse for that matter. What could i have done wrong?

 

Any ideas?

Will

 

My mistake i found a typo. Thanks guys for a super contribution!

Will.

Link to comment
Share on other sites

  • 6 months later...

I looked for something that helped me to get a preorder functionality and this have helped me a lot. I do, however, have one little problem left. If the customer has choosed to split the shipment, how do I calculate the "correct" freight cost. I have come so far that I calcuate the correct cost for the first shipment but now I have to add the preorder-items.

The best thing would be that I go through every preorder item and add those to an array for the release date/available date and then calculate the weight and the price for each. The question is to have multiple shipments from one order with correct freight cost.

 

Anyone have something like this already done or have any tips for an contribution that will help me?

Link to comment
Share on other sites

  • 2 months later...
1. In database table ORDERS_STATUS_HISTORY, add a new field via PHPmyAdmin:

 

FIELD: backorders

TYPE: text

ATTRIBUTES: (leave blank)

NULL: No

DEFAULT: (leave blank)

EXTRA: (leave blank)

2. In catalog/checkout_shipping.php, look for:

 

 

I am really sorry if this is the ultimate stupid question, but what exactly is the query I must add? I tried to do it and corrupted my entire database (thank goodness for neurotic backing-up!)

 

This contribution seems amazing for what I need and I'd really appreciate the help in getting it going.

 

Thanks in advance.

Link to comment
Share on other sites

I am really sorry if this is the ultimate stupid question, but what exactly is the query I must add? I tried to do it and corrupted my entire database (thank goodness for neurotic backing-up!)

 

This contribution seems amazing for what I need and I'd really appreciate the help in getting it going.

 

Thanks in advance.

 

I finally figured it out and learned a bit more about working with phpmyadmin.

Link to comment
Share on other sites

Here is an example of the code to only show the Backorder Options ... if there is a product in the customers order that is out of stock.

 

If there are no out of stock products ... the table is not shown.

 

Note: You only need the stock check code at the top .. and don't forget to end the table with a }

Everything in my table code is custom so it will not work correctly for you .. so just use the stock check code.

 

 

<?php

}

// BEGIN backorder contrib

// Stock Check

$any_out_of_stock = false;

if (STOCK_CHECK == 'true') {

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {

$any_out_of_stock = true;

}

}

// Out of Stock

if ($any_out_of_stock == true) {

?>

 

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo HEADING_BACKORDERS; ?></b>

 

<script type="text/javascript">

<!--

if (!(document.getElementById) && !(document.all)) {

document.write("<b><span class=\"errorText\"><?php echo TEXT_BACKORDER_WARNING; ?></span>");

} else {

document.write("<span id=\"update_warning\" class=\"errorText\"> </span>");

}

//-->

</script>

<noscript>

<b><span class="errorText"><?php echo TEXT_BACKORDER_WARNING; ?></span></b>

</noscript>

</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">

<tr>

<td colspan="3" class="main" valign="top"><?php echo TEXT_BACKORDERS; ?>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<tr>

<td class="main">

<table border="0" width="95%" align="right" cellspacing="1" cellpadding="2">

<tr id="defaultSelected" class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">

<td width="90%" class="main" valign="top"><b><?php echo TEXT_HOLD_UNTIL_AVAILABLE; ?></b><br><?php echo HOLD; ?></td>

<td width="10%" class="main" align="center" valign="top"><?php echo tep_draw_radio_field('backorders', 'Hold order until all items are in stock.', 'UNCHECKED', 'onFocus="advisecustomer1();"'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">

<td width="90%" class="main" valign="top"><b><?php echo TEXT_SHIP_IN_STOCK; ?></b><br><?php echo SHIP; ?></td>

<td width="10%" class="main" align="center" valign="top"><?php echo tep_draw_radio_field('backorders', 'Ship in-stock items now and backordered items as available. Additional shipping charges may apply.', '', 'onFocus="advisecustomer2();"'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">

<td width="90%" class="main" valign="top"><b><?php echo TEXT_SHIP_ONLY_AVAILABLE; ?></b><br><?php echo CANCEL; ?></td>

<td width="10%" class="main" align="center" valign="top"><?php echo tep_draw_radio_field('backorders', 'Ship in-stock items and cancel any backordered items.', 'UNCHECKED', 'onFocus="advisecustomer3();"'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

 

</table></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

 

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

}

?>

<!-- END backorder contrib -->

Link to comment
Share on other sites

  • 2 weeks later...

I Have Used this Code And All Works Well. The Problem I Am Having Is That Now When a Customer Adds Two Or More items To There Cart And Checks Out Only The One Item Gets Loged So I Have To Call To Find Out The order So I Must Fix This Fast. Please Help If You Can. I Have No Clue Why This Is Happening But It Is Something In This Code Or The Way I Did It As It Was Fine Untill Last night When I Done This And Discovered It Today.

Link to comment
Share on other sites

This code would not effect your checkout in any way.

 

It only checks to see if any product in customers order is out of stock and has nothing to do with the checkout process.

 

You must have a problem elsewhere in your shop .. but to not get too far ahead of yourself you should remove the code until you figure out where the problem is. Than you can put the code back in.

 

It could possibly just be where you place the code in the file. Try placing it in a different spot and do a test order with an out of stock item and see if the item goes through.

Link to comment
Share on other sites

This code would not effect your checkout in any way.

 

It only checks to see if any product in customers order is out of stock and has nothing to do with the checkout process.

 

You must have a problem elsewhere in your shop .. but to not get too far ahead of yourself you should remove the code until you figure out where the problem is. Than you can put the code back in.

 

It could possibly just be where you place the code in the file. Try placing it in a different spot and do a test order with an out of stock item and see if the item goes through.

 

 

 

I Am Not Talking About The Last Bit Of Code On This Page I Am Talking About The First Part -- The Site Was Doing Fine And This Is The Only Thing I Have Done So I Must Have Did Something Wrong. Still Working On It And Thanks For The Reply.

Link to comment
Share on other sites

  • 2 weeks later...
I looked for something that helped me to get a preorder functionality and this have helped me a lot. I do, however, have one little problem left. If the customer has choosed to split the shipment, how do I calculate the "correct" freight cost. I have come so far that I calcuate the correct cost for the first shipment but now I have to add the preorder-items.

The best thing would be that I go through every preorder item and add those to an array for the release date/available date and then calculate the weight and the price for each. The question is to have multiple shipments from one order with correct freight cost.

 

Anyone have something like this already done or have any tips for an contribution that will help me?

 

The short answer to your question is that there isn't a "correct" way to split the freight costs. What you need to do is to set a policy for how you handle freight charges when the shipment is split up. Obviously, the calculations that osCommerce is capable of making may influence what your policy is. What good is a policy if osCommerce isn't able to present it correctly to the customer?

 

With my store, I assume that if an item is out-of-stock, its my fault, so I eat the additional cost of multiple shipments. Of course, you could also charge for two shipments (one of the in-stock items and one of the out-of-stock items), which will help you recover more of the shipping costs. Of course, if the out-of-stock items arrive in more than one shipment, do you wait until everything arrives? or ship in additional shipments and loose a bit of money?

 

Of course, this is part of a bigger issue that hasn't yet been resolved in osCommerce -- how to handle differences between how items ordered are handled. Its not just shipping charges, but how do you keep track of what has been shipped and what has not? What if the client later wants to cancel one backordered item but keep another? How do you later tell which items went in which shipments?

 

I'm afraid we need what's been asked for in other forums: an order status for each item in the order, not just for the whole order. [FWIW, I've offered to help pay for someone to make a contribution to do this, if anyone is interested.]

 

Perhaps we need a few other fields for the items on an order -- which shipment they are part of, for example. Until we get this in the database and basic coding for osCommerce, I think we won't be able to get to where we all want to.

Link to comment
Share on other sites

  • 8 months later...

Hi

I got the HOW-TO: add radio buttons at checkout_shipping just about working..

the only thing im having problems with is i cant seem to get the customers option to show up when i view the order

i see the Backorder instructions: but its not putting in there option they choosed.. can someone help me out

 

Thanks

Tom

dtpetsupplies.com

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Hi I am interested in using this but instead of radio boxes, I'm interested in using a drop-down menu. I was wondering if anyone knows how to code the actual dropdown boxes.

 

I'm going to be using it for Sales Rep references (or) how were you referred type of thing.

 

I need this to be passed on. I haven't started modifying it yet. Anyone know how to code it for a select box instead of radio boxes?

 

I think this is what I'm looking for. Thanks

 

-Dan

Link to comment
Share on other sites

  • 2 years later...

Hi can i use this for building a pickupday? not backorder but ill pickup (radiobutton's) * monday * thuesdag * wensday *etc

thx in advance greetz Edwin

Link to comment
Share on other sites

Hi can i use this for building a pickupday? not backorder but ill pickup (radiobutton's) * monday * thuesdag * wensday *etc

thx in advance greetz Edwin

 

wauw IT WORKS LIKE A CHARME!!!

 

your the best!!!!!

Link to comment
Share on other sites

Hi! I was reading through this topic and this is a great add-on/ idea, but for just 2.2. Can someone re-code this for 2.3? Your help would be greatly appreciated!

- Luc

My Installed Contributions:

1. Ultimate SEO URLs V 2-2.2d-X

2. Quantity Box on Product Info Page

3. httpbl4osc Version 1.1.0

4. QTpro for osc 2.3

5. Header Tags SEO V 3.0 (For 2.3)

6. DHTML State Selection for 2.3.1

And Good To Know:

I use a 960gs fluid style sheet.

I do have a honey pot on my website.

Store Version: 2.3

 

“Pain is temporary. Quitting lasts forever."

- Lance Armstrong

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...