1.8.0: a coupon can carry a group's shipping rules
CI / WordPress latest + WooCommerce latest on PHP 8.3 (pull_request) Successful in 1m11s
Compatibility / WP latest / WC latest / PHP 7.4 (pull_request) Skipped
Compatibility / WP latest / WC beta / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP nightly / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.4 (pull_request) Skipped
Compatibility / Keep the compatibility headers honest (pull_request) Skipped
CI / Static checks (pull_request) Successful in 4m26s
CI / WordPress latest + WooCommerce latest on PHP 8.3 (pull_request) Successful in 1m11s
Compatibility / WP latest / WC latest / PHP 7.4 (pull_request) Skipped
Compatibility / WP latest / WC beta / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP nightly / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.4 (pull_request) Skipped
Compatibility / Keep the compatibility headers honest (pull_request) Skipped
CI / Static checks (pull_request) Successful in 4m26s
Shipping Rules gets a "Coupon codes" field per group. A customer with one of those coupons in the cart gets the group's shipping methods, including "Only" ones, whatever their email. Asked for on a live shop: free delivery reserved for one company's addresses had to reach people using that company's coupon too. Only the shipping follows the coupon; the group's percentage discount stays with its email assignments. An email assigned to a group still wins. The shipping package key now carries the effective group, so WooCommerce's rate cache follows a coupon being added or removed. Stored as groups.shipping_coupons (dbDelta adds the column on update). Smoke tests: 100 assertions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b9d8611ce2
commit
654d8632d2
+4
-1
@@ -4,7 +4,7 @@ Tags: woocommerce, discount, email, shipping, coupon
|
|||||||
Requires at least: 5.8
|
Requires at least: 5.8
|
||||||
Tested up to: 7.1.2
|
Tested up to: 7.1.2
|
||||||
Requires PHP: 7.4
|
Requires PHP: 7.4
|
||||||
Stable tag: 1.7.1
|
Stable tag: 1.8.0
|
||||||
WC requires at least: 6.0
|
WC requires at least: 6.0
|
||||||
WC tested up to: 11.1.2
|
WC tested up to: 11.1.2
|
||||||
License: GPLv2 or later
|
License: GPLv2 or later
|
||||||
@@ -97,6 +97,9 @@ The most specific match wins: exact email, then domain, then partial match.
|
|||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
|
= 1.8.0 =
|
||||||
|
* Shipping rules can follow a coupon. Under Shipping Rules each group has a new "Coupon codes" field: a customer with one of those coupons in the cart gets the group's shipping methods, including the ones marked "Only", whatever email address they use. Only the shipping follows the coupon; the coupon gives its own discount, and the group's percentage stays with the group's email addresses. To keep the shipping for the right people, restrict the coupon to their addresses under "Allowed emails" in WooCommerce.
|
||||||
|
|
||||||
= 1.7.1 =
|
= 1.7.1 =
|
||||||
* Security: the discount now follows the email address the order is placed under. Before, a guest could enter a discounted address at checkout, change it to their own, and keep the discount.
|
* Security: the discount now follows the email address the order is placed under. Before, a guest could enter a discounted address at checkout, change it to their own, and keep the discount.
|
||||||
* Security: free shipping and reserved shipping methods no longer carry over when a customer changes their email address at checkout.
|
* Security: free shipping and reserved shipping methods no longer carry over when a customer changes their email address at checkout.
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# Contract
|
# Contract
|
||||||
|
|
||||||
Every hook this plugin offers, and every family hook it answers. Version 1.7.1.
|
Every hook this plugin offers, and every family hook it answers. Version 1.8.0.
|
||||||
|
|
||||||
A contract is a name somebody else has to know. Core hooks this plugin merely
|
A contract is a name somebody else has to know. Core hooks this plugin merely
|
||||||
listens to — `init`, `admin_menu`, `wp_enqueue_scripts` — are not here;
|
listens to — `init`, `admin_menu`, `wp_enqueue_scripts` — are not here;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# Nolimit Discounts
|
# Nolimit Discounts
|
||||||
|
|
||||||
Version 1.7.1 · a WooCommerce plugin · slug `woocommerce-email-discount-manager`
|
Version 1.8.0 · a WooCommerce plugin · slug `woocommerce-email-discount-manager`
|
||||||
|
|
||||||
Gives a customer a discount, and decides which shipping methods they may
|
Gives a customer a discount, and decides which shipping methods they may
|
||||||
choose, based on the email address they check out with.
|
choose, based on the email address they check out with.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
# Releasing
|
# Releasing
|
||||||
|
|
||||||
One release a day at most, cut by hand. Version 1.7.1 is current.
|
One release a day at most, cut by hand. Version 1.8.0 is current.
|
||||||
|
|
||||||
## The sequence
|
## The sequence
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ is loud, an id that belongs to something else is not.
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `ci/static.sh` | syntax, guards, text domain, no secrets, every loaded file ships, one version everywhere, the two compat files agree, no tracked file writes a git identity, the docs still describe this tree | a count on every passing line |
|
| `ci/static.sh` | syntax, guards, text domain, no secrets, every loaded file ships, one version everywhere, the two compat files agree, no tracked file writes a git identity, the docs still describe this tree | a count on every passing line |
|
||||||
| `ci/selftest.sh` | **the checkers themselves** — see below | `all N assertions passed` |
|
| `ci/selftest.sh` | **the checkers themselves** — see below | `all N assertions passed` |
|
||||||
| `ci/site-test.sh` | a real WordPress + WooCommerce + MySQL install, this plugin activated, `tests/smoke.php` run through `wp eval-file` | `All 89 assertions passed`, floored at 60 by the caller |
|
| `ci/site-test.sh` | a real WordPress + WooCommerce + MySQL install, this plugin activated, `tests/smoke.php` run through `wp eval-file` | `All 100 assertions passed`, floored at 60 by the caller |
|
||||||
| `.github/workflows/compat.yml` | the matrix: PHP 7.4 / 8.3 / 8.4, WP latest and nightly, WC latest and beta | one job per cell |
|
| `.github/workflows/compat.yml` | the matrix: PHP 7.4 / 8.3 / 8.4, WP latest and nightly, WC latest and beta | one job per cell |
|
||||||
|
|
||||||
## The checkers are themselves tested, and that is unusual
|
## The checkers are themselves tested, and that is unusual
|
||||||
|
|||||||
@@ -64,6 +64,9 @@ class WC_EDM_Admin_Shipping {
|
|||||||
|
|
||||||
WC_EDM_DB::replace_shipping_rules( $group_id, $rules );
|
WC_EDM_DB::replace_shipping_rules( $group_id, $rules );
|
||||||
|
|
||||||
|
$coupons = isset( $_POST['shipping_coupons'] ) ? sanitize_text_field( wp_unslash( $_POST['shipping_coupons'] ) ) : '';
|
||||||
|
WC_EDM_DB::set_group_shipping_coupons( $group_id, WC_EDM_DB::parse_coupon_list( $coupons ) );
|
||||||
|
|
||||||
wp_safe_redirect(
|
wp_safe_redirect(
|
||||||
WC_EDM_Helpers::admin_url(
|
WC_EDM_Helpers::admin_url(
|
||||||
array(
|
array(
|
||||||
@@ -190,6 +193,24 @@ class WC_EDM_Admin_Shipping {
|
|||||||
</ul>
|
</ul>
|
||||||
<p class="description"><?php esc_html_e( 'Drag to reorder — the order here controls the order shipping methods appear in at checkout.', 'wc-email-discount' ); ?></p>
|
<p class="description"><?php esc_html_e( 'Drag to reorder — the order here controls the order shipping methods appear in at checkout.', 'wc-email-discount' ); ?></p>
|
||||||
|
|
||||||
|
<table class="form-table" role="presentation">
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><label for="wc-edm-shipping-coupons"><?php esc_html_e( 'Coupon codes', 'wc-email-discount' ); ?></label></th>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="wc-edm-shipping-coupons" name="shipping_coupons" class="regular-text" list="wc-edm-coupon-list"
|
||||||
|
value="<?php echo esc_attr( implode( ', ', WC_EDM_DB::get_group_shipping_coupons( $group_id ) ) ); ?>">
|
||||||
|
<datalist id="wc-edm-coupon-list">
|
||||||
|
<?php foreach ( WC_EDM_Helpers::get_coupon_codes() as $code ) : ?>
|
||||||
|
<option value="<?php echo esc_attr( $code ); ?>"></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</datalist>
|
||||||
|
<p class="description">
|
||||||
|
<?php esc_html_e( 'A customer with one of these coupons in the cart gets this group\'s shipping rules too, whatever their email address. Separate several with commas. Only the shipping rules follow the coupon — the coupon gives its own discount, not the group\'s. To keep the shipping for the right people, restrict the coupon to their addresses under the coupon\'s "Usage restriction" → "Allowed emails" in WooCommerce.', 'wc-email-discount' ); ?>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<button type="submit" class="button button-primary"><?php esc_html_e( 'Save Shipping Rules', 'wc-email-discount' ); ?></button>
|
<button type="submit" class="button button-primary"><?php esc_html_e( 'Save Shipping Rules', 'wc-email-discount' ); ?></button>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class WC_EDM_DB {
|
|||||||
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
name varchar(191) NOT NULL,
|
name varchar(191) NOT NULL,
|
||||||
discount_percent decimal(5,2) NOT NULL DEFAULT 0.00,
|
discount_percent decimal(5,2) NOT NULL DEFAULT 0.00,
|
||||||
|
shipping_coupons text NULL,
|
||||||
created_at datetime NOT NULL,
|
created_at datetime NOT NULL,
|
||||||
updated_at datetime NOT NULL,
|
updated_at datetime NOT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
@@ -298,6 +299,87 @@ class WC_EDM_DB {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Coupon codes that give a customer this group's shipping rules.
|
||||||
|
*
|
||||||
|
* @param int $id Group ID.
|
||||||
|
* @return string[] Normalised coupon codes.
|
||||||
|
*/
|
||||||
|
public static function get_group_shipping_coupons( $id ) {
|
||||||
|
$group = self::get_group( $id );
|
||||||
|
|
||||||
|
return $group ? self::parse_coupon_list( isset( $group->shipping_coupons ) ? $group->shipping_coupons : '' ) : array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store the coupon codes that give a customer this group's shipping rules.
|
||||||
|
*
|
||||||
|
* @param int $id Group ID.
|
||||||
|
* @param string[] $codes Coupon codes.
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function set_group_shipping_coupons( $id, $codes ) {
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
$codes = self::parse_coupon_list( implode( ',', (array) $codes ) );
|
||||||
|
|
||||||
|
return false !== $wpdb->update(
|
||||||
|
self::table( 'groups' ),
|
||||||
|
array(
|
||||||
|
'shipping_coupons' => $codes ? implode( ',', $codes ) : null,
|
||||||
|
'updated_at' => current_time( 'mysql' ),
|
||||||
|
),
|
||||||
|
array( 'id' => $id ),
|
||||||
|
array( '%s', '%s' ),
|
||||||
|
array( '%d' )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The group whose shipping rules one of these applied coupons unlocks.
|
||||||
|
*
|
||||||
|
* @param string[] $applied Coupon codes applied to the cart.
|
||||||
|
* @return int Group ID, or 0.
|
||||||
|
*/
|
||||||
|
public static function group_for_coupons( $applied ) {
|
||||||
|
$applied = self::parse_coupon_list( implode( ',', (array) $applied ) );
|
||||||
|
|
||||||
|
if ( empty( $applied ) ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ordered by name, so the answer is the same on every request when
|
||||||
|
// two groups claim the same coupon.
|
||||||
|
foreach ( self::get_groups() as $group ) {
|
||||||
|
$codes = self::parse_coupon_list( isset( $group->shipping_coupons ) ? $group->shipping_coupons : '' );
|
||||||
|
|
||||||
|
if ( array_intersect( $codes, $applied ) ) {
|
||||||
|
return (int) $group->id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Split a comma/whitespace separated list into normalised coupon codes.
|
||||||
|
*
|
||||||
|
* @param string $list Raw list.
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public static function parse_coupon_list( $list ) {
|
||||||
|
$codes = array();
|
||||||
|
|
||||||
|
foreach ( preg_split( '/[\s,]+/', (string) $list ) as $code ) {
|
||||||
|
$code = wc_format_coupon_code( $code );
|
||||||
|
if ( '' !== $code ) {
|
||||||
|
$codes[] = $code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_values( array_unique( $codes ) );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a group and its related rows.
|
* Delete a group and its related rows.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class WC_EDM_Frontend {
|
|||||||
*/
|
*/
|
||||||
public function key_packages_to_match( $packages ) {
|
public function key_packages_to_match( $packages ) {
|
||||||
$match = $this->get_current_match();
|
$match = $this->get_current_match();
|
||||||
$key = $match ? (int) $match->id : 0;
|
$key = ( $match ? (int) $match->id : 0 ) . ':' . $this->shipping_group_id( $match );
|
||||||
|
|
||||||
foreach ( $packages as $index => $package ) {
|
foreach ( $packages as $index => $package ) {
|
||||||
$packages[ $index ]['wc_edm_match'] = $key;
|
$packages[ $index ]['wc_edm_match'] = $key;
|
||||||
@@ -368,11 +368,12 @@ class WC_EDM_Frontend {
|
|||||||
*/
|
*/
|
||||||
public function filter_shipping_rates( $rates, $package ) {
|
public function filter_shipping_rates( $rates, $package ) {
|
||||||
$match = $this->get_current_match();
|
$match = $this->get_current_match();
|
||||||
|
$group_id = $this->shipping_group_id( $match );
|
||||||
|
|
||||||
// $match is null for a customer who matches nothing — the common case,
|
// 0 for a customer who matches nothing and holds no linked coupon —
|
||||||
// and the one this whole method exists to constrain now.
|
// the common case, and the one this whole method exists to constrain.
|
||||||
if ( $match && 'group' === $match->assignment_type && $match->group_id ) {
|
if ( $group_id ) {
|
||||||
$rates = $this->apply_group_shipping_rules( $rates, (int) $match->group_id );
|
$rates = $this->apply_group_shipping_rules( $rates, $group_id );
|
||||||
} else {
|
} else {
|
||||||
// 🔴 Everyone else — including a matched customer whose assignment
|
// 🔴 Everyone else — including a matched customer whose assignment
|
||||||
// is not a group — must not see a method some group reserved.
|
// is not a group — must not see a method some group reserved.
|
||||||
@@ -397,6 +398,28 @@ class WC_EDM_Frontend {
|
|||||||
return $rates;
|
return $rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The group whose shipping rules apply to this customer, or 0.
|
||||||
|
*
|
||||||
|
* An email assigned to a group wins. Otherwise a coupon in the cart that a
|
||||||
|
* group lists under "Coupon codes" gives that group's shipping rules — the
|
||||||
|
* shipping only; the group's percentage discount stays with its emails.
|
||||||
|
*
|
||||||
|
* @param object|null $match Email assignment row.
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
private function shipping_group_id( $match ) {
|
||||||
|
if ( $match && 'group' === $match->assignment_type && $match->group_id ) {
|
||||||
|
return (int) $match->group_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! function_exists( 'WC' ) || ! WC()->cart ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return WC_EDM_DB::group_for_coupons( WC()->cart->get_applied_coupons() );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove every method some group reserved for itself.
|
* Remove every method some group reserved for itself.
|
||||||
*
|
*
|
||||||
|
|||||||
+52
-1
@@ -343,10 +343,61 @@ WC()->customer->set_billing_email( '[email protected]' );
|
|||||||
$wc_edm_pkg_b = wc_edm()->frontend->key_packages_to_match( array( array( 'contents' => array() ) ) );
|
$wc_edm_pkg_b = wc_edm()->frontend->key_packages_to_match( array( array( 'contents' => array() ) ) );
|
||||||
wc_edm_ok(
|
wc_edm_ok(
|
||||||
'a shipping package carries the match, so cached rates do not outlive a change of email',
|
'a shipping package carries the match, so cached rates do not outlive a change of email',
|
||||||
$wc_edm_pkg_a[0]['wc_edm_match'] > 0 && 0 === $wc_edm_pkg_b[0]['wc_edm_match'],
|
$wc_edm_pkg_a[0]['wc_edm_match'] !== $wc_edm_pkg_b[0]['wc_edm_match'] && '0:0' === $wc_edm_pkg_b[0]['wc_edm_match'],
|
||||||
sprintf( 'matched %s, unmatched %s', var_export( $wc_edm_pkg_a[0]['wc_edm_match'], true ), var_export( $wc_edm_pkg_b[0]['wc_edm_match'], true ) )
|
sprintf( 'matched %s, unmatched %s', var_export( $wc_edm_pkg_a[0]['wc_edm_match'], true ), var_export( $wc_edm_pkg_b[0]['wc_edm_match'], true ) )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// A coupon can carry a group's shipping rules: whoever has it in the cart gets
|
||||||
|
// the group's methods, including the ones it reserved ("Only"), whatever the
|
||||||
|
// email. Reported from a live shop: free delivery reserved for one company's
|
||||||
|
// addresses had to reach people using that company's coupon as well.
|
||||||
|
wc_edm_is( 'a coupon list is split and normalised', array( 'teamx', 'b', 'c' ), WC_EDM_DB::parse_coupon_list( ' TeamX, b c,,' ) );
|
||||||
|
global $wpdb;
|
||||||
|
wc_edm_ok(
|
||||||
|
'the groups table has the coupon column',
|
||||||
|
null !== $wpdb->get_row( 'SHOW COLUMNS FROM ' . WC_EDM_DB::table( 'groups' ) . " LIKE 'shipping_coupons'" ) // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery
|
||||||
|
);
|
||||||
|
WC_EDM_DB::replace_shipping_rules(
|
||||||
|
(int) $fixtures['group_id'],
|
||||||
|
array( array( 'shipping_method_id' => 'flat_rate:1', 'action' => 'only', 'sort_order' => 0 ) )
|
||||||
|
);
|
||||||
|
WC_EDM_DB::set_group_shipping_coupons( (int) $fixtures['group_id'], array( 'CIflat10' ) );
|
||||||
|
wc_edm_is( 'a group remembers its shipping coupons, normalised', array( 'ciflat10' ), WC_EDM_DB::get_group_shipping_coupons( (int) $fixtures['group_id'] ) );
|
||||||
|
wc_edm_is( 'the coupon leads to its group', (int) $fixtures['group_id'], WC_EDM_DB::group_for_coupons( array( 'ciflat10' ) ) );
|
||||||
|
wc_edm_is( 'an unlinked coupon leads nowhere', 0, WC_EDM_DB::group_for_coupons( array( 'something-else' ) ) );
|
||||||
|
|
||||||
|
$wc_edm_ship_rates = array(
|
||||||
|
'flat_rate:1' => new WC_Shipping_Rate( 'flat_rate:1', 'Flat rate', 10, array(), 'flat_rate' ),
|
||||||
|
'local_pickup:2' => new WC_Shipping_Rate( 'local_pickup:2', 'Local pickup', 0, array(), 'local_pickup' ),
|
||||||
|
);
|
||||||
|
wc_edm_cart_for( '[email protected]', array( $fixtures['product_in'] => 1 ) );
|
||||||
|
wc_edm_is(
|
||||||
|
'without the coupon a stranger does not see the reserved method',
|
||||||
|
array( 'local_pickup:2' ),
|
||||||
|
array_keys( wc_edm()->frontend->filter_shipping_rates( $wc_edm_ship_rates, array() ) )
|
||||||
|
);
|
||||||
|
WC()->cart->apply_coupon( 'ciflat10' );
|
||||||
|
WC()->cart->calculate_totals();
|
||||||
|
wc_edm_is(
|
||||||
|
'with the linked coupon the same stranger gets the group shipping rules',
|
||||||
|
array( 'flat_rate:1' ),
|
||||||
|
array_keys( wc_edm()->frontend->filter_shipping_rates( $wc_edm_ship_rates, array() ) )
|
||||||
|
);
|
||||||
|
wc_edm_is( 'but not the group percentage discount', 0.0, wc_edm_discount_total() );
|
||||||
|
$wc_edm_pkg_c = wc_edm()->frontend->key_packages_to_match( array( array( 'contents' => array() ) ) );
|
||||||
|
wc_edm_is( 'and the package key carries the coupon group', '0:' . (int) $fixtures['group_id'], $wc_edm_pkg_c[0]['wc_edm_match'] );
|
||||||
|
WC()->cart->remove_coupons();
|
||||||
|
WC()->cart->calculate_totals();
|
||||||
|
wc_edm_is(
|
||||||
|
'removing the coupon takes the reserved method away again',
|
||||||
|
array( 'local_pickup:2' ),
|
||||||
|
array_keys( wc_edm()->frontend->filter_shipping_rates( $wc_edm_ship_rates, array() ) )
|
||||||
|
);
|
||||||
|
WC_EDM_DB::set_group_shipping_coupons( (int) $fixtures['group_id'], array() );
|
||||||
|
wc_edm_is( 'an empty list unlinks the coupon', 0, WC_EDM_DB::group_for_coupons( array( 'ciflat10' ) ) );
|
||||||
|
WC_EDM_DB::replace_shipping_rules( (int) $fixtures['group_id'], array() );
|
||||||
|
WC()->customer->set_billing_email( '[email protected]' );
|
||||||
|
|
||||||
// 🔴 The tracking endpoint answers anonymous visitors. It used to return
|
// 🔴 The tracking endpoint answers anonymous visitors. It used to return
|
||||||
// `matched: true|false`, which told a stranger which addresses and domains the
|
// `matched: true|false`, which told a stranger which addresses and domains the
|
||||||
// shop discounts, one request per guess. The answer must be the same bare
|
// shop discounts, one request per guess. The answer must be the same bare
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* Plugin URI: https://gitea.nolimit.dk/kw/woo-discount-manager
|
* Plugin URI: https://gitea.nolimit.dk/kw/woo-discount-manager
|
||||||
* Update URI: https://gitea.nolimit.dk/kw/nolimit-discounts-dist
|
* Update URI: https://gitea.nolimit.dk/kw/nolimit-discounts-dist
|
||||||
* Description: Apply discounts and show/hide shipping methods based on the customer's email address (full address, domain or partial match).
|
* Description: Apply discounts and show/hide shipping methods based on the customer's email address (full address, domain or partial match).
|
||||||
* Version: 1.7.1
|
* Version: 1.8.0
|
||||||
* Author: Kristian Wind
|
* Author: Kristian Wind
|
||||||
* Author URI: https://gitea.nolimit.dk/kw
|
* Author URI: https://gitea.nolimit.dk/kw
|
||||||
* License: GPL-2.0-or-later
|
* License: GPL-2.0-or-later
|
||||||
@@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
define( 'WC_EDM_VERSION', '1.7.1' );
|
define( 'WC_EDM_VERSION', '1.8.0' );
|
||||||
define( 'WC_EDM_PLUGIN_FILE', __FILE__ );
|
define( 'WC_EDM_PLUGIN_FILE', __FILE__ );
|
||||||
define( 'WC_EDM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
define( 'WC_EDM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||||
define( 'WC_EDM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
define( 'WC_EDM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user