本文整理匯總了PHP中Magento\Directory\Helper\Data::getWeightUnit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Data::getWeightUnit方法的具體用法?PHP Data::getWeightUnit怎麽用?PHP Data::getWeightUnit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Directory\Helper\Data
的用法示例。
在下文中一共展示了Data::getWeightUnit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getElementHtml
/**
* Add Weight Switcher radio-button element html to weight field
*
* @return string
*/
public function getElementHtml()
{
if (!$this->getForm()->getDataObject()->getTypeInstance()->hasWeight()) {
$this->weightSwitcher->setValue(WeightResolver::HAS_NO_WEIGHT);
}
if ($this->getDisabled()) {
$this->weightSwitcher->setDisabled($this->getDisabled());
}
return '<div class="admin__field-control weight-switcher">' . '<div class="admin__control-switcher" data-role="weight-switcher">' . $this->weightSwitcher->getLabelHtml() . '<div class="admin__field-control-group">' . $this->weightSwitcher->getElementHtml() . '</div>' . '</div>' . '<div class="admin__control-addon">' . parent::getElementHtml() . '<label class="admin__addon-suffix" for="' . $this->getHtmlId() . '"><span>' . $this->directoryHelper->getWeightUnit() . '</span></label>' . '</div>' . '</div>';
}