Files
2026-09-15 10:35:56 +08:00

29 lines
721 B
PHP

<?php
declare(strict_types=1);
namespace Esun\CustomerCoupon\Block\Adminhtml\Form;
use Magento\Backend\Block\Template;
use Magento\Framework\Registry;
use Magento\SalesRule\Model\RegistryConstants;
class CustomerSelect extends Template
{
public function __construct(
Template\Context $context,
private readonly Registry $registry,
array $data = []
) {
parent::__construct($context, $data);
}
public function getSearchUrl(): string
{
$rule = $this->registry->registry(RegistryConstants::CURRENT_SALES_RULE);
return $this->getUrl('esun_customer_coupon/customer/search', [
'rule_id' => $rule ? (int)$rule->getId() : 0,
]);
}
}