We would like to add the date of delivery that we pull from FedEx to what is shown to the customer in smart one page checkout. Is this something that can only be done with source?
in Smart One Page Checkout by (130 points)
recategorized by

1 Answer

0 votes

I think that will depend on how you're pulling/storing the delivery date into your database and how you want to display it. I would start with web/OPCControls/ShippingMethodSelector.ascx, the shipping display starts around line #17. 

<div id="shippingMethodListWrap">
                <asp:RadioButtonList runat="server" ID="ShippingMethods" AutoPostBack="true" OnSelectedIndexChanged="ShippingMethods_SelectedIndexChanged" />
            </div>

 

You'll need to get into the codebehind to pull in your new value. It might be tricky to display a date per shipping method, looks like it should be doable without full SOPC source though.

by (790 points)
Thanks for your reply Vortx Nicole! I have looked in the codebehind but it looks to do a databind to pull the listing in. Is this defined in regular 9.4 source by chance and the OPC just references it like other elements on the page do?
Does anyone have any other suggestions?

The function that populates the RadioButtonList uses the following:

 

        ShippingMethods.DataSource = shippingMethods;
        ShippingMethods.DataTextField = "DisplayName";
        ShippingMethods.DataValueField = "Identifier";
        ShippingMethods.DataBind();
 
How can that be modified to append a string to the DisplayName data field?
Depending on when/how you're getting those dates from FedEx, your best bet would probably be to add that text where the main realtime shipping call is done and the list of shipping methods is built up.  SOPC uses the shipping logic in AspDotNetStorefrontCore (RTShipping.cs, FedEx.cs, etc) so as long as you have source code that shouldn't be hard to do.

Otherwise you're going to have to parse through ShippingMethods.Items after it's bound and add your text to the values in there.
...