UPDATE: parameters - add remote database host configuration; ADD: AGENTS.md - repository guidelines and structure documentation
This commit is contained in:
2
.vscode/ftp-kr.sync.cache.json
vendored
2
.vscode/ftp-kr.sync.cache.json
vendored
@@ -116,7 +116,7 @@
|
||||
},
|
||||
"google-merchant_id-1.xml": {
|
||||
"type": "-",
|
||||
"size": 62638558,
|
||||
"size": 62638554,
|
||||
"lmtime": 0,
|
||||
"modified": true
|
||||
},
|
||||
|
||||
41
AGENTS.md
Normal file
41
AGENTS.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Repository Guidelines
|
||||
|
||||
## Project Structure & Module Organization
|
||||
This repository is a PrestaShop-based monolith with customizations.
|
||||
- Core app code: `classes/`, `controllers/`, `src/`, `config/`, `app/`.
|
||||
- Back office entry and assets: `iadmin/`.
|
||||
- Front themes and static assets: `themes/`.
|
||||
- Extensions and most active custom work: `modules/` (many modules include their own `src/`, `tests/`, `composer.json`, and/or `package.json`).
|
||||
- Overrides: `override/` (use only when module/hooks cannot solve the change).
|
||||
- Runtime artifacts: `var/cache/`, `var/logs/`.
|
||||
|
||||
## Build, Test, and Development Commands
|
||||
There is no root `composer.json` or unified build script; work at module scope.
|
||||
- `cd modules/<module-name> && composer install` - install PHP dependencies for a module.
|
||||
- `cd modules/<module-name> && composer test` - run module PHPUnit tests (where defined, e.g. `ps_facetedsearch`).
|
||||
- `cd modules/<module-name> && composer lint` - run PHP lint/style checks when available.
|
||||
- `cd modules/<module-name> && npm ci && npm run build` - build JS/CSS for modules with `package.json`.
|
||||
- `cd modules/<module-name> && npm test` - run frontend/module JS tests when configured.
|
||||
- `php -l path/to/file.php` - quick syntax check for touched PHP files.
|
||||
- `Remove-Item var\\cache\\* -Recurse -Force` - clear cache after config/container changes.
|
||||
|
||||
## Coding Style & Naming Conventions
|
||||
- Follow existing PrestaShop conventions: PHP classes in `PascalCase`, methods/properties in `camelCase`, constants in `UPPER_SNAKE_CASE`.
|
||||
- Use 4-space indentation in PHP and preserve existing module conventions for JS/Vue.
|
||||
- Prefer PSR-4 namespaces in module `src/` and keep legacy classmap files minimal.
|
||||
- Avoid editing `vendor/` or generated/minified files unless explicitly required.
|
||||
|
||||
## Testing Guidelines
|
||||
- Put tests in module-local paths like `modules/<module>/tests/php` or `tests/UI`.
|
||||
- Name PHP tests `*Test.php`; JS tests commonly use `*.spec.js`.
|
||||
- Run only relevant module test/lint suites before PR; include manual smoke checks for storefront and back office flows impacted by the change.
|
||||
|
||||
## Commit & Pull Request Guidelines
|
||||
- Commit style in this repo is short imperative summaries, often prefixed (`FIX:`, `UPDATE:`). Keep subject <= 72 chars.
|
||||
- Recommended format: `<TYPE>: <scope> - <what changed>` (example: `FIX: ps_facetedsearch - correct filter sort order`).
|
||||
- PRs should include: purpose, affected paths/modules, test steps/results, cache-clear/migration notes, and screenshots for UI/theme changes.
|
||||
- Link related issue/ticket when available.
|
||||
|
||||
## Security & Configuration Tips
|
||||
- Never commit real credentials or tokens; treat `app/config/parameters.php` and module API keys as sensitive.
|
||||
- Review `.htaccess`, payment/integration modules, and override logic carefully for security-impacting changes.
|
||||
@@ -6,6 +6,7 @@
|
||||
'database_name' => 'host978195_db',
|
||||
'database_user' => 'host978195_db',
|
||||
'database_password' => 'fNpSJGmNCWTuNhT5HgGa',
|
||||
'database_host_remote' => 'host978195.hostido.net.pl',
|
||||
'database_prefix' => 'materac_',
|
||||
'database_engine' => 'InnoDB',
|
||||
'mailer_transport' => 'smtp',
|
||||
|
||||
@@ -152,6 +152,7 @@ class OmnibusEuFree extends Module
|
||||
{
|
||||
$currency = $this->context->currency;
|
||||
$lastMinimalPrice = $this->getLastMinimalPrice($params['product']['id_product'], $params['product']['id_product_attribute'], $currency->id);
|
||||
$regularPrice = isset($params['product']['regular_price']) ? $params['product']['regular_price'] : null;
|
||||
|
||||
if (!empty($lastMinimalPrice)) {
|
||||
$minimalPrice = PrestashopCompatibility::formatPrice(_PS_VERSION_, $lastMinimalPrice['price'], $currency);
|
||||
@@ -164,6 +165,7 @@ class OmnibusEuFree extends Module
|
||||
'OmnibuseufreeInfoVersion' => (int) Configuration::get('OMNIBUSEUFREE_INFORMATION_VERSION', null, null, null, 2),
|
||||
'OmnibuseufreeProductPriceMin' => $minimalPrice,
|
||||
'OmnibuseufreeProductPriceCurrent' => $params['product']['price'],
|
||||
'OmnibuseufreeProductPriceRegular' => $regularPrice,
|
||||
'OmnibuseufreeProductDiscount' => (bool) $params['product']['has_discount'],
|
||||
'OmnibuseufreeNumberOfDays' => (int) Configuration::get('OMNIBUSEUFREE_DAYS', null, null, null, 30),
|
||||
]);
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
{l s='Lowest price in %d days before discount: ' sprintf=[$OmnibuseufreeNumberOfDays] mod='omnibuseufree'}<span class="presta-studio-price-history-price">{$OmnibuseufreeProductPriceMin}</span>
|
||||
{else}
|
||||
{* when history is empty *}
|
||||
{l s='Lowest price in %d days: ' sprintf=[$OmnibuseufreeNumberOfDays] mod='omnibuseufree'}<span class="presta-studio-price-history-price">{$OmnibuseufreeProductPriceCurrent}</span>
|
||||
{l s='Lowest price in %d days: ' sprintf=[$OmnibuseufreeNumberOfDays] mod='omnibuseufree'}<span class="presta-studio-price-history-price">{$OmnibuseufreeProductPriceRegular|default:$OmnibuseufreeProductPriceCurrent}</span>
|
||||
{/if}
|
||||
{else}
|
||||
{l s='Lowest price in %d days: ' sprintf=[$OmnibuseufreeNumberOfDays] mod='omnibuseufree'}<span class="presta-studio-price-history-price">{$OmnibuseufreeProductPriceMin}</span>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user