class-wcml-woo-var-table.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | class WCML_Woo_Var_Table implements \IWPML_Action { |
| 4 | |
| 5 | private $current_language; |
| 6 | |
| 7 | public function __construct( $current_language ) { |
| 8 | $this->current_language = $current_language; |
| 9 | } |
| 10 | |
| 11 | public function add_hooks() { |
| 12 | |
| 13 | add_filter( 'vartable_add_to_cart_product_id', [ $this, 'filter_add_to_cart_product_id' ] ); |
| 14 | } |
| 15 | |
| 16 | public function filter_add_to_cart_product_id( $product_id ) { |
| 17 | |
| 18 | $product_id = apply_filters( 'wpml_object_id', $product_id, get_post_type( $product_id ), true, $this->current_language ); |
| 19 | |
| 20 | return $product_id; |
| 21 | } |
| 22 | |
| 23 | } |
| 24 |