1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright © Getnet. All rights reserved. |
4
|
|
|
* |
5
|
|
|
* @author Bruno Elisei <[email protected]> |
6
|
|
|
* See LICENSE for license details. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
declare(strict_types=1); |
10
|
|
|
|
11
|
|
|
namespace Getnet\SubSellerMagento\Block\Adminhtml\System\Form\Field\Column; |
12
|
|
|
|
13
|
|
|
use Magento\Framework\View\Element\Html\Select; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Class ProductColumn - Create Field to Product Column. |
17
|
|
|
*/ |
18
|
|
|
class ProductColumn extends Select |
19
|
|
|
{ |
20
|
|
|
public const CREDITO_1X = 'CREDITO A VISTA'; |
21
|
|
|
|
22
|
|
|
public const CREDITO_PARCELADO_3X = 'PARCELADO LOJISTA 3X'; |
23
|
|
|
|
24
|
|
|
public const CREDITO_PARCELADO_6X = 'PARCELADO LOJISTA 6X'; |
25
|
|
|
|
26
|
|
|
public const CREDITO_PARCELADO_9X = 'PARCELADO LOJISTA 9X'; |
27
|
|
|
|
28
|
|
|
public const CREDITO_PARCELADO_12X = 'PARCELADO LOJISTA 12X'; |
29
|
|
|
|
30
|
|
|
public const BOLETO = 'BOLETO'; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Set "name" for <select> element. |
34
|
|
|
* |
35
|
|
|
* @param string $value |
36
|
|
|
* |
37
|
|
|
* @return void |
38
|
|
|
*/ |
39
|
|
|
public function setInputName($value) |
40
|
|
|
{ |
41
|
|
|
return $this->setName($value); |
|
|
|
|
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Set "id" for <select> element. |
46
|
|
|
* |
47
|
|
|
* @param string $value |
48
|
|
|
* |
49
|
|
|
* @return void |
50
|
|
|
*/ |
51
|
|
|
public function setInputId($value) |
52
|
|
|
{ |
53
|
|
|
return $this->setId($value); |
|
|
|
|
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Render block HTML. |
58
|
|
|
* |
59
|
|
|
* @return string |
60
|
|
|
*/ |
61
|
|
|
public function _toHtml(): string |
62
|
|
|
{ |
63
|
|
|
if (!$this->getOptions()) { |
64
|
|
|
$this->setOptions($this->getSourceOptions()); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
return parent::_toHtml(); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Get Options. |
72
|
|
|
* |
73
|
|
|
* @return array |
74
|
|
|
*/ |
75
|
|
|
public function getSourceOptions(): array |
76
|
|
|
{ |
77
|
|
|
return [ |
78
|
|
|
['value' => self::CREDITO_1X, 'label' => 'Pagamento em crédito à vista'], |
79
|
|
|
['value' => self::CREDITO_PARCELADO_3X, 'label' => 'Pagamento em crédito até 3 parcelas'], |
80
|
|
|
['value' => self::CREDITO_PARCELADO_6X, 'label' => 'Pagamento em crédito até 6 parcelas'], |
81
|
|
|
['value' => self::CREDITO_PARCELADO_9X, 'label' => 'Pagamento em crédito até 9 parcelas'], |
82
|
|
|
['value' => self::CREDITO_PARCELADO_12X, 'label' => 'Pagamento em crédito até 12 parcelas'], |
83
|
|
|
['value' => self::BOLETO, 'label' => 'Pagamento por Boleto'], |
84
|
|
|
]; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|