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 / API / QuantityStep.php

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

31 lines 799 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\AdvancedQuantityOptions\API;
2
3 use TierPricingTable\Addons\AdvancedQuantityOptions\DataProvider;
4 use TierPricingTable\Services\API\ProductFields\ProductField;
5 use WC_Product;
6
7 class QuantityStep extends ProductField {
8
9 public function getFieldSlug(): string {
10 return 'tiered_pricing_quantity_step';
11 }
12
13 public function getValue( array $product ) {
14 return DataProvider::getGroupOfQuantity( $product['id'], null, 'edit' );
15 }
16
17 public function updateValue( $value, WC_Product $product ) {
18 $value = empty( $value ) ? null : (int) $value;
19
20 DataProvider::updateGroupOfQuantity( $product->get_id(), $value );
21 }
22
23 public function getType(): string {
24 return 'string';
25 }
26
27 public function getDescription(): string {
28 return 'Quantity step.';
29 }
30 }
31