Pick Your Ship Date

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
jessthib
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Tue Nov 03, 2009 10:26 am

Pick Your Ship Date

Post by jessthib » Thu Sep 02, 2010 1:50 pm

Hello!

I'm attempting to add the [[ConLib:Utility\PickerAndCalendar]] on my checkout page so that Customers can pick their desired ship date. Where would I want to put the utility for this to work?

Thanks!

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pick Your Ship Date

Post by mazhar » Fri Sep 03, 2010 2:06 am

Why don't you simply turn on the delivery instructions to capture this sort of information. you can put a note that customers need to put their preferred ship date in instructions.

jessthib
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Tue Nov 03, 2009 10:26 am

Re: Pick Your Ship Date

Post by jessthib » Fri Sep 03, 2010 6:58 am

That could work too... how do I turn that on?

I just thought that was what the PickerAndCalendar was for.

Thanks

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Pick Your Ship Date

Post by jmestep » Sat Sep 04, 2010 4:20 am

If you are using the one page checkout, you would probably want to put it in the same section where they select the shipping method to get around the show/hide panel code. To save the selection, you might have to do that in the checked out event - that is the first time that the final orderid is available. I usually save it to another table (like user settings), then move it to the final resting place in the checked out event or the receipt page. That way if the user is migrated from anonymous, the data follows them thru the migration.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pick Your Ship Date

Post by mazhar » Sun Sep 05, 2010 10:18 pm

jessthib wrote:That could work too... how do I turn that on?

I just thought that was what the PickerAndCalendar was for.

Thanks
Log in to merchant side of your store and then go to Administration > Website > Content and Layout. Edit Checkout Page scriptlet and then update its contents from

Code: Select all

[[ConLib:OnePageCheckout]]
to

Code: Select all

[[ConLib:OnePageCheckout EnableShipMessage="true"]]

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Pick Your Ship Date

Post by Thistle3408 » Fri Sep 24, 2010 1:32 pm

Mazhar,

Any easy way to make the Delivery Instructions mandatory when a specific "ship method" is selected?
We have a "customer pays" method that our customers can use to put in their own FedEx, UPS, etc. accounts for us to charge. Below that we have enabled the "Delivery Instructions?" box for them to use to enter such information. If someone selects the "customer pays" ship method, then I want to validate that there is at least something (not null field) in the box.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pick Your Ship Date

Post by mazhar » Sat Sep 25, 2010 5:33 am

Thistle3408 wrote:Mazhar,

Any easy way to make the Delivery Instructions mandatory when a specific "ship method" is selected?
We have a "customer pays" method that our customers can use to put in their own FedEx, UPS, etc. accounts for us to charge. Below that we have enabled the "Delivery Instructions?" box for them to use to enter such information. If someone selects the "customer pays" ship method, then I want to validate that there is at least something (not null field) in the box.
This could be accomplished by doing something like this. Edit you ConLib/OnePageCheckout.ascx.cs file and locate following code block in RecalculateBasket method

Code: Select all

               if (ShipMethodList != null)
                {
                    shipment.ShipMethodId = AlwaysConvert.ToInt(ShipMethodList.SelectedValue);
                }

and then replace it with

Code: Select all

if (ShipMethodList != null)
                {
                    shipment.ShipMethodId = AlwaysConvert.ToInt(ShipMethodList.SelectedValue);
                    if (EnableShipMessage)
                    {
                        ShipMethod shipMethod = ShipMethodDataSource.Load(shipment.ShipMethodId);
                        if (shipMethod != null && shipMethod.Name.ToLower().Contains("customer pays"))
                        {
                            PlaceHolder shipMessagePanel = (PlaceHolder)item.FindControl("ShipMessagePanel");
                            RequiredFieldValidator rfv = new RequiredFieldValidator();
                            rfv.ErrorMessage = "Delivery Instructions are required";
                            rfv.Text = "*";
                            rfv.ControlToValidate = "ShipMessage";
                            rfv.ValidationGroup = "OPC";
                            shipMessagePanel.Controls.Add(rfv);
                        }
                    }
                }
Now try placing some order without instructions while ship method should be customer pays. It should show validation error asking for instructions. Make sure that you turned on EnableShipMessage property on checkout page.

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Pick Your Ship Date

Post by Thistle3408 » Sat Sep 25, 2010 9:24 am

Got an error...
It said a ";" was missing, but I don't see any problems.

Let me look later when I have a little more time

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pick Your Ship Date

Post by mazhar » Sat Sep 25, 2010 9:32 am

What line number for error?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pick Your Ship Date

Post by mazhar » Sat Sep 25, 2010 9:34 am

Make sure when replacing the code you replaced the exact block that I mentioned. Nothing more or less. This could be due to a bad replace where you may replaced the else part of if.

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Pick Your Ship Date

Post by Thistle3408 » Sat Sep 25, 2010 9:40 am

Double checked that and the pairing up of brackets to make sure I didn't delete on or should have deleted one.
Like I said, I'll take a look (when it's not likely customers may be looking) which mean probably Sunday morning.

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Pick Your Ship Date

Post by Thistle3408 » Sun Sep 26, 2010 8:08 am

Redoing the edit got rid of the error, so I must have hit something I shouldn't have.

But the desired result is not happening.
To start with the Scriptlet 'Checkout Page has the EnableShipMessage on....

Code: Select all

[[ConLib:OnePageCheckout EnableShipMessage="true"]]
Here's the code in the recalculate right now:

Code: Select all

    private void RecalculateBasket(bool rebindPaymentForms)
    {
        Basket basket = Token.Instance.User.Basket;
        UpdateShippingAddress(basket, GetShippingAddress());
        //UPDATE SHIPPING RATES
        if (trShowRates.Visible)
        {
            int shipmentIndex = 0;
            foreach (RepeaterItem item in ShipmentList.Items)
            {
                BasketShipment shipment = basket.Shipments[shipmentIndex];
                DropDownList ShipMethodList = (DropDownList)item.FindControl("ShipMethodList");
//                if (ShipMethodList != null)
//                {
//                    shipment.ShipMethodId = AlwaysConvert.ToInt(ShipMethodList.SelectedValue);
//                }
//new
		  if (ShipMethodList != null)
                {
                    shipment.ShipMethodId = AlwaysConvert.ToInt(ShipMethodList.SelectedValue);
                    if (EnableShipMessage)
                    {
                        ShipMethod shipMethod = ShipMethodDataSource.Load(shipment.ShipMethodId);
                        if (shipMethod != null && shipMethod.Name.ToLower().Contains("customer pays"))
                        {
                            PlaceHolder shipMessagePanel = (PlaceHolder)item.FindControl("ShipMessagePanel");
                            RequiredFieldValidator rfv = new RequiredFieldValidator();
                            rfv.ErrorMessage = "Delivery Instructions are required";
                            rfv.Text = "*";
                            rfv.ControlToValidate = "ShipMessage";
                            rfv.ValidationGroup = "OPC";
                            shipMessagePanel.Controls.Add(rfv);
                        }
                    }
                }
//old again
                else
                {
                    shipment.ShipMethodId = 0;
                }
                shipment.Save();
                shipmentIndex++;
            }
        }
        //RECALCULATE SHIPPING, TAXES, DISCOUNTS, ETC.
        basket.Recalculate();
        _CurrentBasketHash = basket.GetContentHash(OrderItemType.Product);
        if (rebindPaymentForms) BindPaymentMethodForms();
    }

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Pick Your Ship Date

Post by mazhar » Mon Sep 27, 2010 4:54 am

The changes you posted above seems to be right. So keep these changes and make one more change in your ConLib/OnePageCheckout.ascx.cs file. locate following code block in your code

Code: Select all

//bind the payments
BindPaymentMethodForms();
and then update it to

Code: Select all

//bind the payments
RecalculateBasket(true);
Save it and repeat the test.

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Pick Your Ship Date

Post by Thistle3408 » Mon Sep 27, 2010 6:07 am

That did it.
Thx

Post Reply