PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.17
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.17
1.4.17 1.4.16 1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 All 180 releases
← All changes | app/Utility/Config.php +32 -0 1.4.11.4.17 View file →
@@ -19,8 +19,10 @@
19 19 * @link https://webappick.com
20 20 * @property false|mixed|string $filter
21 21 * @property string $discount_valid_from
22 22 * @property string $discount_valid_to
23 + * @property int|string $id
24 + * @property int|string $discount_max_user
23 25 * @license https://opensource.org/licenses/gpl-license.php GNU Public License
24 26 * @category Utility
25 27 */
26 28 class Config {
@@ -105,8 +107,10 @@
105 107 'discount_based_on' => '',
106 108 'discount_label' => '',
107 109 'discount_max_user' => '',
108 110 'bogo_type' => '',
111 + 'count_quantity_as' => 'separate',
112 + 'free_item_selection' => 'cart_order',
109 113 'discount_valid_from' => '',
110 114 'discount_valid_to' => '',
111 115 'discount_method' => 'automated',
112 116 'discount_coupon' => '',
@@ -174,8 +178,36 @@
174 178 * @return string
175 179 */
176 180 public function get_bogo_type() {
177 181 return $this->config['bogo_type'];
182 + }
183 +
184 + /**
185 + * Get Count Quantity As.
186 + * How item quantities aggregate toward the tier min/max.
187 + *
188 + * @return string One of: separate, variations, filters.
189 + */
190 + public function get_count_quantity_as(): string {
191 + if ( empty( $this->config['count_quantity_as'] ) ) {
192 + return 'separate';
193 + }
194 +
195 + return $this->config['count_quantity_as'];
196 + }
197 +
198 + /**
199 + * Get Free Item Selection (BOGO).
200 + * Which qualifying item receives the free / discounted reward.
201 + *
202 + * @return string One of: cart_order, lowest, highest.
203 + */
204 + public function get_free_item_selection(): string {
205 + if ( empty( $this->config['free_item_selection'] ) ) {
206 + return 'cart_order';
207 + }
208 +
209 + return $this->config['free_item_selection'];
178 210 }
179 211
180 212 /**
181 213 * Get Discount Rules