| 1 |
<?php |
| 2 |
|
| 3 |
namespace StoreEngine\Shortcode; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
use StoreEngine\Utils\Helper; |
| 10 |
use StoreEngine\Utils\Template; |
| 11 |
|
| 12 |
class CartListTable { |
| 13 |
public function __construct() { |
| 14 |
add_shortcode( 'storeengine_cart_list_table', array( $this, 'render_cart_list_table' ) ); |
| 15 |
} |
| 16 |
|
| 17 |
public function render_cart_list_table( $atts ) { |
| 18 |
$attributes = shortcode_atts( [ 'empty_message' => __( 'Your cart is currently empty.', 'storeengine' ) ], $atts ); |
| 19 |
|
| 20 |
Helper::cart(); |
| 21 |
do_action( 'storeengine/cart/check_items' ); |
| 22 |
|
| 23 |
ob_start(); |
| 24 |
Template::get_template( 'shortcode/cart-list-table.php', $attributes ); |
| 25 |
return ob_get_clean(); |
| 26 |
} |
| 27 |
} |
| 28 |
|