Quellcode durchsuchen

Calcul des frais de livraisons

feature/section_export
Fabien Normand vor 1 Monat
Ursprung
Commit
6a1f435d94
1 geänderte Dateien mit 12 neuen und 4 gelöschten Zeilen
  1. +12
    -4
      Solver/Product/ProductSolver.php

+ 12
- 4
Solver/Product/ProductSolver.php Datei anzeigen

@@ -119,18 +119,18 @@ class ProductSolver
if ($product->getTitle()) {
$endOfTitle = $product->getTitle();
} else {
$endOfTitle = $this->getQuantityInherited($product).' '.$this->getUnitInherited($product)->getWordingShort();
$endOfTitle = $this->getQuantityInherited($product) . ' ' . $this->getUnitInherited($product)->getWordingShort();
}
return $product->getProductFamily()->getTitle(). ' - '. $endOfTitle;
return $product->getProductFamily()->getTitle() . ' - ' . $endOfTitle;
}

public function getQuantityInherited(ProductInterface $product)
{
if ($product->getQuantity()) {
return $product->getQuantity();
} else if($product->getProductFamily()->getQuantity()){
} else if ($product->getProductFamily()->getQuantity()) {
return $product->getProductFamily()->getQuantity();
}else{
} else {
return 1;
}
}
@@ -210,4 +210,12 @@ class ProductSolver

return null;
}

public function getWeightInherited(ProductInterface $product): ? float
{
if ($product->getWeight()) {
return $product->getWeight();
}
return $product->getProductFamily()->getWeight();
}
}

Laden…
Abbrechen
Speichern