/** * Constructor. * * @param Context $context Template context. * @param SwatchHelper $swatchHelper Swatch helper. * @param array $data Custom data. */ public function __construct(Context $context, SwatchHelper $swatchHelper, array $data = []) { parent::__construct($context, $data); $this->swatchHelper = $swatchHelper; }
/** * * @param Context $context Template context. * @param EncoderInterface $jsonEncoder JSON Encoder. * @param FormatInterface $localeFormat Price format config. * @param array $data Custom data. */ public function __construct(Context $context, EncoderInterface $jsonEncoder, FormatInterface $localeFormat, array $data = []) { parent::__construct($context, $data); $this->jsonEncoder = $jsonEncoder; $this->localeFormat = $localeFormat; }