Files
kupshop/bundles/External/HannahBundle/Admin/Tabs/DeliveryPaymentTab.php
2025-08-02 16:30:27 +02:00

45 lines
1000 B
PHP

<?php
namespace External\HannahBundle\Admin\Tabs;
use KupShop\AdminBundle\Admin\WindowTab;
class DeliveryPaymentTab extends WindowTab
{
protected $title = 'flapSAP';
protected $template = 'window/deliveryDelivery.sap.tpl';
public static function getTypes()
{
return [
'deliveryDelivery' => 1,
'deliveryPayment' => 1,
];
}
public function getVars($smarty_tpl_vars)
{
return [
'isPayment' => $this->getWindow() instanceof \DeliveryTypesPayment,
];
}
public function handleUpdate()
{
if ($this->getWindow() instanceof \DeliveryTypesPayment) {
$data = $this->window->getData()['custom_data'] ?? [];
$customData = $this->window->getCustomData();
$customData['sap_code'] = trim($data['sap_code'] ?? null);
$this->window->setCustomData($customData);
}
}
public function getLabel()
{
return 'SAP';
}
}