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:
60
modules/inpostizi/upgrade/upgrade-1.9.0.php
Normal file
60
modules/inpostizi/upgrade/upgrade-1.9.0.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
use InPost\Izi\Upgrade\AssetsRemoverTrait;
|
||||
use InPost\Izi\Upgrade\CacheClearer;
|
||||
use InPost\Izi\Upgrade\ConfigUpdaterTrait;
|
||||
use izi\prestashop\Configuration\Adapter\Configuration;
|
||||
use izi\prestashop\Database\Connection;
|
||||
use izi\prestashop\Installer\Database\Version_1_9_0;
|
||||
use izi\prestashop\Installer\DatabaseInstaller;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/CacheClearer.php';
|
||||
require_once __DIR__ . '/ConfigUpdaterTrait.php';
|
||||
require_once __DIR__ . '/AssetsRemoverTrait.php';
|
||||
|
||||
class InPostIziUpdater_1_9_0
|
||||
{
|
||||
use ConfigUpdaterTrait;
|
||||
use AssetsRemoverTrait;
|
||||
|
||||
private const STALE_ASSETS = [
|
||||
'js/prestashopizi.972421cbefe1f8bf3243.js',
|
||||
'js/prestashopizi.972421cbefe1f8bf3243.js.map',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var DatabaseInstaller
|
||||
*/
|
||||
private $installer;
|
||||
|
||||
public function __construct(Module $module, DatabaseInstaller $installer)
|
||||
{
|
||||
$this->module = $module;
|
||||
$this->installer = $installer;
|
||||
}
|
||||
|
||||
public function upgrade(): bool
|
||||
{
|
||||
CacheClearer::getInstance()->clear();
|
||||
$this->installer->install($this->module);
|
||||
|
||||
return $this->removeStaleAssets(self::STALE_ASSETS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param InPostIzi $module
|
||||
*/
|
||||
function upgrade_module_1_9_0(Module $module): bool
|
||||
{
|
||||
$db = Db::getInstance();
|
||||
$dbInstaller = new DatabaseInstaller(new Configuration($db), [
|
||||
new Version_1_9_0(new Connection($db)),
|
||||
]);
|
||||
|
||||
return (new InPostIziUpdater_1_9_0($module, $dbInstaller))->upgrade();
|
||||
}
|
||||
Reference in New Issue
Block a user