I'm trying to update the payment & shipping method using the HTML form API and it doesn't appear to be respecting the value on the SetCurrentPaymentMethod field. The form I'm using is (removed some markup for ease of reading):
However the order.PaymentInformation.PaymentMethodId & order.ShipmentInformation.ShippingMethodId remain null.
The reason the field names are different is because I'm used strongly typed form models with the HTML helper @Html.DropDownListFor(x => paymentShippingMethod.PaymentMethodId, paymentMethods.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString()})).
Now it is possible to changed what input name is used, but there is a specific syntax for it (which I don't actually think is documented in the documentation, so I'll need to look at adding it).
Ultimately, the value "shippingMethodId" is an expected string, but if you want to change it you need to do the following:
HTML API isn't respecting the method field value
Hey,
I'm trying to update the payment & shipping method using the HTML form API and it doesn't appear to be respecting the value on the SetCurrentPaymentMethod field. The form I'm using is (removed some markup for ease of reading):
And the values that get posted are:
However the
order.PaymentInformation.PaymentMethodId
&order.ShipmentInformation.ShippingMethodId
remain null.The reason the field names are different is because I'm used strongly typed form models with the HTML helper
@Html.DropDownListFor(x => paymentShippingMethod.PaymentMethodId, paymentMethods.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString()}))
.Thanks, Tom
Hey Tom,
So I think I can see the issue. So in the docs, it shows to set the Payment/Shipping methods by doing the following:
Now it is possible to changed what input name is used, but there is a specific syntax for it (which I don't actually think is documented in the documentation, so I'll need to look at adding it).
Ultimately, the value "shippingMethodId" is an expected string, but if you want to change it you need to do the following:
So the syntax is
shippingMethodId:alternativeFieldName
.Hopefully this helps, but I'll go add an issue to the docs issure tracker to get this documented.
Matt
The issue for this is here incase you want to track it https://github.com/TeaCommerce/Tea-Commerce-Documentation/issues/12
Thanks Matt, that worked perfectly.
Actually it does look to be documented, but maybe not that clear. And I think we can add links to this from other areas.
https://docs.teacommerce.net/3.3.0/api/#multiple-methods
is working on a reply...