| 1 |
<?php |
| 2 |
|
| 3 |
namespace StoreEngine\Shortcode; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
use StoreEngine\Utils\Formatting; |
| 10 |
use StoreEngine\Utils\Helper; |
| 11 |
use StoreEngine\Utils\Template; |
| 12 |
|
| 13 |
class MiniCart { |
| 14 |
|
| 15 |
public function __construct() { |
| 16 |
add_shortcode( 'storeengine_mini_cart', array( $this, 'render' ) ); |
| 17 |
} |
| 18 |
|
| 19 |
public function render( $atts ) { |
| 20 |
do_action( 'storeengine/cart/check_items' ); |
| 21 |
|
| 22 |
return Template::get_template_content( 'shortcode/mini-cart.php', [ |
| 23 |
'item_count' => Helper::cart()->get_count(), |
| 24 |
'cart_url' => Helper::get_page_permalink( 'cart_page' ), |
| 25 |
] ); |
| 26 |
} |
| 27 |
} |
| 28 |
|