This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin/magento module:enable Werules_GameShop | |
bin/magento setup:upgrade | |
bin/magento cache:flush |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mediaUrl = $block->getViewFileUrl('Werules_GameShop::images/shopkeeper.png'); | |
$baseUrl = $block->getBaseUrl(); | |
$pageTitle = __('GameShop - Buy & Sell Games'); | |
$pageDescription = __('Find the best gaming deals, buy and sell games easily!'); | |
?> | |
<!-- Open Graph Meta Tags --> | |
<meta property="og:image" content="<?= $mediaUrl ?>"/> | |
<meta property="og:image:alt" content="GameShop Shopkeeper Avatar"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<referenceBlock name="head.additional"> | |
<block class="Magento\Framework\View\Element\Template" | |
name="werules.gameshop.head" | |
template="Werules_GameShop::seo/head.phtml"/> | |
</referenceBlock> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods: { | |
onMenuItemClick(selection) { | |
if (selection === 'Talk') { | |
const randomIndex = Math.floor(Math.random() * this.talkLines.length); | |
this.currentTalkLine = this.talkLines[randomIndex]; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div v-else-if="menuSelection === 'Talk'" class="flex items-center justify-center h-64 border-2 border-orange-500 p-6"> | |
<p class="text-3xl text-orange-400 text-center"> | |
{{ currentTalkLine }} | |
</p> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div v-if="activeView === 'detail' && currentProduct" class="space-y-4"> | |
<p class="italic text-lg mb-2"> | |
<?= sprintf(__('Ah, the %s! This item might do something special...'), '<strong>{{ currentProduct.name }}</strong>'); ?> | |
</p> | |
<div class="flex flex-col md:flex-row space-y-4 items-start border border-orange-500 p-4"> | |
<img :src="currentProduct.image_url" | |
class="w-72 h-72 object-cover border border-orange-500 bg-black"> | |
<div class="flex-1"> | |
<h3 class="text-2xl font-bold">{{ currentProduct.name }}</h3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Category Tabs --> | |
<div v-if="activeView === 'list'" class="flex flex-wrap gap-2 mb-3"> | |
<button v-for="cat in categories" :key="cat.id" | |
class="px-3 py-1 border border-orange-500 hover:bg-orange-500 hover:text-black transition" | |
:class="{'bg-orange-500 text-black': currentCategoryId === cat.id}" | |
@click="loadProducts(cat.id, cat.name)"> | |
{{ cat.name }} | |
</button> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class="block w-full py-3 border border-orange-500 hover:bg-orange-900 text-center px-4 text-lg" | |
:class="{'bg-orange-500 text-black': menuSelection === 'Buy'}" | |
@click="onMenuItemClick('Buy')"> | |
<?= __('Buy'); ?> | |
</button> | |
<button class="block w-full py-3 border border-orange-500 hover:bg-orange-900 text-center px-4 text-lg" | |
:class="{'bg-orange-500 text-black': menuSelection === 'Sell'}" | |
@click="onMenuItemClick('Sell')"> | |
<?= __('Sell'); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Shopkeeper Avatar --> | |
<div class="border-2 border-orange-500 p-2 flex justify-center items-center bg-black"> | |
<img src="<?= $block->getViewFileUrl('Werules_GameShop::images/shopkeeper.png'); ?>" | |
alt="<?= __('Shopkeeper Avatar'); ?>" | |
class="w-32 h-32 object-cover border border-orange-500 bg-black avatar"> | |
</div> | |
<!-- Cart Count --> | |
<div class="mb-4"> | |
<div class="text-lg text-orange-400"><?= __('Cart items:'); ?></div> |
NewerOlder