Developer forum

Forum » Ecommerce - Standard features » Shipping method required - sometimes

Shipping method required - sometimes

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

We have an ecommerce solution where the customer sometimes only purchases "Services" or Gift Cards (nothing "shippable"), but they can also purchase products.

 

How could I set a shipping method to be required only when there's a "shippable" product (we may also have Downloadble products).

 

Best Regards,

Nuno Aguiar


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi Nuno,

Perhaps, the validation can be perforrmed via validation group has to be applied within shopping cart and has a rule of 'Regular expression' type for 'ShippingI method ID' field. Extra coding should be done in the case.Please, find extra info here . 

BR, Oleg QA

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Oleg,

 

RIght, but the validation rules (as far as I can tell) cannot check other fields. So if I could set a custom order field (checkbox) saying "Requires Shipping method ID validaton" and if set would trigger the validation rule would work, but looks like we have to do some custom stuff.

 

In other words, the current validation rules are contained to that field, so I cannot do something like "only validate the shipping country, if the shipping zip code is not null or empty (it's a stupid example, but I hope it helps determine what I am trying to say).

 

Thank you,

Nuno Aguiar

 
Thomas Jensen
Reply

Hi

Could this be a new feature
2 more places where this could be used

1: If EAN payment is selected, the customer's EAN field must be populated

2: If the delivery address is not the same as the customer address, validate the group
(this can be shomwhat done with the: "don't validate if all fields are empty")

 

if there is er "if option" on the validation group it self, 
like the check "don't validate if all fields are empty"
 

Best Regards 

Thomas

 
Nicolai Pedersen
Reply

Hi Nuno & Thomas

For now we recommend that you add these validations in the template using JS.

Thanks, Nicolai

 

You must be logged in to post in the forum