Files
interblue.pl/CLAUDE.md
2026-03-21 18:50:09 +01:00

76 lines
4.5 KiB
Markdown

# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a **PrestaShop 1.7.x e-commerce store** (interblue.pl) with a custom theme and multiple custom/third-party modules. The codebase is a live PrestaShop installation deployed via FTP to the production server.
## Architecture
### Directory Structure
- **`themes/InterBlue/`** — Custom theme based on PrestaShop's classic theme. Templates use Smarty (`.tpl`), CSS is compiled from SCSS via VSCode Live Sass Compiler.
- **`modules/`** — 130+ modules. Custom/in-house modules: `customfeaturetab`, `AddOrderExtraFields`. Key third-party: `x13allegro` (Allegro marketplace), `onepagecheckoutps` (one-page checkout), `baselinker`, `empikmarketplace`, `dpdpoland`/`sensbitinpost`/`sensbitpaczkawruchu`/`sensbitpocztapolska` (shipping carriers).
- **`override/`** — PrestaShop class/controller overrides. Critical overrides:
- `override/classes/order/Order.php` — Modified by `modrefchange` module to fire hooks (`actionBeforeAddOrder`, `actionBeforeAddOrderInvoice`, `actionBeforeAddDeliveryNumber`) before invoice/delivery number assignment.
- `override/controllers/front/OrderController.php` — Modified by `onepagecheckoutps` module for one-page checkout flow.
- **`src/`** — Extended PrestaShop core: `src/Adapter/Order/QueryHandler/` and `src/Core/Domain/Order/` for order viewing query pattern (CQRS).
### Theme Architecture
- **SCSS workflow**: Edit `themes/InterBlue/assets/css/custom.scss` (or `theme.scss`). The VSCode Live Sass Compiler auto-compiles to `custom.css` with autoprefixer on save.
- Templates override classic theme templates in `themes/InterBlue/templates/`.
- Default layout is full-width; category pages use left column.
### Module Architecture
Custom modules follow standard PrestaShop module structure:
- Main PHP class extends `Module`
- `views/templates/` for Smarty templates
- `classes/` for business logic
- DB install/uninstall in `install()`/`uninstall()` methods
- Hooks registered via `registerHook()` in `install()`
The `customfeaturetab` module (`modules/customfeaturetab/`) uses a custom DB table `ps_custom_feature_tab` to map product features/values to extra product page tabs, displayed via the `displayProductExtraContent` hook.
### Override Conflicts
When adding overrides, check for existing overrides that multiple modules may have contributed to. The `Order.php` override was generated by `AddOrderExtraFields` copying files from `modules/AddOrderExtraFields/_overrides/`. If `modrefchange` module is installed, a different version is used.
**Known issue**: After updating `empikmarketplace`, the admin product catalog list view is overridden by:
- `modules/empikmarketplace/views/PrestaShop/Admin/Product/CatalogPage/Lists/list.html.twig`
- `modules/empikmarketplace/views/PrestaShop/Admin/Product/CatalogPage/Lists/products_table.html.twig`
## Development Workflow
### CSS/SCSS
Use the VSCode **Live Sass Compiler** extension. It watches on launch (configured in `.vscode/settings.json`) and compiles SCSS to compressed CSS with sourcemaps and autoprefixing automatically on save.
Main file to edit: [themes/InterBlue/assets/css/custom.scss](themes/InterBlue/assets/css/custom.scss)
### Deployment
Files are deployed to production via FTP using the **SFTP/FTP Sync** VSCode extension (configured in `.vscode/ftp-kr.json`). Upload is not automatic on save — files must be manually synced.
### PrestaShop Cache
After modifying PHP classes, overrides, or templates, PrestaShop's cache must be cleared from the admin panel: **Advanced Parameters → Performance → Clear cache**, or by deleting `var/cache/` on the server.
When creating or modifying overrides, PrestaShop also needs to rebuild the class index (`var/cache/*/class_index.php`).
## Key Conventions
- All custom module display strings use `$this->l('...')` for translation support (Polish locale is primary).
- Override classes extend `*Core` (e.g., `class Order extends OrderCore`).
- Module DB tables use `_DB_PREFIX_` constant (typically `ps_`).
- PrestaShop hooks are the integration point — prefer hooks over direct core edits.
- The `admin658c34/` directory is the custom admin panel path (security through obscurity).
## Custom Assistant Command
- If the user writes `zapisz-changelog`, create or update monthly changelog file `changelog/YYYY-MM-DD.md` (based on current date).
- Add an entry for the current day with a concise summary of code changes made in the current session.
- Include touched file paths and relevant line references where possible.