/**
  * Check - allowed display subwidget or not
  *
  * @param string $name Widget class name
  *
  * @return boolean
  */
 protected function isAllowedWidget($name)
 {
     $result = parent::isAllowedWidget($name);
     if ($result && $this->getProduct()->hasVariants()) {
         switch ($name) {
             case '\\XLite\\View\\Product\\Details\\Customer\\Quantity':
             case '\\XLite\\View\\Product\\Details\\Customer\\Stock':
             case '\\XLite\\View\\Product\\Details\\Customer\\AddButton':
                 $types = $this->getProductModifierTypes();
                 if (empty($types['quantity'])) {
                     $result = false;
                 }
                 break;
             case '\\XLite\\View\\Product\\Details\\Customer\\CommonAttributes':
                 $types = $this->getProductModifierTypes();
                 if (empty($types['weight']) && empty($types['sku'])) {
                     $result = false;
                 }
                 break;
             case '\\XLite\\View\\Product\\Details\\Customer\\EditableAttributes':
                 $types = $this->getProductModifierTypes();
                 if (empty($types['weight']) && empty($types['price'])) {
                     $result = false;
                 }
                 break;
             default:
         }
     }
     return $result;
 }
 /**
  * Check - allowed display subwidget or not
  *
  * @param string $name Widget class name
  *
  * @return boolean
  */
 protected function isAllowedWidget($name)
 {
     $result = parent::isAllowedWidget($name);
     if ($result) {
         switch ($name) {
             case '\\XLite\\Module\\CDev\\Wholesale\\View\\ProductPrice':
                 $types = $this->getProductModifierTypes();
                 if (empty($types['wholesalePrice'])) {
                     $result = false;
                 }
                 break;
             default:
         }
     }
     return $result;
 }