| 1 |
<?php |
| 2 |
namespace StoreEngine\Shortcode; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
use StoreEngine\Utils\Helper; |
| 9 |
use StoreEngine\Utils\Template; |
| 10 |
|
| 11 |
class SingleProduct { |
| 12 |
|
| 13 |
public function __construct() { |
| 14 |
add_shortcode( 'storeengine_single_product', array( $this, 'render' ) ); |
| 15 |
} |
| 16 |
|
| 17 |
public function render(): string { |
| 18 |
ob_start(); |
| 19 |
Template::get_template( 'single-product.php' ); |
| 20 |
$output = Helper::remove_line_break( ob_get_clean() ); |
| 21 |
return Helper::remove_tag_space( $output ); |
| 22 |
} |
| 23 |
} |
| 24 |
|