| 1 |
<?php |
| 2 |
|
| 3 |
namespace RadiusTheme\SB\Modules\CheckoutEditor; |
| 4 |
|
| 5 |
// Do not allow directly accessing this file. |
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit( 'This script cannot be accessed directly.' ); |
| 8 |
} |
| 9 |
|
| 10 |
use RadiusTheme\SB\Traits\SingletonTrait; |
| 11 |
|
| 12 |
/** |
| 13 |
* CheckoutEditorInit |
| 14 |
*/ |
| 15 |
class ShippingFields extends CheckoutEditorBase { |
| 16 |
/** |
| 17 |
* Singleton Trait. |
| 18 |
*/ |
| 19 |
use SingletonTrait; |
| 20 |
|
| 21 |
/** |
| 22 |
* Notifications hooks. |
| 23 |
*/ |
| 24 |
private function __construct() { |
| 25 |
parent::__construct(); |
| 26 |
add_filter( 'woocommerce_shipping_fields', [ $this, 'shipping_fields_generator' ], 9999, 2 ); |
| 27 |
} |
| 28 |
|
| 29 |
/** |
| 30 |
* @param array $address_fields fields. |
| 31 |
* @param array $country fields. |
| 32 |
* @return array |
| 33 |
*/ |
| 34 |
public function shipping_fields_generator( $address_fields, $country ) { |
| 35 |
return $this->render_fields( $this->shipping_settings, $address_fields ); |
| 36 |
} |
| 37 |
} |
| 38 |
|