- summaryView(): guard — redirect do istniejacego zamowienia gdy ORDER_SUBMIT_LAST_ORDER_ID w sesji
- basketSave(): try-catch wokol createFromBasket(), wyjatki logowane, koszyk zachowany
- OrderRepository: usunieto hardkodowane payment_id == 3, uzywana flaga is_cod
- PaymentMethodRepository: nowe pole is_cod w normalizacji, save() i forTransport() SQL
- ShopPaymentMethodController: switch "Platnosc przy odbiorze" w formularzu edycji
- migrations/0.338.sql: ALTER TABLE pp_shop_payment_methods ADD COLUMN is_cod
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Nowa klasa \Shared\Security\CsrfToken (generate/validate/regenerate)
- Token CSRF we wszystkich formularzach edycji (form-edit.php)
- Walidacja CSRF w FormRequestHandler::handleSubmit()
- Token CSRF w formularzu logowania i formularzach 2FA
- Walidacja CSRF w App::special_actions() dla żądań POST
- Regeneracja tokenu po udanym logowaniu (bezpośrednia i przez 2FA)
- Fix XSS: htmlspecialchars na $alert w unlogged-layout.php
- 7 nowych testów CsrfTokenTest (817 testów łącznie)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Token CSRF w sesji zapobiega duplikowaniu zamówień przy wielokrotnym
kliknięciu przycisku. Przy duplikacie przekierowanie do istniejącego
zamówienia. JS naprawiony — nasłuch na submit formularza zamiast click.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added api-reference.json for API specifications including authentication, response formats, and available endpoints.
- Created index.html for public API documentation, dynamically loading endpoint details from api-reference.json.
- Removed htaccess.conf file and migrated routing logic to pp_routes for improved maintainability.
- Added new 'type' column in pp_routes to differentiate between entity and system routes.
- ProductRepository::getProductForApi() eksportuje new_to_date, additional_message,
additional_message_required, additional_message_text
- ProductsApiController obsługuje te pola w PUT/PATCH
- Zaktualizowana dokumentacja API.md i CHANGELOG
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fallback w LayoutsRepository::getProductLayout() zmieniony z
categories_default=1 na status=1 — produkty bez przypisanego layoutu
pobierają teraz właściwy domyślny szablon zamiast szablonu kategorii.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add category_id, page_id, article_id, type columns to pp_routes (migration 0.329)
- Move routing block in index.php before checkUrlParams() with Redis cache
- Routes for categories, pages, articles now stored in pp_routes instead of .htaccess
- Delete category/page/article routes on entity delete in respective repositories
- Eliminate libraries/htaccess.conf: generate .htaccess content entirely from PHP
- Move 32 static system routes (koszyk, logowanie, newsletter, AJAX modules, etc.)
plus dynamic language/producer routes to pp_routes with type='system'
- Invalidate pp_routes Redis cache on every htacces() regeneration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rebuilt changelog data from manifest JSON files to fix garbled Polish
characters. Converted changelog.php from static HTML to PHP script that
filters entries by instance version (?ver= parameter).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace file-based JSON cron queue with DB-backed job queue (pp_cron_jobs,
pp_cron_schedules). New Domain\CronJob module: CronJobType (constants),
CronJobRepository (CRUD, atomic fetch, retry/backoff), CronJobProcessor
(orchestration with handler registration). Priority ordering guarantees
apilo_send_order (40) runs before sync tasks (50). Includes cron.php auth
protection, race condition fix in fetchNext, API response validation,
and DI wiring across all entry points. 41 new tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- IntegrationsRepository: refactor importu zdjęć — walidacja HTTP, curl timeouty, logi, czytelny komunikat
- ProductRepository: saveCustomFields tylko gdy klucz istnieje (partial API update), delete() czyści custom_fields
- ProductArchiveController: przycisk i metoda delete_permanent() do trwałego usunięcia z archiwum
- ProductsApiController: fix ścieżki upload (api.php działa z rootu projektu)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- DictionariesApiController: nowy endpoint POST ensure_producer (znajdź lub utwórz producenta)
- ProducerRepository: metoda ensureProducerForApi()
- ProductRepository: pole producer_name w odpowiedzi GET product
- ApiRouter: wstrzyknięto ProducerRepository do DictionariesApiController
- Zaktualizowano docs/API.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Usunięto shopproExportProduct() z IntegrationsRepository
- Usunięto shoppro_product_export() z IntegrationsController
- Usunięto przycisk "Eksportuj do shopPRO" z ShopProductController
- ProductRepository: dodano custom_fields i security_information do odpowiedzi API
- Zaktualizowano docs/API.md i testy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- NEW: IntegrationsRepository::shopproExportProduct() — eksport produktu do
zdalnej instancji shopPRO (pola główne, tłumaczenia, custom fields, zdjęcia)
- NEW: sendImageToShopproApi() — wysyłka zdjęć przez API shopPRO (base64 POST)
- REFACTOR: shopproImportProduct() — wydzielono shopproDb() i
missingShopproSetting(); dodano security_information, producer_id,
custom fields, alt zdjęcia
- NEW: AttributeRepository::ensureAttributeForApi() i
ensureAttributeValueForApi() — idempotent find-or-create dla słowników
- NEW: API POST dictionaries/ensure_attribute — utwórz lub znajdź atrybut
- NEW: API POST dictionaries/ensure_attribute_value — utwórz lub znajdź wartość
- NEW: API POST products/upload_image — przyjmuje base64, zapisuje plik i DB
- NEW: IntegrationsController::shoppro_product_export() — akcja admina
- NEW: przycisk "Eksportuj do shopPRO" w liście produktów
- NEW: pole API key w ustawieniach integracji shopPRO
Tests: 765 tests, 2153 assertions — all green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- fix: api_key brakowało w whiteliście saveSettings() — wartość tracona przy zapisie
- feat: przycisk "Generuj" losowy 32-znakowy klucz, usunięto "(ordersPRO)" z nazwy
- fix: api.php routing przeniesiony przed global settings + Throwable error handling
- fix: ApiRouter catch Throwable zamiast Exception
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Kolumna type była używana w kodzie od v0.277 ale nigdy nie miała
migracji ALTER TABLE. Instancje ze starszą bazą dostawały
PDOException: Column not found przy zapisie produktu.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AttributeRepository::listForAdmin() przekazywał :default_lang_id
do zapytania COUNT które nie używało tego parametru — PDO zgłaszał
SQLSTATE[HY093]: Invalid parameter number.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added PHP support to project configuration.
- Updated FTP configuration to exclude additional directories.
- Changed remote database host in config.php and enabled debug mode.
- Removed outdated TODO from documentation and created a new CRON_QUEUE_PLAN.md.
- Introduced a new cron job queue system using database tables pp_cron_jobs and pp_cron_schedules.
- Refactored cron job orchestration to improve management and reliability.
- Updated OrderAdminService to use the new queue system and removed old file-based logic.
- Added migration scripts for new database structure.
- Fix: globalna wyszukiwarka - Content-Type, Cache-Control, POST,
FETCH_ASSOC, try/catch wrapper
- New: document.title w szczegółach zamówienia = numer zamówienia
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix: (int) cast na apilo_order_id (format "PPxxxxxx") dawał 0, przez co
syncApiloPayment() i syncApiloStatus() pomijały wywołanie API Apilo.
Zmiana na empty() w obu metodach.
New: logowanie ApiloLogger w syncApiloPaymentIfNeeded() i
syncApiloStatusIfNeeded() — każda ścieżka decyzyjna zapisuje wpis
do pp_log z kontekstem.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- curl_getinfo() po curl_close() dawał HTTP 0 — przeniesienie przed close
- nieskończona pętla wysyłki zamówienia przy błędzie serwera Apilo (apilo_order_id = -1)
- ceny 0.00 PLN — string "0.00" z MySQL jest truthy, zmiana na (float) > 0
- walidacja zerowych cen przed wysyłką (apilo_order_id = -2)
- niezainicjalizowana $order_message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix: race condition callback płatności przed wysłaniem do Apilo
- Fix: processApiloSyncQueue czeka na apilo_order_id zamiast usuwać task
- Fix: drugie wywołanie processApiloSyncQueue po wysyłce zamówień w cronie
- Fix: ceny w szczegółach zamówienia (effective price zamiast 0 zł)
- New: persistence filtrów tabel admin (localStorage)
- Testy: 760 tests, 2141 assertions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Nowa zakladka "Logi" w sekcji Integracje - podglad tabeli pp_log
z paginacja, sortowaniem, filtrami i rozwijalnym kontekstem JSON.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ApiloLogger: logowanie operacji Apilo do pp_log z kontekstem JSON
- Cache-busting: ?ver=filemtime() dla CSS i JS w admin main-layout
- Fix: inicjalizacja $mdb przed SettingsRepository w admin/index.php
- Fix: rzutowanie (string) w ShopProductController::escapeHtml()
- UI: text-overflow ellipsis dla kategorii produktow + title tooltip
- JS: navigator.clipboard API w copyToClipboard() z fallbackiem
- CSS: uproszczenie .site-content, usuniecie .with-menu
- Migracja: pp_log + kolumny action, order_id, context
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Kolorowe badge statusow na liscie zamowien (pp_shop_statuses.color)
- Walidacja hex koloru z DB (regex), sanityzacja HTML transport
- Polaczenie 2 zapytan SQL w jedno orderStatusData()
- Path-based form submit w table-list.php (admin URL routing)
- 11 nowych testow (750 total, 2114 assertions)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When all payment methods for a transport are filtered out by
min_order_amount/max_order_amount limits, the transport is now hidden
from the basket. Prevents showing delivery options with empty payment
method lists (e.g. "Kurier - płatność przy odbiorze" when COD exceeds
max amount).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded PayPo condition (id=6, 40-1000 PLN) with generic
min/max order amount columns on pp_shop_payment_methods. Admin form
fields added, frontend basket checkout filters dynamically. Cache
invalidation on save. 4 new tests (734 total, 2080 assertions).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix: product attributes with the same sort order value were overwriting
each other in getProductAttributes(), causing only one attribute to
display on the frontend. Now uses usort() with sequential keys.
New: Preview button in product edit form opens product page in new tab.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Table filters hidden by default with toggle button (icon + active count badge)
- Filter state persisted in localStorage; auto-show when filters active
- Order details mobile layout: icon-only action bar, full-width stacking,
compact product list (image + name + qty x price = total), bottom-sheet
dropdown for integrations menu
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces the manual ZIP packaging workflow with an automated build script.
UpdateRepository now supports both manifest JSON format (new) and legacy
_sql.txt/_files.txt format (fallback), enabling a smooth transition for
existing client instances.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- New API layer: ApiRouter, OrdersApiController, DictionariesApiController
- Orders API: list (with filters/pagination/updated_since), details, change status, set paid/unpaid
- Dictionaries API: order statuses, transport methods, payment methods
- X-Api-Key authentication via pp_settings.api_key
- OrderRepository: listForApi(), findForApi(), touchUpdatedAt()
- updated_at column on pp_shop_orders for polling support
- api.php: skip session for API requests, route to ApiRouter
- SettingsController: api_key field in system tab
- 30 new tests (666 total, 1930 assertions)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Order product CRUD in admin panel (add, delete, edit quantity/prices)
- AJAX product search endpoint for order edit form
- Automatic stock adjustment when editing order products
- Transport cost recalculation based on free delivery threshold
- Fix: promo price = 0 when equal to base price (no real promotion)
- Clean up stale temp/ build artifacts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Full codebase review of autoload/ directory (96 classes, ~1144 methods).
Fixes: null safety (query/find guards), redundant DI bypass, undefined
variables, missing globals, and Imagick WebP mime type bug in Helpers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>