Skip to content

Conversation

acoumb
Copy link

@acoumb acoumb commented Sep 19, 2025

Current PR adds support for an authorized checkout flow with the following additional features implemented:

  • Add settings to the Checkout page to specify whether login is required, and specified the login content node. If login is required but no login page has been specified, the action result will be Unauthorized.
  • Upon checkout, the customer information will be retrieved from the details of the logged in user using the implemented extension methods.

Using the Checkout add-on in parallel with the Portal one, upon login the customer will be automatically assigned to the current order.

FYI @umbracotrd

Copy link
Contributor

@mattbrailsford mattbrailsford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, but just a few items to look into

<h3 class="text-xl font-medium mb-4">@Umbraco.GetDictionaryValueOrDefault("UmbracoCommerceCheckout.Information.ContactInformation", "Contact Information")</h3>
<input name="email" type="email" placeholder="@Umbraco.GetDictionaryValueOrDefault("UmbracoCommerceCheckout.Information.Email", "Email")" class="block placeholder-gray-700 border border-gray-300 rounded py-2 px-4 mb-2 w-full"
value="@(currentOrder.CustomerInfo.Email)" required />
value="@(customer.Email ?? currentOrder.CustomerInfo.Email)" required />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all properties the order should be first and fallback to the member properties. If the member properties are first then if they change these and progress in the checkout flow but then come back it will revert their changes back to the member properties. We only want to use the member properties if the order properties aren't yet populated.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Used an extension method to pass the customer information as fallback.

// This extension method should not be used in a context where order is null.
ArgumentNullException.ThrowIfNull(order);

return new CustomerAddress(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might just need to double check if we should handle "shippingSameAsBilling" here and return the billing details if true.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


var customer = currentOrder.GetCustomer(orderPropertyConfig);
var billingAddress = currentOrder.GetBillingAddress(orderPropertyConfig);
var shippingAddress = currentOrder.GetShippingAddress(orderPropertyConfig);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if shipping address is being captured (a setting in the checkout) and if not, we don't need to get the details.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants