Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blopa/3b1c8a3a962850a24d9ba763b6c07f94 to your computer and use it in GitHub Desktop.
Save blopa/3b1c8a3a962850a24d9ba763b6c07f94 to your computer and use it in GitHub Desktop.
Code for post "I built a retro RPG game shop extension for my Magento 2 store"
<div v-if="activeView === 'list'">
<div v-if="products.length === 0" class="text-center text-orange-400 text-lg mt-6">
<?= __('No products found in this category.'); ?>
</div>
<div class="space-y-3">
<div v-for="product in products" :key="product.id"
class="border border-orange-500 p-4 flex flex-col md:flex-row items-center cursor-pointer hover:bg-orange-900 transition"
@click="showDetails(product)">
<img :src="product.image_url"
class="w-32 h-32 object-cover border border-orange-500 bg-black">
<div class="flex-1 text-center md:text-left">
<span class="block text-lg">{{ product.name }}</span>
<span class="block text-xl text-orange-300 mt-2">{{ formatPrice(product.price) }}</span>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment