Files
cannaiq/wordpress-plugin/templates/product-grid.php
Kelly 511629b4e6 Rename WordPress plugin from Dutchie Menus to Crawlsy Menus v1.3.0
- Renamed plugin to avoid WordPress.org naming conflict causing false update notifications
- Added /downloads static route to serve plugin zip file
- Updated all CSS classes from dutchie- to crawlsy- prefix
- Added plugin zip to backend/public/downloads for hosting
- Plugin available at: https://dispos.crawlsy.com/downloads/crawlsy-menus-1.3.0.zip

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 16:29:21 -07:00

70 lines
2.6 KiB
PHP

<?php
/**
* Template for Product Grid (used by shortcode)
*/
if (!defined('ABSPATH')) {
exit;
}
$columns = isset($atts['columns']) ? $atts['columns'] : 3;
?>
<div class="crawlsy-product-grid crawlsy-grid-cols-<?php echo esc_attr($columns); ?>">
<?php foreach ($products as $product): ?>
<div class="crawlsy-product-card">
<?php if (!empty($product['image_url_full'])): ?>
<div class="crawlsy-product-image">
<img src="<?php echo esc_url($product['image_url_full']); ?>"
alt="<?php echo esc_attr($product['name']); ?>"
loading="lazy" />
</div>
<?php endif; ?>
<div class="crawlsy-product-content">
<h3 class="crawlsy-product-title">
<?php echo esc_html($product['name']); ?>
</h3>
<?php if (!empty($product['brand'])): ?>
<div class="crawlsy-product-brand">
<?php echo esc_html($product['brand']); ?>
</div>
<?php endif; ?>
<?php if (!empty($product['description'])): ?>
<p class="crawlsy-product-description">
<?php echo esc_html(wp_trim_words($product['description'], 15)); ?>
</p>
<?php endif; ?>
<div class="crawlsy-product-meta">
<?php if (!empty($product['metadata']['thc'])): ?>
<span class="crawlsy-meta-item crawlsy-thc">
<strong>THC:</strong> <?php echo esc_html($product['metadata']['thc']); ?>
</span>
<?php endif; ?>
<?php if (!empty($product['metadata']['cbd'])): ?>
<span class="crawlsy-meta-item crawlsy-cbd">
<strong>CBD:</strong> <?php echo esc_html($product['metadata']['cbd']); ?>
</span>
<?php endif; ?>
</div>
<?php if (isset($product['price'])): ?>
<div class="crawlsy-product-price">
$<?php echo number_format($product['price'], 2); ?>
</div>
<?php endif; ?>
<?php if (!$product['in_stock']): ?>
<div class="crawlsy-out-of-stock">
<?php _e('Out of Stock', 'crawlsy-menus'); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>