craftcms / docs

Documentation for Craft CMS, Craft Commerce, and other official products.
https://craftcms.com/docs
39 stars 150 forks source link

Incomplete Documentation for requireBillingAddressAtCheckout and requireShippingAddressAtCheckout Settings #637

Open romainpoirier opened 4 months ago

romainpoirier commented 4 months ago

What happened?

Description

In the Craft Commerce 5 documentation, the following section mentions two configuration settings:

Customize what address information is required at checkout with the requireBillingAddressAtCheckout and requireShippingAddressAtCheckout config settings.

The tax and shipping engines require address information to generate accurate options and costs.

However, when clicking on the requireBillingAddressAtCheckout and requireShippingAddressAtCheckout links, no information is provided on the destination page.

Steps to reproduce

  1. Go to Craft Commerce 5 - Synchronizing Shipping and Billing Addresses
  2. Click on the requireBillingAddressAtCheckout link
  3. Click on the requireShippingAddressAtCheckout link

Expected behavior

Information or documentation about the requireBillingAddressAtCheckout and requireShippingAddressAtCheckout settings should be displayed.

Actual behavior

No information is provided on the destination page after clicking the links.

Questions

  1. Are these settings available?
  2. How should they be used?
  3. Where can detailed documentation for these settings be found?

Craft CMS version

5.2.28

Craft Commerce version

5.0.14

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

linear[bot] commented 4 months ago

PT-2005 [5.x]: Incomplete Documentation for requireBillingAddressAtCheckout and requireShippingAddressAtCheckout Settings

lukeholder commented 4 months ago

Those settings are now on a per store level and not global commerce configs, so the doc links need updating.

I have moved this issue to the docs repo so we can sort that.

In the meantime, to explain what those settings do: setting either of those store settings to true will cause order completion on final checkout (which usually only happens when making payment) to return as invalid. The cart will get a validation error for missing addresses.

Hope that helps.

romainpoirier commented 4 months ago

Ok, thank you. However, I still do not understand how to set other required fields for the customer address (specifically during the users/save-address action).

In this case, I want firstName and lastName to be required, as well as organizationTaxId.

I cannot find additional options under /admin/commerce/store-management/primary.

lukeholder commented 4 months ago

@romainpoirier Sorry those settings just make the addresses required to be on the order, not specific fields.

If you want to add validation to the addresses on the order, you need to add you‘re own validation within a module.

You can add validation to all addresses as documented here:

https://craftcms.com/docs/5.x/reference/element-types/addresses.html#validating-addresses