| 1 |
<?php |
| 2 |
/** |
| 3 |
* Drawer: Floating Cart Button. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/orderable/drawer/floating-cart.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 |
|
| 16 |
defined( 'ABSPATH' ) || exit; |
| 17 |
|
| 18 |
$position = Orderable_Settings::get_setting( 'style_cart_position' ); |
| 19 |
|
| 20 |
if ( 'none' === $position ) { |
| 21 |
return; |
| 22 |
} |
| 23 |
|
| 24 |
$cart_count = WC()->cart->get_cart_contents_count(); |
| 25 |
$style = Orderable_Drawer_Settings::get_cart_icon_css(); |
| 26 |
?> |
| 27 |
|
| 28 |
<div class="orderable-floating-cart orderable-floating-cart--<?php echo esc_attr( $position ); ?>" data-orderable-trigger="cart" style="<?php echo esc_attr( $style ); ?>"> |
| 29 |
<button class="orderable-floating-cart__button"><?php echo file_get_contents( ORDERABLE_PATH . 'assets/icons/basket.svg' ); ?></button> |
| 30 |
<span class="orderable-floating-cart__count"><?php echo wp_kses_data( $cart_count ); ?></span> |
| 31 |
</div> |
| 32 |
|