- $
+
+
+
+ $
+ $
+
+ $
+
-
diff --git a/wordpress-plugin/widgets/single-product.php b/wordpress-plugin/widgets/single-product.php
index 9d7bcaeb..4a23e8d4 100644
--- a/wordpress-plugin/widgets/single-product.php
+++ b/wordpress-plugin/widgets/single-product.php
@@ -7,14 +7,14 @@ if (!defined('ABSPATH')) {
exit;
}
-class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
+class CannaIQ_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
public function get_name() {
- return 'crawlsy_single_product';
+ return 'cannaiq_single_product';
}
public function get_title() {
- return __('Crawlsy Single Product', 'crawlsy-menus');
+ return __('CannaIQ Single Product', 'cannaiq-menus');
}
public function get_icon() {
@@ -31,9 +31,9 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
* @return array Associative array of product_id => product_name
*/
protected function get_products_for_select() {
- $options = ['' => __('-- Select a Product --', 'crawlsy-menus')];
+ $options = ['' => __('-- Select a Product --', 'cannaiq-menus')];
- $plugin = Crawlsy_Menus_Plugin::instance();
+ $plugin = CannaIQ_Menus_Plugin::instance();
$products = $plugin->fetch_products(['limit' => 500]);
if ($products && is_array($products)) {
@@ -58,7 +58,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->start_controls_section(
'content_section',
[
- 'label' => __('Content', 'crawlsy-menus'),
+ 'label' => __('Content', 'cannaiq-menus'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
@@ -69,22 +69,22 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'product_id',
[
- 'label' => __('Select Product', 'crawlsy-menus'),
+ 'label' => __('Select Product', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SELECT2,
'options' => $products_options,
'default' => '',
'label_block' => true,
- 'description' => __('Search and select a product to display', 'crawlsy-menus'),
+ 'description' => __('Search and select a product to display', 'cannaiq-menus'),
]
);
$this->add_control(
'product_id_manual',
[
- 'label' => __('Or Enter Product ID', 'crawlsy-menus'),
+ 'label' => __('Or Enter Product ID', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => '',
- 'description' => __('Manually enter a product ID if not found in dropdown', 'crawlsy-menus'),
+ 'description' => __('Manually enter a product ID if not found in dropdown', 'cannaiq-menus'),
'condition' => [
'product_id' => '',
],
@@ -94,12 +94,12 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'layout',
[
- 'label' => __('Layout', 'crawlsy-menus'),
+ 'label' => __('Layout', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'horizontal',
'options' => [
- 'horizontal' => __('Horizontal', 'crawlsy-menus'),
- 'vertical' => __('Vertical', 'crawlsy-menus'),
+ 'horizontal' => __('Horizontal', 'cannaiq-menus'),
+ 'vertical' => __('Vertical', 'cannaiq-menus'),
],
]
);
@@ -110,7 +110,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->start_controls_section(
'display_section',
[
- 'label' => __('Display Options', 'crawlsy-menus'),
+ 'label' => __('Display Options', 'cannaiq-menus'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
@@ -118,10 +118,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_image',
[
- 'label' => __('Show Image', 'crawlsy-menus'),
+ 'label' => __('Show Image', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -130,10 +130,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_price',
[
- 'label' => __('Show Price', 'crawlsy-menus'),
+ 'label' => __('Show Price', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -142,10 +142,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_description',
[
- 'label' => __('Show Description', 'crawlsy-menus'),
+ 'label' => __('Show Description', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -154,10 +154,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_thc',
[
- 'label' => __('Show THC', 'crawlsy-menus'),
+ 'label' => __('Show THC', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -166,10 +166,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_cbd',
[
- 'label' => __('Show CBD', 'crawlsy-menus'),
+ 'label' => __('Show CBD', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -178,10 +178,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_terpenes',
[
- 'label' => __('Show Terpenes', 'crawlsy-menus'),
+ 'label' => __('Show Terpenes', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -190,10 +190,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_effects',
[
- 'label' => __('Show Effects', 'crawlsy-menus'),
+ 'label' => __('Show Effects', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -202,10 +202,10 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'show_brand',
[
- 'label' => __('Show Brand', 'crawlsy-menus'),
+ 'label' => __('Show Brand', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => __('Yes', 'crawlsy-menus'),
- 'label_off' => __('No', 'crawlsy-menus'),
+ 'label_on' => __('Yes', 'cannaiq-menus'),
+ 'label_off' => __('No', 'cannaiq-menus'),
'return_value' => 'yes',
'default' => 'yes',
]
@@ -217,7 +217,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->start_controls_section(
'style_section',
[
- 'label' => __('Style', 'crawlsy-menus'),
+ 'label' => __('Style', 'cannaiq-menus'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
@@ -225,11 +225,11 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'background_color',
[
- 'label' => __('Background Color', 'crawlsy-menus'),
+ 'label' => __('Background Color', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
- '{{WRAPPER}} .crawlsy-single-product' => 'background-color: {{VALUE}};',
+ '{{WRAPPER}} .cannaiq-single-product' => 'background-color: {{VALUE}};',
],
]
);
@@ -237,7 +237,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'border_radius',
[
- 'label' => __('Border Radius', 'crawlsy-menus'),
+ 'label' => __('Border Radius', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
@@ -250,7 +250,7 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
'size' => 8,
],
'selectors' => [
- '{{WRAPPER}} .crawlsy-single-product' => 'border-radius: {{SIZE}}{{UNIT}};',
+ '{{WRAPPER}} .cannaiq-single-product' => 'border-radius: {{SIZE}}{{UNIT}};',
],
]
);
@@ -258,11 +258,11 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$this->add_control(
'text_color',
[
- 'label' => __('Text Color', 'crawlsy-menus'),
+ 'label' => __('Text Color', 'cannaiq-menus'),
'type' => \Elementor\Controls_Manager::COLOR,
'default' => '#333333',
'selectors' => [
- '{{WRAPPER}} .crawlsy-single-product' => 'color: {{VALUE}};',
+ '{{WRAPPER}} .cannaiq-single-product' => 'color: {{VALUE}};',
],
]
);
@@ -277,93 +277,88 @@ class Crawlsy_Menus_Single_Product_Widget extends \Elementor\Widget_Base {
$product_id = !empty($settings['product_id']) ? $settings['product_id'] : $settings['product_id_manual'];
if (empty($product_id)) {
- echo '
' . __('Please select or enter a product ID.', 'crawlsy-menus') . '
';
+ echo '
' . __('Please select or enter a product ID.', 'cannaiq-menus') . '
';
return;
}
- $plugin = Crawlsy_Menus_Plugin::instance();
+ $plugin = CannaIQ_Menus_Plugin::instance();
$product = $plugin->fetch_product($product_id);
if (!$product) {
- echo '
' . __('Product not found.', 'crawlsy-menus') . '
';
+ echo '
' . __('Product not found.', 'cannaiq-menus') . '
';
return;
}
$layout = $settings['layout'];
+ $image_url = $product['image_url'] ?? '';
?>
-
-
-
-
; ?>)
+
+
+
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
+
+ %
-
-
-
-
+
+
+
+ %
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- $
+
+
+
+ $
+ $
+
+ $
+
-