PluginProbe
Tiered Pricing Table for WooCommerce / trunk
Tiered Pricing Table for WooCommerce vtrunk
7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 All 90 releases
tier-pricing-table / src / Addons / AdvancedQuantityOptions / ProductOptions.php

ProductOptions.php in Tiered Pricing Table for WooCommerce trunk, at src/Addons/AdvancedQuantityOptions/ProductOptions.php

48 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TierPricingTable\Addons\AdvancedQuantityOptions;
4
5 class ProductOptions {
6 /**
7 * Form
8 *
9 * @var AdvancedQuantityOptionsForm
10 */
11 protected $form;
12
13 public function __construct( AdvancedQuantityOptionsForm $form ) {
14 $this->form = $form;
15 // Rendering
16 add_action(
17 'tiered_pricing_table/admin/after_minimum_order_quantity_field',
18 function ( $productId, $loop ) {
19 $this->form->render( $productId, $loop );
20 },
21 10,
22 2
23 );
24 add_action(
25 'tiered_pricing_table/admin/after_variation_minimum_order_quantity_field',
26 array($this->form, 'render'),
27 10,
28 2
29 );
30 }
31
32 public function save( $productId, $loop = null ) {
33 DataProvider::updateFromRequest(
34 'maximum',
35 $productId,
36 null,
37 $loop
38 );
39 DataProvider::updateFromRequest(
40 'group_of',
41 $productId,
42 null,
43 $loop
44 );
45 }
46
47 }
48