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 class="border-2 border-orange-500 p-3 sticky top-0 bg-black z-50"> | |
<h1 class="text-3xl md:text-4xl font-bold tracking-widest uppercase"> | |
<?php echo $currentStoreName; ?> | |
</h1> | |
</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 id="app" class="min-h-screen bg-black text-orange-200 font-mono p-6 flex flex-col space-y-4 text-lg"> |
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
public function getProductsByCategoryId($categoryId) | |
{ | |
if (!$this->isModuleEnabled()) { | |
return []; | |
} | |
// Standard product retrieval logic | |
} |
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
public function getCartItemCount() | |
{ | |
if (!$this->isModuleEnabled()) { | |
return 0; | |
} | |
$quote = $this->cart->getQuote(); | |
return (int)$quote->getItemsQty(); | |
} |
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 | |
namespace Werules\GameShop\Controller\Index; | |
use Magento\Framework\App\Action\Action; | |
use Magento\Framework\App\Action\Context; | |
use Magento\Framework\Controller\ResultFactory; | |
use Magento\Framework\App\Config\ScopeConfigInterface; | |
class Index extends Action | |
{ |
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
<?xml version="1.0"?> | |
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> | |
<router id="standard"> | |
<route id="werules_gameshop" frontName="game-shop"> | |
<module name="Werules_GameShop"/> | |
</route> | |
</router> | |
</config> |
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
app/code/Werules/GameShop/ | |
├── Api/ | |
│ ├── CartManagementInterface.php | |
│ ├── CategoryManagementInterface.php | |
│ ├── ProductManagementInterface.php | |
├── Controller/ | |
│ ├── Index/ | |
│ │ ├── Index.php | |
├── etc/ | |
│ ├── adminhtml/ |
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
private function generateDescriptionFromGemini($prompt, $apiKey) | |
{ | |
$ch = curl_init("https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateText?key={$apiKey}"); | |
$data = ['contents' => [['parts' => [['text' => $prompt]]]]]; | |
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$response = curl_exec($ch); |
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
require(['jquery'], function ($) { | |
window.fetchAutofillData = function () { | |
var productId = '<?= $productId ?>'; | |
var productName = $('[name="product[name]"]').val() || 'N/A'; | |
var productPrice = $('[name="product[price]"]').val() || 'N/A'; | |
$.ajax({ | |
url: '<?= $ajaxUrl ?>', | |
type: 'POST', | |
data: { product_id: productId, product_name: productName, product_price: productPrice }, |
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
<field id="api_provider" translate="label" type="select" sortOrder="6" showInDefault="1"> | |
<label>AI Provider</label> | |
<source_model>Werules\Autofill\Model\Config\Source\ApiProvider</source_model> | |
</field> | |
<field id="api_key" type="text" sortOrder="10"> | |
<label>OpenAI API Key</label> | |
</field> | |
<field id="gemini_api_key" type="text" sortOrder="15"> | |
<label>Gemini API Key</label> | |
</field> |