PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.5.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.5.0
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Services / Renderer / ProductModalRenderer.php

ProductModalRenderer.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.5.0, at app/Services/Renderer/ProductModalRenderer.php

62 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace FluentCart\App\Services\Renderer;
3
4 use FluentCart\Api\StoreSettings;
5 use FluentCart\App\Models\Product;
6
7 class ProductModalRenderer
8 {
9 protected $product;
10 protected $config = [];
11 protected $storeSettings;
12
13 public function __construct(Product $product, $config = [])
14 {
15 $this->product = $product;
16 $this->config = $config;
17 $this->storeSettings = new StoreSettings();
18 }
19
20 public function render()
21 {
22 ?>
23 <div
24 class="fct-product-modal"
25 data-fluent-cart-shop-app-single-product-modal
26 role="dialog"
27 aria-modal="true"
28 aria-label="<?php esc_attr($this->product->post_title); ?>"
29 >
30 <div
31 data-fluent-cart-shop-app-single-product-modal-overlay
32 class="fct-product-modal-overlay"
33 role="presentation"
34 aria-hidden="true"
35 >
36 </div>
37 <div class="fct-product-modal-body">
38 <button
39 class="fct-product-modal-close"
40 data-fluent-cart-shop-app-single-product-modal-close
41 type="button"
42 aria-label="<?php esc_attr_e('Close product modal', 'fluent-cart'); ?>"
43 >
44 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
45 <path d="M12.8337 1.16663L1.16699 12.8333M1.16699 1.16663L12.8337 12.8333" stroke="#2F3448" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
46 </svg>
47 </button>
48
49 <?php
50 (new ProductRenderer($this->product, [
51 'view_type' => $this->storeSettings->get('variation_view', 'both'),
52 'column_type' => $this->storeSettings->get('variation_columns', 'masonry')
53 ]))->render();
54 ?>
55 </div>
56 </div>
57 <?php
58
59 }
60
61 }
62