feat: Rename WordPress plugin to CannaIQ Menus v1.5.3
- Rename plugin from Crawlsy Menus to CannaIQ Menus - Update version to 1.5.3 - Update text domain to cannaiq-menus - Rename all CSS classes from crawlsy-* to cannaiq-* - Update shortcodes to [cannaiq_products] and [cannaiq_product] - Add backward compatibility for legacy shortcodes - Update download links on Home and LandingPage - Fix health panel Redis timeout issue - Add clear error message when backend not running 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,14 +7,14 @@ if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
class CannaIQ_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'crawlsy_product_grid';
|
||||
return 'cannaiq_product_grid';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return __('Crawlsy Product Grid', 'crawlsy-menus');
|
||||
return __('CannaIQ Product Grid', 'cannaiq-menus');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
@@ -31,7 +31,7 @@ class Crawlsy_Menus_Product_Grid_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,
|
||||
]
|
||||
);
|
||||
@@ -39,9 +39,9 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'store_id',
|
||||
[
|
||||
'label' => __('Store ID', 'crawlsy-menus'),
|
||||
'label' => __('Store ID', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::NUMBER,
|
||||
'default' => get_option('crawlsy_default_store_id', 1),
|
||||
'default' => get_option('cannaiq_default_store_id', 1),
|
||||
'min' => 1,
|
||||
]
|
||||
);
|
||||
@@ -49,17 +49,17 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'category_id',
|
||||
[
|
||||
'label' => __('Category ID', 'crawlsy-menus'),
|
||||
'label' => __('Category ID', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::NUMBER,
|
||||
'default' => '',
|
||||
'description' => __('Leave empty to show all categories', 'crawlsy-menus'),
|
||||
'description' => __('Leave empty to show all categories', 'cannaiq-menus'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'limit',
|
||||
[
|
||||
'label' => __('Number of Products', 'crawlsy-menus'),
|
||||
'label' => __('Number of Products', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::NUMBER,
|
||||
'default' => 12,
|
||||
'min' => 1,
|
||||
@@ -70,14 +70,14 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'columns',
|
||||
[
|
||||
'label' => __('Columns', 'crawlsy-menus'),
|
||||
'label' => __('Columns', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => '3',
|
||||
'options' => [
|
||||
'2' => __('2 Columns', 'crawlsy-menus'),
|
||||
'3' => __('3 Columns', 'crawlsy-menus'),
|
||||
'4' => __('4 Columns', 'crawlsy-menus'),
|
||||
'6' => __('6 Columns', 'crawlsy-menus'),
|
||||
'2' => __('2 Columns', 'cannaiq-menus'),
|
||||
'3' => __('3 Columns', 'cannaiq-menus'),
|
||||
'4' => __('4 Columns', 'cannaiq-menus'),
|
||||
'6' => __('6 Columns', 'cannaiq-menus'),
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -85,10 +85,10 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'in_stock_only',
|
||||
[
|
||||
'label' => __('In Stock Only', 'crawlsy-menus'),
|
||||
'label' => __('In Stock Only', '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',
|
||||
]
|
||||
@@ -97,10 +97,10 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'search',
|
||||
[
|
||||
'label' => __('Search Filter', 'crawlsy-menus'),
|
||||
'label' => __('Search Filter', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'default' => '',
|
||||
'description' => __('Filter products by name', 'crawlsy-menus'),
|
||||
'description' => __('Filter products by name', 'cannaiq-menus'),
|
||||
]
|
||||
);
|
||||
|
||||
@@ -110,7 +110,7 @@ class Crawlsy_Menus_Product_Grid_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_Product_Grid_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_Product_Grid_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_Product_Grid_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',
|
||||
]
|
||||
@@ -154,10 +154,10 @@ class Crawlsy_Menus_Product_Grid_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',
|
||||
]
|
||||
@@ -166,10 +166,10 @@ class Crawlsy_Menus_Product_Grid_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' => 'no',
|
||||
]
|
||||
@@ -181,7 +181,7 @@ class Crawlsy_Menus_Product_Grid_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,
|
||||
]
|
||||
);
|
||||
@@ -189,11 +189,11 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'card_background',
|
||||
[
|
||||
'label' => __('Card Background', 'crawlsy-menus'),
|
||||
'label' => __('Card Background', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .crawlsy-product-card' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .cannaiq-product-card' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -201,7 +201,7 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$this->add_control(
|
||||
'card_border_radius',
|
||||
[
|
||||
'label' => __('Border Radius', 'crawlsy-menus'),
|
||||
'label' => __('Border Radius', 'cannaiq-menus'),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
@@ -214,7 +214,7 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
'size' => 8,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .crawlsy-product-card' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .cannaiq-product-card' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -222,11 +222,11 @@ class Crawlsy_Menus_Product_Grid_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-product-card' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .cannaiq-product-card' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
@@ -251,66 +251,71 @@ class Crawlsy_Menus_Product_Grid_Widget extends \Elementor\Widget_Base {
|
||||
$args['search'] = $settings['search'];
|
||||
}
|
||||
|
||||
$plugin = Crawlsy_Menus_Plugin::instance();
|
||||
$plugin = CannaIQ_Menus_Plugin::instance();
|
||||
$products = $plugin->fetch_products($args);
|
||||
|
||||
if (!$products) {
|
||||
echo '<p>' . __('No products found.', 'crawlsy-menus') . '</p>';
|
||||
echo '<p>' . __('No products found.', 'cannaiq-menus') . '</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
$columns = $settings['columns'];
|
||||
?>
|
||||
<div class="crawlsy-product-grid crawlsy-grid-cols-<?php echo esc_attr($columns); ?>">
|
||||
<div class="cannaiq-product-grid cannaiq-grid-cols-<?php echo esc_attr($columns); ?>">
|
||||
<?php foreach ($products as $product):
|
||||
$image_url = $product['image_url'] ?? $product['primary_image_url'] ?? $product['image_url_full'] ?? '';
|
||||
$product_url = !empty($product['dutchie_url']) ? $product['dutchie_url'] : '#';
|
||||
$product_url = !empty($product['menu_url']) ? $product['menu_url'] : '#';
|
||||
?>
|
||||
<div class="crawlsy-product-card"
|
||||
<div class="cannaiq-product-card"
|
||||
<?php if ($product_url !== '#'): ?>onclick="window.open('<?php echo esc_url($product_url); ?>', '_blank')"<?php endif; ?>
|
||||
style="cursor: <?php echo ($product_url !== '#') ? 'pointer' : 'default'; ?>;">
|
||||
<?php if ($settings['show_image'] === 'yes' && !empty($image_url)): ?>
|
||||
<div class="crawlsy-product-image">
|
||||
<div class="cannaiq-product-image">
|
||||
<img src="<?php echo esc_url($image_url); ?>"
|
||||
alt="<?php echo esc_attr($product['name']); ?>"
|
||||
loading="lazy" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="crawlsy-product-content">
|
||||
<h3 class="crawlsy-product-title">
|
||||
<div class="cannaiq-product-content">
|
||||
<h3 class="cannaiq-product-title">
|
||||
<?php echo esc_html($product['name']); ?>
|
||||
</h3>
|
||||
|
||||
<?php if ($settings['show_description'] === 'yes' && !empty($product['description'])): ?>
|
||||
<p class="crawlsy-product-description">
|
||||
<p class="cannaiq-product-description">
|
||||
<?php echo esc_html(wp_trim_words($product['description'], 15)); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="crawlsy-product-meta">
|
||||
<?php if ($settings['show_thc'] === 'yes' && !empty($product['metadata']['thc'])): ?>
|
||||
<span class="crawlsy-meta-item crawlsy-thc">
|
||||
<strong>THC:</strong> <?php echo esc_html($product['metadata']['thc']); ?>
|
||||
<div class="cannaiq-product-meta">
|
||||
<?php if ($settings['show_thc'] === 'yes' && !empty($product['thc_percentage'])): ?>
|
||||
<span class="cannaiq-meta-item cannaiq-thc">
|
||||
<strong>THC:</strong> <?php echo esc_html($product['thc_percentage']); ?>%
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($settings['show_cbd'] === 'yes' && !empty($product['metadata']['cbd'])): ?>
|
||||
<span class="crawlsy-meta-item crawlsy-cbd">
|
||||
<strong>CBD:</strong> <?php echo esc_html($product['metadata']['cbd']); ?>
|
||||
<?php if ($settings['show_cbd'] === 'yes' && !empty($product['cbd_percentage'])): ?>
|
||||
<span class="cannaiq-meta-item cannaiq-cbd">
|
||||
<strong>CBD:</strong> <?php echo esc_html($product['cbd_percentage']); ?>%
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($settings['show_price'] === 'yes' && isset($product['price'])): ?>
|
||||
<div class="crawlsy-product-price">
|
||||
$<?php echo number_format($product['price'], 2); ?>
|
||||
<?php if ($settings['show_price'] === 'yes' && isset($product['regular_price'])): ?>
|
||||
<div class="cannaiq-product-price">
|
||||
<?php if (!empty($product['sale_price']) && $product['sale_price'] != $product['regular_price']): ?>
|
||||
<span class="cannaiq-price-sale">$<?php echo esc_html($product['sale_price']); ?></span>
|
||||
<span class="cannaiq-price-regular cannaiq-strikethrough">$<?php echo esc_html($product['regular_price']); ?></span>
|
||||
<?php else: ?>
|
||||
$<?php echo esc_html($product['regular_price']); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$product['in_stock']): ?>
|
||||
<div class="crawlsy-out-of-stock">
|
||||
<?php _e('Out of Stock', 'crawlsy-menus'); ?>
|
||||
<div class="cannaiq-out-of-stock">
|
||||
<?php _e('Out of Stock', 'cannaiq-menus'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user