Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
v:2.0:shipping [2023/07/12 14:05] – [Custom Shipping Endpoint] adam | v:2.0:shipping [2023/07/12 14:05] (current) – [Custom Shipping Code] adam | ||
---|---|---|---|
Line 172: | Line 172: | ||
[[v: | [[v: | ||
+ | ==== Passing custom fields to the custom shipping endpoint ==== | ||
+ | |||
+ | By default - any custom session attributes currently in the customers session will be included in the payload within the '' | ||
+ | |||
+ | Sometimes though you need to capture information from a customer on the checkout related to the shipping, such as whether a signature is required on delivery, which affects the rates calculated on your custom endpoint. To do that, you can add [[v: | ||
+ | |||
+ | <code html> | ||
+ | <!-- Checkbox --> | ||
+ | <input type=" | ||
+ | <label for=" | ||
+ | |||
+ | <!-- Radio inputs --> | ||
+ | <input type=" | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | |||
+ | <!-- Text input --> | ||
+ | <input type=" | ||
+ | |||
+ | <!-- Select options --> | ||
+ | <select name=" | ||
+ | <option value=""></ | ||
+ | <option value=" | ||
+ | <option value=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | If a value is already present in the cart session, and a custom checkout field shares the same name - the custom checkout field will overwrite the existing custom field in the session when sent to the custom shipping endpoint. | ||
+ | |||
+ | If needed, you can also pass custom fields to the shipping endpoint using javascript and [[v: | ||
+ | |||
+ | <code javascript> | ||
+ | FC.client.on(" | ||
+ | params.custom_fields = { my_custom_attr: | ||
+ | }); | ||
+ | </ | ||
==== Handling Fees ==== | ==== Handling Fees ==== | ||
Handling fees, like flat rates, are configured per category, but can be applied in a few different ways: | Handling fees, like flat rates, are configured per category, but can be applied in a few different ways: |