Skip to content

Commit

Permalink
Fix magento#6310 - set default value for weight switcher to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartlomiejsz committed Mar 20, 2020
1 parent 2506c08 commit f6f414b
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct(
$this->localeFormat = $localeFormat;
$this->weightSwitcher = $factoryElement->create('radios');
$this->weightSwitcher->setValue(
WeightResolver::HAS_WEIGHT
WeightResolver::HAS_NO_WEIGHT
)->setValues(
[
['value' => WeightResolver::HAS_WEIGHT, 'label' => __('Yes')],
Expand All @@ -84,10 +84,6 @@ public function __construct(
*/
public function getElementHtml()
{
if (!$this->getForm()->getDataObject()->getTypeInstance()->hasWeight()) {
$this->weightSwitcher->setValue(WeightResolver::HAS_NO_WEIGHT);
}

if ($this->getDisabled()) {
$this->weightSwitcher->setDisabled($this->getDisabled());
}
Expand Down

0 comments on commit f6f414b

Please sign in to comment.