Files
esun3d/app/code/Esun/LingxingErp/Block/Adminhtml/Store/SyncButton.php
T
2026-09-15 10:35:56 +08:00

26 lines
716 B
PHP

<?php
declare(strict_types=1);
namespace Esun\LingxingErp\Block\Adminhtml\Store;
use Magento\Backend\Block\Widget\Button;
class SyncButton extends Button
{
protected function _construct(): void
{
parent::_construct();
$url = $this->getUrl('esun_lingxing/store/sync');
$message = (string)__('Fetch all stores from Lingxing now?');
$this->setData([
'label' => __('Sync Stores'),
'class' => 'primary',
'onclick' => sprintf(
'confirmSetLocation(%s, %s)',
json_encode($message, JSON_HEX_APOS | JSON_HEX_QUOT),
json_encode($url, JSON_HEX_APOS | JSON_HEX_QUOT)
),
]);
}
}