Add InPost Pay integration to admin templates

- Created a new template for the cart rule form with custom label, switch, and choice widgets.
- Implemented the InPost Pay block in the order details template for displaying delivery method, APM, and VAT invoice request.
- Added legacy support for the order details template to maintain compatibility with older PrestaShop versions.
This commit is contained in:
2025-09-14 14:38:09 +02:00
parent d895f86a03
commit 4066f6fa31
1086 changed files with 76598 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace izi\prestashop\CacheClearer;
use izi\prestashop\Repository\BasketSessionRepository;
final class BindingKeysCacheClearer implements CacheClearerInterface
{
/**
* @var BasketSessionRepository
*/
private $repository;
public function __construct(BasketSessionRepository $repository)
{
$this->repository = $repository;
}
public function clear(): void
{
$this->repository->resetBindingKeysCache();
}
}

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace izi\prestashop\CacheClearer;
interface CacheClearerInterface
{
public function clear();
}

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace izi\prestashop\CacheClearer;
final class ChainCacheClearer implements CacheClearerInterface
{
/**
* @var iterable|CacheClearerInterface[]
*/
private $clearers;
/**
* @param iterable<CacheClearerInterface> $clearers
*/
public function __construct(iterable $clearers)
{
$this->clearers = $clearers;
}
public function clear(): void
{
foreach ($this->clearers as $clearer) {
$clearer->clear();
}
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace izi\prestashop\CacheClearer;
use Psr\SimpleCache\CacheInterface;
final class Psr16CacheClearer implements CacheClearerInterface
{
/**
* @var CacheInterface
*/
private $cache;
public function __construct(CacheInterface $cache)
{
$this->cache = $cache;
}
public function clear(): void
{
if ($this->cache->clear()) {
return;
}
throw new \RuntimeException('Failed to clear cache.');
}
}