Get Products by Coupon

I want to get products by coupon code filtered whether by SKU or Mark so I can get theses details: ,order date price before discount , price after discount, name /surname of the client, telephone , country and product name For order date ,price before discount and price after discount I got them named ‘created_at’,’subtotal’…

Alternatives to extract() inside class

So I’m not sure if this is the best way to tackle this, but I’m using an extract call to define the params of one of my functions. Here is my class: class Template { const PATH_FROM_DOCUMENT_ROOT = ‘/wp-content/mu-plugins/sacfoodies/templates’; public static function load($params, $path) { ob_start(); extract($params, EXTR_OVERWRITE); require $_SERVER[‘DOCUMENT_ROOT’] . Template::PATH_FROM_DOCUMENT_ROOT . ‘/’ .…

Rewriting a URL to use a custom querystring value

I’ve added a custom query variable and am attempting to rewrite URLs so that its value is part of the path as opposed to a query-string. For example, given the following URL: example.com/my_post_type/?my_variable=foobar I would like that to be written as: example.com/my_post_type/foobar Here is my current code which is not working: add_filter( ‘query_vars’, function ($query_vars)…