Discount highest in group
Note: this requires the PW WooCommerce BOGO Pro version.
By default, our plugin will always discount the least-expensive items in the group and charge full price for the most-expensive items in the group.
So for example, if you have the following products in the cart:
1 x Green, $4
1 x Blue, $3
2 x Red, $2
2 x White, $1
And assuming all four products are Eligible Products as well as Discounted Products, the calculation will play out as follows:
Buy 2 at full price (Blue and Green) = $7
Get 1 for free (White) = $1 discount
Buy 2 at full price (Red and Red) = $4
Get 1 for free (White) = $1 discount
The “eligible items” are always the most expensive items first. If you instead want to do something like this:
Buy 2 at full price (Blue and Green) = $7
Get 1 for free (Red) = $2 discount
Buy 2 at full price (Red and White) = $3
Get 1 for free (White) = $1 discount
In this case, you are flipping the algorithm to discount the highest priced item in the group first. You can do this by taking the following steps:
1. Download the wp-config.php from your FTP server.
2. Keep a backup of wp-config.php in case there are problems.
3. Edit wp-config.php and scroll to the end and add the following bit of code:
Scroll towards the bottom, and before the line that says “Happy blogging.” add this code ABOVE that line:
define( 'PW_BOGO_DISCOUNT_HIGHEST_IN_GROUP', true ); /* That's all, stop editing! Happy blogging. */
4. Save the wp-config.php file and re-upload it to your server.
If you have any problems, replace wp-config.php with your backup file.
Let me know if you have any questions!