Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a couple of questions about delivery! We have a site where we are currently using the Invoicing provider to allow free delivery of free product samples.
The client are going to start charging for delivery of the samples, and I have a few questions. The site is in English, but allows for delivery to UK or Ireland only.
1) Is it possible to have different delivery costs depending on the country for the order?
2) Is it possible to switch the currency of the order depending on whether they select UK (GBP) or Ireland (EUR) for the delivery country?
1) Yes, you can provide different prices for different countries for a shipping method. In the shipping method editor, go to the "Available in these countries" tab and allow the shipping method in the UK and Ireland. Against these, you can click the "custom prices" link to provide custom pricing for each country.
2) There is nothing automatic that does this, but what you would generally want to do is create a country / currency selector that usually appears at the top of the site and display the two options. When the option is changed, then you can update the payment country of the order using the TC API https://docs.teacommerce.net/3.4.0/api/country/#setcurrentpaymentcountry This should then cause it to select the appropriate shipping price.
Hope this helps
That's worked like a charm. I have one other issue though, are you aware of anything that would cause the shipping method not to get set when using the HTML API?
I have several hidden fields like this:
<input name="SetCurrentPaymentCountry" value="countryId" type="hidden" />
<input name="SetCurrentShippingCountry" value="countryId" type="hidden" />
<input name="SetCurrentShippingMethod" value="chipShippingMethod" type="hidden" />
<input name="chipShippingMethod" value="@TC.GetShippingMethods(commerceSettings.StoreId).FirstOrDefault(a => a.Alias == "chipDelivery").Id" type="hidden" />
For some reason the shipping method is not getting set, looking in the back office it's just empty. If I take the fields for that out, the default shipping method is assigned. Everything else is getting assigned as expected.
The hidden field is getting a shipping method id (2 in this case), but it's not being set against the order for some reason.
I think you need to change your SetCurrentShippingMethod input to be
<input name="SetCurrentShippingMethod" value="shippingMethodId : chipShippingMethod" type="hidden" />
Or change that and the line after to be:
<input name="SetCurrentShippingMethod" value="shippingMethodId" type="hidden" />
<input name="shippingMethodId" value="@TC.GetShippingMethods(commerceSettings.StoreId).FirstOrDefault(a => a.Alias == "chipDelivery").Id" type="hidden" />
Thanks Matt! Renaming the hidden field worked, it's now setting the currency and the shipping method correctly, thank you very much :)
No problem at all.
Glad we could get you all up and running. 👍
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted