Files
cannaiq/wordpress-plugin/templates/single-product.php
Kelly 948a732dd5 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>
2025-12-08 00:24:43 -07:00

84 lines
3.2 KiB
PHP

<?php
/**
* Template for Single Product (used by shortcode)
*/
if (!defined('ABSPATH')) {
exit;
}
$image_url = $product['image_url'] ?? '';
?>
<div class="cannaiq-single-product cannaiq-layout-horizontal">
<?php if (!empty($image_url)): ?>
<div class="cannaiq-single-product-image">
<img src="<?php echo esc_url($image_url); ?>"
alt="<?php echo esc_attr($product['name']); ?>" />
</div>
<?php endif; ?>
<div class="cannaiq-single-product-details">
<h2 class="cannaiq-single-product-title">
<?php echo esc_html($product['name']); ?>
</h2>
<?php if (!empty($product['brand'])): ?>
<div class="cannaiq-single-product-brand">
<strong><?php _e('Brand:', 'cannaiq-menus'); ?></strong>
<?php echo esc_html($product['brand']); ?>
</div>
<?php endif; ?>
<?php if (!empty($product['description'])): ?>
<div class="cannaiq-single-product-description">
<?php echo wp_kses_post(nl2br($product['description'])); ?>
</div>
<?php endif; ?>
<div class="cannaiq-single-product-info">
<?php if (!empty($product['thc_percentage'])): ?>
<div class="cannaiq-info-item">
<strong><?php _e('THC:', 'cannaiq-menus'); ?></strong>
<span><?php echo esc_html($product['thc_percentage']); ?>%</span>
</div>
<?php endif; ?>
<?php if (!empty($product['cbd_percentage'])): ?>
<div class="cannaiq-info-item">
<strong><?php _e('CBD:', 'cannaiq-menus'); ?></strong>
<span><?php echo esc_html($product['cbd_percentage']); ?>%</span>
</div>
<?php endif; ?>
<?php if (!empty($product['effects'])): ?>
<div class="cannaiq-info-item cannaiq-effects">
<strong><?php _e('Effects:', 'cannaiq-menus'); ?></strong>
<?php if (is_array($product['effects'])): ?>
<span><?php echo esc_html(implode(', ', $product['effects'])); ?></span>
<?php else: ?>
<span><?php echo esc_html($product['effects']); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php if (isset($product['regular_price'])): ?>
<div class="cannaiq-single-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="cannaiq-out-of-stock">
<?php _e('Out of Stock', 'cannaiq-menus'); ?>
</div>
<?php endif; ?>
</div>
</div>