| 1 |
<?php namespace TierPricingTable\Addons\ReactProductEditorAddon; |
| 2 |
|
| 3 |
use Automattic\WooCommerce\Admin\BlockTemplates\BlockInterface; |
| 4 |
|
| 5 |
class TieredPricingGroup { |
| 6 |
|
| 7 |
const ID = 'tiered-pricing/group'; |
| 8 |
|
| 9 |
public function __construct() { |
| 10 |
add_action( 'woocommerce_block_template_area_product-form_after_add_block_general', |
| 11 |
array( $this, 'addGroup' ) ); |
| 12 |
} |
| 13 |
|
| 14 |
public function addGroup( BlockInterface $generalGroup ) { |
| 15 |
$parent = $generalGroup->get_parent(); |
| 16 |
|
| 17 |
$parent->add_group( [ |
| 18 |
'id' => self::ID, |
| 19 |
'order' => $generalGroup->get_order() + 5, |
| 20 |
'attributes' => [ |
| 21 |
'title' => __( 'Tiered Pricing', 'tier-pricing-table' ), |
| 22 |
], |
| 23 |
] ); |
| 24 |
} |
| 25 |
} |
| 26 |
|