Add new settings and cache repository files, update admin settings controller and templates

- Introduced new `SettingsRepository` and `CacheRepository` classes in the `autoload\Domain` namespace.
- Updated `SettingsController` in the `admin\Controllers` namespace to enhance settings management.
- Added new templates for settings in `admin\templates\settings` and `admin\templates\site`.
- Improved overall structure and organization of settings-related files.
This commit is contained in:
2026-02-05 23:32:48 +01:00
parent 3a7be21432
commit 1c88f8adfa
35 changed files with 1233 additions and 87 deletions

View File

@@ -289,19 +289,16 @@ class Product implements \ArrayAccess
}
// pobierz cenę produktu
// FASADA - wywołuje nową klasę Domain\Product\ProductRepository
static public function get_product_price( int $product_id )
{
global $mdb;
$prices = $mdb -> get( 'pp_shop_products', [ 'price_brutto', 'price_brutto_promo' ], [ 'id' => $product_id ] );
if ( $prices['price_brutto_promo'] != '' and $prices['price_brutto_promo'] < $prices['price_brutto'] )
return $prices['price_brutto_promo'];
else
return $prices['price_brutto'];
$repository = new \Domain\Product\ProductRepository($mdb);
return $repository->getPrice($product_id);
}
// pobierz nazwę produktu
// FASADA - wywołuje nową klasę Domain\Product\ProductRepository
static public function get_product_name( int $product_id, string $lang_id = null )
{
global $mdb;
@@ -309,7 +306,8 @@ class Product implements \ArrayAccess
if ( !$lang_id )
$lang_id = \front\factory\Languages::default_language();
return $mdb -> get( 'pp_shop_products_langs', 'name', [ 'AND' => [ 'product_id' => $product_id, 'lang_id' => $lang_id ] ] );
$repository = new \Domain\Product\ProductRepository($mdb);
return $repository->getName($product_id, $lang_id);
}
// pobierz i wyświetl produktu do zestawu po dodaniu do koszyka