| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template: Product Actions. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/orderable/actions.php |
| 6 |
* |
| 7 |
* HOWEVER, on occasion Orderable will need to update template files and you |
| 8 |
* (the theme developer) will need to copy the new files to your theme to |
| 9 |
* maintain compatibility. We try to do this as little as possible, but it does |
| 10 |
* happen. When this occurs the version of the template file will be bumped and |
| 11 |
* the readme will list any important changes. |
| 12 |
* |
| 13 |
* @package Orderable/Templates |
| 14 |
* |
| 15 |
* @var WC_Product_Variable $product Product. |
| 16 |
*/ |
| 17 |
|
| 18 |
defined( 'ABSPATH' ) || exit; |
| 19 |
?> |
| 20 |
|
| 21 |
<?php |
| 22 |
/** |
| 23 |
* Fires before product actions in the product card. |
| 24 |
* |
| 25 |
* @since 1.7.0 |
| 26 |
* @hook orderable_before_product_actions |
| 27 |
* @param WC_Product $product The product. |
| 28 |
* @param array $args Layout settings. |
| 29 |
*/ |
| 30 |
do_action( 'orderable_before_product_actions', $product, $args ); |
| 31 |
?> |
| 32 |
|
| 33 |
<div class="orderable-product__actions"> |
| 34 |
<div class="orderable-product__actions-price"> |
| 35 |
<?php echo $product->get_price_html(); ?> |
| 36 |
</div> |
| 37 |
<div class="orderable-product__actions-button"> |
| 38 |
<?php |
| 39 |
if ( |
| 40 |
! empty( $args['quantity_roller'] ) && |
| 41 |
! $product->is_type( 'variable' ) && |
| 42 |
( ! class_exists( 'Orderable_Pro_Conditions_Matcher' ) || empty( Orderable_Pro_Conditions_Matcher::get_applicable_cpt( 'orderable_addons', $product ) ) ) |
| 43 |
) { |
| 44 |
$cart_item = wp_doing_ajax() ? array() : Orderable_Helpers::is_product_in_the_cart( $product->get_id() ); |
| 45 |
|
| 46 |
Orderable_Products::get_quantity_roller( $cart_item ); |
| 47 |
} |
| 48 |
|
| 49 |
if ( empty( $cart_item_key ) ) { |
| 50 |
echo wp_kses_post( Orderable_Products::get_add_to_cart_button( $product, 'orderable-product__add-to-order', $args ) ); |
| 51 |
} else { |
| 52 |
echo wp_kses_post( Orderable_Products::get_update_cart_item_button( $cart_item_key, $product, 'orderable-product__update-cart-item orderable-button--filled' ) ); |
| 53 |
} |
| 54 |
?> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
|