Don't know if this is the smoothest way or not (I'm sure there's better methods), but it works for me.
I added this code to the beginning of YourPayConnect_order_form_prep function in YourPayConnect-order_lib.pl to snif through the cart and look for the correct items
Code:
$zero_shipping_items = 0;
$total_shipping = 0;
open (CART, "$sc_cart_path") ||
&file_open_error("$sc_cart_path", "display_cart_contents", __FILE__, __LINE__);
while (<CART>) {
@cart_fields = split (/\|/, $_);
if($cart_fields[6] == 0)
{
$zero_shipping_items++;
}
else
{
$total_shipping++;
}
}
close(CART);
The following code was then added to the YourPayConnect-orderform.html to show the appropriate information and boxes. Note that if the cart has 0-weight items AND shippable items, both the pickup date box and the shipping method box show up. If only 0-weight items, I don't show the shipping method option. Also, I remove the Ecom_ShipTo_Method from the required fields in the order_lib file and add it in the orderform file if the customer needs to pick a shipping method.
Code:
<!--agorascript-pre {
if($zero_shipping_items > 0)
{
return q~
<tr>
<td colspan=2 class="ac_checkout_top_col"><blockquote>
<em><p>You have ordered one or more perishable items that we cannot ship. These items have a shipping weight of 0 in the list above.</p>
<p>You will need to pick up the items at our store in Bird-In-Hand. Orders placed by 5:00 PM will be ready for pickup by 10:00 AM the following business morning. If you prefer to pick up the item on a different day, please specify the pickup date below.</p><p>Please print your receipt after it is emailed to you and bring it as proof of purchase.</p></em></blockquote>
</td>
</tr>
<tr>
<td class="ac_checkout_left_col">Pickup Date:</td>
<td class="ac_checkout_right_col"><INPUT TYPE=TEXT NAME="Ecom_Pickup_Date"
VALUE="$eform_Ecom_Pickup_Date" size=15></td>
</tr><tr><td colspan=2> </td></tr>~;
}
}-->
<!--agorascript-pre {
if($total_shipping > 0){
push(@sc_order_form_required_fields,"Ecom_ShipTo_Method");
return q~<tr>
<td colspan=2 class="ac_checkout_top_col">
Please select where your order will be shipped/billed
</td>
</tr>
<tr>
<TD class="ac_checkout_left_col">Shipping Method:</TD>
<TD class="ac_checkout_right_col">
<select name="Ecom_ShipTo_Method">
<option value="$vform_Ecom_ShipTo_Method">Select Shipping Method</option
<option value="Pickup">Pickup</option>
<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
<option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
<option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
</select>
</td>
</TR>~;}
else{
return q~<tr>
<td colspan=2 class="ac_checkout_top_col">
Please provide your billing information
</td>
</tr>
<tr>~;}
}-->
The $zero_shipping_items variable didn't seem to persist throughout the checkout process, so I had to reconstruct it one more time for my validation emails. The following code was added to the process_YourPayConnect_order sub in the YourPayConnect-orderform_lib.pl file:
The code that used to look like this:
Code:
while (<CART>) {
$cartData++;
@cart_fields = split (/\|/, $_);
$quantity = $cart_fields[0];
$product_price = $cart_fields[3];
$product = $cart_fields[4];
$weight = $cart_fields[6];
$options = $cart_fields[$cart{"options"}];
$options =~ s/<br>//g;
$text_of_cart .= &cart_textinfo(*cart_fields);
$stevo_shipping_thing .= "|quantity\*$weight";
$stevo_shipping_names .= "|$product\($options\)";
&codehook("process-cart-item");
}
close(CART);
now looks like this:
Code:
$zero_shipping_items = 0;
while (<CART>) {
$cartData++;
@cart_fields = split (/\|/, $_);
$quantity = $cart_fields[0];
$product_price = $cart_fields[3];
$product = $cart_fields[4];
$weight = $cart_fields[6];
if($weight == 0)
{
$zero_shipping_items++;
}
$options = $cart_fields[$cart{"options"}];
$options =~ s/<br>//g;
$text_of_cart .= &cart_textinfo(*cart_fields);
$stevo_shipping_thing .= "|quantity\*$weight";
$stevo_shipping_names .= "|$product\($options\)";
&codehook("process-cart-item");
}
close(CART);
and I added this under the line that said $text_of_cart .= "SHIPPING INFORMATION --------------\n\n";
Code:
if($zero_shipping_items > 0)
{
$text_of_cart .= "Pickup Date: $eform_Ecom_Pickup_Date\n";
$orderLoggingHash{'pickupDate'} = "$eform_Ecom_Pickup_Date";
$text_of_confirm_email .= "FRUIT BASKET PICKUP DATE: $eform_Ecom_Pickup_Date\n\n";
}
this adds the pickup date to the confirmation and order emails.
Like I said, this is kind of clunky and I'm sure it could be improved and slimmed down, but it works for me for now.

If you have suggestions I'd love to hear about them.