How can I get an object list of products with SKU that starts with the same value? Example:
I've following products:
- Article 1 - Sku: ART_1
- Article 2 - Sku: ART_2
- Article 3 - Sku: ART_3
I want to get all products that starts with "ART_". Thanks in advance.
The following custom function, will query all product Id(s) and sku(s) (standard objects) using a light SQL query from a sku excerpt (as
ART_
):Code goes in functions.php file of your active child theme (or active theme). Tested and works.
USAGE (example):