Question

Using Owebia, I need to apply a specific fee for certain product skus (from 001 to 099). I know the function I need to use with Owebia, but I don't know how to set the array of skus in the cart:

{
    "special_skus": {
    "label": "Restriction",
    "description": "Restriction",
    "shipto": "UK",
    "conditions": "array_match_any(SKUS_IN_CART), array('001','002'...[...]))",
    "fees": 200
}

Is there a way I can get this list? Should I do it in a different way? My final logic is more complicated: I just simply don't way to allow deliveries to some countries for certain products, but before I do that, I need to get something simpler working.

Thanks!

Was it helpful?

Solution

After some tests I've finally found the correct configuration. You'll find my configuration file in here:

https://gist.github.com/PauGNU/1eb7045d660ebe61e51987554e3a1450

The steps to get this to work were:

  1. First of all I created the basic rules for shipping (just weigth/destionation)
  2. I created a rule which would only have a «condition» looking for products in the cart. This rule returns true when the products 003465 and 033339 are not present in the cart:

    "skus_es_gi_ad": {
    "conditions": "({count items where product.attribute.sku=='003465'} < 1) && ({count items where product.attribute.sku=='033339'} < 1)"
     }
    
  3. Finally, in one of my width/destination rules I added this condition:

    "US_shipping": {
        "label": "United States",
        "description": "USA Shipping",
        "shipto": "US",
        "conditions": "{skus_es_gi_ad.conditions}",
        "fees": "{table {cart.weight} in 0.5010:25.1460,1.0010:31.4820}"
     }
    
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top