Hi there,
This is a question about the Owebia Advanced Shipping Module configuration. I am trying to write a variable to be used in the shipping methods but having no joy so far. The below attempts to check how many items in the shopping basket are from departments 2 or 3 and times it by 5. What am i doing wrong here?
$dishwashers = function ($allItems) {
return array_sum(
return array_map(
function ($item) {
return count(array_intersect($item->product->category_ids, [2, 3]))
? $item->qty
: 0;
},
$request->all_items
)
),
};