Developer forum

Currently discussing: Plans to implement a Consent module for GDPR compliance.

Join the discussion!

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

Shipping method required - sometimes

Nuno Aguiar
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
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
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

 

You must be logged in to post in the forum