| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Modules\Templating\BlockTemplates; |
| 4 |
|
| 5 |
/** |
| 6 |
* ProductCategoryTemplate class. |
| 7 |
* |
| 8 |
*/ |
| 9 |
class ProductPageTemplate |
| 10 |
{ |
| 11 |
|
| 12 |
/** |
| 13 |
* The slug of the template. |
| 14 |
* |
| 15 |
* @var string |
| 16 |
*/ |
| 17 |
const SLUG = 'single-fluent-products'; |
| 18 |
|
| 19 |
/** |
| 20 |
* Initialization method. |
| 21 |
*/ |
| 22 |
public function init() |
| 23 |
{ |
| 24 |
register_block_template('fluent-cart//single-fluent-products', [ |
| 25 |
'title' => $this->getTitle(), |
| 26 |
'description' => $this->getDescription(), |
| 27 |
'content' => $this->getDefaultTemplate(), |
| 28 |
]); |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Returns the title of the template. |
| 33 |
* |
| 34 |
* @return string |
| 35 |
*/ |
| 36 |
public function getTitle() |
| 37 |
{ |
| 38 |
return _x('Single Product', 'Template name', 'fluent-cart'); |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Returns the description of the template. |
| 43 |
* |
| 44 |
* @return string |
| 45 |
*/ |
| 46 |
public function getDescription() |
| 47 |
{ |
| 48 |
return __('Displays Single FluentCart Product.', 'fluent-cart'); |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
public function getDefaultTemplate() |
| 53 |
{ |
| 54 |
ob_start(); |
| 55 |
?> |
| 56 |
|
| 57 |
|
| 58 |
<!-- wp:template-part {"slug":"header","tagName":"header","area":"header"} /--> |
| 59 |
|
| 60 |
<!-- wp:group {"tagName":"main","align":"full","className":"is-style-default","layout":{"type":"constrained"}} --> |
| 61 |
<main class="wp-block-group alignfull is-style-default"><!-- wp:group {"align":"wide","layout":{"type":"default"}} --> |
| 62 |
<div class="wp-block-group alignwide"><!-- wp:spacer {"height":"var:preset|spacing|40"} --> |
| 63 |
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div> |
| 64 |
<!-- /wp:spacer --> |
| 65 |
|
| 66 |
<!-- wp:fluent-cart/product-info --> |
| 67 |
<div class="wp-block-fluent-cart-product-info my-plugin-product-card"><div class="product-card-inner"><!-- wp:columns --> |
| 68 |
<div class="wp-block-columns"><!-- wp:column --> |
| 69 |
<div class="wp-block-column"><!-- wp:fluent-cart/product-gallery {"inside_product_info":"yes"} /--></div> |
| 70 |
<!-- /wp:column --> |
| 71 |
|
| 72 |
<!-- wp:column --> |
| 73 |
<div class="wp-block-column"><!-- wp:post-title /--> |
| 74 |
<!-- wp:fluent-cart/excerpt /--> |
| 75 |
|
| 76 |
<!-- wp:fluent-cart/price-range /--> |
| 77 |
|
| 78 |
<!-- wp:fluent-cart/stock /--> |
| 79 |
|
| 80 |
<!-- wp:fluent-cart/product-sku /--> |
| 81 |
|
| 82 |
<!-- wp:fluent-cart/product-package-description /--> |
| 83 |
|
| 84 |
<!-- wp:fluent-cart/buy-section {"inside_product_info":"yes"} /--></div> |
| 85 |
<!-- /wp:column --></div> |
| 86 |
<!-- /wp:columns --></div></div> |
| 87 |
<!-- /wp:fluent-cart/product-info --></div> |
| 88 |
<!-- /wp:group --> |
| 89 |
|
| 90 |
<!-- wp:post-content {"lock":{"move":false,"remove":true},"align":"wide","style":{"spacing":{"blockGap":"0","padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30"}}},"layout":{"type":"default"}} /--> |
| 91 |
|
| 92 |
<!-- wp:group {"align":"wide","layout":{"type":"default"}} --> |
| 93 |
<div class="wp-block-group alignwide"><!-- wp:shortcode --> |
| 94 |
[fluent_cart_related_products] |
| 95 |
<!-- /wp:shortcode --></div> |
| 96 |
<!-- /wp:group --></main> |
| 97 |
<!-- /wp:group --> |
| 98 |
|
| 99 |
<!-- wp:template-part {"slug":"footer","tagName":"footer","area":"footer"} /--> |
| 100 |
<?php |
| 101 |
return ob_get_clean(); |
| 102 |
} |
| 103 |
} |
| 104 |
|