Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Ship Complete vs Partial Ship option?

Ship Complete vs Partial Ship option?

Locked

Views: 8,716

Results 1 to 20 of 26
This thread is locked. New replies are disabled.
6 Nov 2008, 12:25 PM
#1
micmed avatar

micmed

Zen Follower

Join Date:
Mar 2008
Location:
The Free South
Posts:
165
Plugin Contributions:
0

Ship Complete vs Partial Ship option?

Anyone know how I could add an option on checkout to allow the customer to choose whether they want to "ship complete" or accept a partial shipment if some items are backordered?

theCableStation

18 Feb 2009, 9:08 PM
#2
micmed avatar

micmed

Zen Follower

Join Date:
Mar 2008
Location:
The Free South
Posts:
165
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Bump... Anyone?

22 Apr 2009, 1:04 PM
#3
micmed avatar

micmed

Zen Follower

Join Date:
Mar 2008
Location:
The Free South
Posts:
165
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Any ideas on this? Anyone? Hello?

23 Apr 2009, 8:07 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship Complete vs Partial Ship option?

You could use the comments for that or setup an additional comment/checkbox to be processed on the checkout ...

What method do you want to custom code for?

23 Apr 2009, 8:13 PM
#5
micmed avatar

micmed

Zen Follower

Join Date:
Mar 2008
Location:
The Free South
Posts:
165
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Ajeh, thanks for responding. I was hoping for a yes/no checkbox during checkout that would default to no.

I am kinda surprised that this has not been asked for by more ZC users.

Thanks

23 Apr 2009, 8:30 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship Complete vs Partial Ship option?

Well ... to customize this you can follow along with where the comment is managed and included in the order ...

You then want to add a checkbox vs the text area which is similar to the Confirmation for the checkout, which uses the constant:
DISPLAY_CONDITIONS_ON_CHECKOUT

But you want to store the results ... hence the tracing of the comment to get an idea of how to do that ...

31 Mar 2010, 5:07 PM
#7
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

I'm trying to do something exactly like this. Any idea where I might get started?

31 Mar 2010, 6:24 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship Complete vs Partial Ship option?

Go to the Tools ... Developers Tool Kit ... and in the bottom input box enter:
comment

and search the Catalog to see how the comment is managed ...

Then, search the Admin to see how it is managed there ...

9 Apr 2010, 2:20 PM
#9
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

I gave it a whirl, and I'm just not a php programmer. After about the hundredth blank page, I decided to give up on trying to program it myself. Any other ideas?

:lamo:

9 Apr 2010, 4:38 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship Complete vs Partial Ship option?

You can always hire someone to code this for you ... :cool:

27 Apr 2010, 4:17 PM
#11
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

So, I've continued to kick this issue around, and I have a couple of questions.

Into what file would I put this form? Would I code it like a normal HTML form, or is there some kind of "handler" for this? Something like the ```php

<?php echo zen_draw_textarea_field('comments', '45', '3'); ?>

If I could just get the blasted checkbox to show up I think I'd be good from there.  I'm at least familiar with the ```php
zen_db_prepare_input
``` command that prepares the following data for database insertion.

Finally...would I need to store this data into the $_SESSION superglobal?  I'm inclined to say yes, but I'm not sure.  Any help is appreciated.

I totally know that I'm in over my head.  Please be merciful.
27 Apr 2010, 5:24 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship Complete vs Partial Ship option?

What exactly are you trying to collect and where do you want to collect it?

27 Apr 2010, 5:35 PM
#13
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

AH HA! PROGRESS! I figured out which file I needed to edit for my form to appear! /template_default/tpl_checkout_shipping.php was the file I was looking for. Once I figured that out it was as simple as creating my form. Now.,..I gotta get the radio button data to insert into the database, and then be output again in the admin...it's gonna be tricky, I think, but I very well may make it happen. Once I figure it all out I'll post my full solution.

27 Apr 2010, 7:08 PM
#14
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Hmm...the struggle goes on.

I guess now I'm at the part where I should really be paying attention to the way the comments are handled. I've got my form to appear, but now I'm having a difficult time figuring out how to insert the data collected via these two radio buttons into the 'zen_orders' table.

Basically...here's what I've got. I know it's way way wrong (otherwise it would be working, lol) but I reckon my best bet is to post my pathetic code and hope:

This is what I've added to tpl_checkout_shipping.php

<fieldset>
<legend>Ship Complete</legend>
To keep shipping costs to a minimum, we ship orders complete unless otherwise requested. If you would like to accept a partial shipment in the event your order contains some in-stock and some non-stock products, please choose "yes" below: <br/><br/>
<form id="splitshipment" name="splitshipment" method="post" input type="submit" action="submit">
  <label>
  <input name="ship_complete_yes" type="radio" value="Yes" />
    Yes</label><label>
	<input name="ship_complete_no" type="radio" value="No" />No</label>
</form>
<?php $sql="INSERT INTO zen_orders ".
       "(ship_complete) ".
       "VALUES ".
       "('$splitshipment')";?>

</fieldset>
28 Apr 2010, 2:42 PM
#15
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Yeah...crap. That's all kinds of wrong. I'm embarrassed to even have that posting there. I still haven't figured out how to do it yet, but I'm workin' on it.

28 Apr 2010, 3:54 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship Complete vs Partial Ship option?

You are trying to insert a new field into the orders table ...

But, you are trying to do this at the wrong point ...

Gather the information to a $_SESSION variable such as $_SESSION['ship_complete'] where the value is 0 or 1 ...

Then in the order.php if you were to follow everywhere the ip_address is managed ... that is where you need to add your ship_complete ...

Now so that the data is managed in all the other files of the checkout right ... look how the comment is handled ... and you would use your ship_complete in the same manner so that it carries from page to page ...

So "collecting" the information for the new field ship_complete follows the comment ... and "adding" the new field ship_complete follows the ip_address ...

Easy smeazy ... eh?! :lamo:

28 Apr 2010, 4:41 PM
#17
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Screw it. I give up. I went to /includes/languages/english/checkout_shipping.php and added ```php
define('TABLE_HEADING_COMMENTS', 'Special Instructions or Comments About Your Order:<br/><br/>All orders will ship complete unless otherwise noted here:');


How about that for a simple solution, eh?
28 Apr 2010, 4:42 PM
#18
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Crap. Sorry Ajeh...I didn't see your post before I wrote my last one! My bad! I'll totally give it another whirl now that I've gotten a little guidance! Thank you so much!

28 Apr 2010, 5:40 PM
#19
jdw1979 avatar

jdw1979

Zen Follower

Join Date:
Jun 2009
Location:
NC
Posts:
174
Plugin Contributions:
0

Re: Ship Complete vs Partial Ship option?

Ok...so...the files I need to edit are:

/includes/classes/order.php

/includes/modules/pages/checkout_shipping/header_php.php

/includes/modules/pages/checkout_process/header_php.php

/includes/includes/modules/pages/checkout_payment/header_php.php

/includes/modules/pages/checkout_confirmation/header_php.php

The header.php files are the ones that carry the $_SESSION data from one page to the other...right?

28 Apr 2010, 7:03 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship Complete vs Partial Ship option?

That is correct ... look in the header_php files for how the $_SESSION['comments'] is managed and used so not to lose the comments from page to page between the variable $comments and $_SESSION['comments'] ...

Then do a search in the order.php class for how the ip_address is put into the orders table ...

Just follow the bouncing balls ... :cool: