- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2021
03:51 AM
01-11-2021
03:51 AM
Getting Number Of Products in Basket From Certain Departments In Owebia
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
)
),
};
Labels: