Example #1
0
 private function setChildSetting(Product $product, $setting, $value)
 {
     $value = trim($value);
     if (substr($value, 0, 1) == '+') {
         $product->setChildSetting($setting, Product::CHILD_ADD);
         $value = substr($value, 1);
     } else {
         if (substr($value, 0, 1) == '-') {
             $product->setChildSetting($setting, Product::CHILD_SUBSTRACT);
             $value = substr($value, 1);
         } else {
             if ($value) {
                 $product->setChildSetting($setting, Product::CHILD_OVERRIDE);
             } else {
                 $value = 0;
                 $product->setChildSetting($setting, '');
             }
         }
     }
     return $value;
 }