'COALESCE(sale_price, price) ASC', 'price_high' => 'COALESCE(sale_price, price) DESC', 'name' => 'name ASC', default => 'created_at DESC' }; // Get total count $totalProducts = db()->count('products', $whereClause, $params); $pagination = paginate($totalProducts, $page, 12); // Get products $products = db()->fetchAll( "SELECT * FROM products WHERE {$whereClause} ORDER BY {$orderBy} LIMIT :limit OFFSET :offset", array_merge($params, ['limit' => $pagination['per_page'], 'offset' => $pagination['offset']]) ); // Get categories for filter $categories = db()->fetchAll( "SELECT DISTINCT category FROM products WHERE category IS NOT NULL AND category != '' AND is_active = 1 ORDER BY category" ); $metaTitle = "Shop Premium Coffee Beans | Tom's Java Jive"; $metaDescription = 'Browse our selection of premium artisan coffee beans. Single origin, blends, light, medium and dark roasts. Free shipping over $50.'; $metaKeywords = 'buy coffee beans online, artisan coffee, single origin, blends, light roast, dark roast'; $canonicalUrl = 'https://tomsjavajive.com/shop.php'; require_once __DIR__ . '/includes/header.php'; $productTypesList = db()->fetchAll("SELECT type_id, name, slug FROM product_types WHERE is_active=1 ORDER BY sort_order ASC"); ?> Our Coffee Collection Discover your perfect brew from our selection of premium coffees All = htmlspecialchars(ucfirst($cat['category'])) ?> >Newest >Price: Low to High >Price: High to Low >Name Showing = count($products) ?> of = $totalProducts ?> products = $category ? ' in ' . htmlspecialchars(ucfirst($category)) : '' ?> No products found Try adjusting your search or filters View All Products Sale Featured = htmlspecialchars($product['category']) ?> = htmlspecialchars($product['name']) ?> = formatCurrency($price) ?> = formatCurrency($product['price']) ?> Add to Cart 1): ?> = renderPagination($pagination, '/shop.php?' . http_build_query(array_filter(['category' => $category, 'sort' => $sort]))) ?>
Discover your perfect brew from our selection of premium coffees
Showing = count($products) ?> of = $totalProducts ?> products = $category ? ' in ' . htmlspecialchars(ucfirst($category)) : '' ?>
Try adjusting your search or filters