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 +34 -0 1.3.491.4.17 View file →
@@ -17,8 +17,12 @@
17 17 * @subpackage App\Utility
18 18 * @author Ohidul Islam <wahid0003@gmail.com>
19 19 * @link https://webappick.com
20 20 * @property false|mixed|string $filter
21 + * @property string $discount_valid_from
22 + * @property string $discount_valid_to
23 + * @property int|string $id
24 + * @property int|string $discount_max_user
21 25 * @license https://opensource.org/licenses/gpl-license.php GNU Public License
22 26 * @category Utility
23 27 */
24 28 class Config {
@@ -103,8 +107,10 @@
103 107 'discount_based_on' => '',
104 108 'discount_label' => '',
105 109 'discount_max_user' => '',
106 110 'bogo_type' => '',
111 + 'count_quantity_as' => 'separate',
112 + 'free_item_selection' => 'cart_order',
107 113 'discount_valid_from' => '',
108 114 'discount_valid_to' => '',
109 115 'discount_method' => 'automated',
110 116 'discount_coupon' => '',
@@ -172,8 +178,36 @@
172 178 * @return string
173 179 */
174 180 public function get_bogo_type() {
175 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'];
176 210 }
177 211
178 212 /**
179 213 * Get Discount Rules