Add Saved Values vom DB
This commit is contained in:
parent
ca26e6a7d1
commit
1bfb9cbd6f
@ -72,13 +72,15 @@ class Valid
|
|||||||
|
|
||||||
if($this->engine->getVariables()[$option->getId()] == $opt->getId()) {
|
if($this->engine->getVariables()[$option->getId()] == $opt->getId()) {
|
||||||
$opt->setIsSelected(true);
|
$opt->setIsSelected(true);
|
||||||
|
}else{
|
||||||
|
$opt->setIsSelected(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($opt->isValid() && !$valid) {
|
if($opt->isValid() && !$valid) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$option->processValue();
|
||||||
$option->setIsValid($valid);
|
$option->setIsValid($valid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ class PaperDbSelect extends Select
|
|||||||
$opt->setId($this->savedCalcValues[$this->getId()]['art_nr']);
|
$opt->setId($this->savedCalcValues[$this->getId()]['art_nr']);
|
||||||
$opt->setLabel($this->savedCalcValues[$this->getId()]['description_1']);
|
$opt->setLabel($this->savedCalcValues[$this->getId()]['description_1']);
|
||||||
|
|
||||||
|
|
||||||
$paper = $this->newPaperObject;
|
$paper = $this->newPaperObject;
|
||||||
$paper->setId($this->savedCalcValues[$this->getId()]['id']);
|
$paper->setId($this->savedCalcValues[$this->getId()]['id']);
|
||||||
$paper->setArtNr($this->savedCalcValues[$this->getId()]['art_nr']);
|
$paper->setArtNr($this->savedCalcValues[$this->getId()]['art_nr']);
|
||||||
@ -37,6 +38,8 @@ class PaperDbSelect extends Select
|
|||||||
|
|
||||||
$opt->setPaper($paper);
|
$opt->setPaper($paper);
|
||||||
|
|
||||||
|
$this->addOption($opt);
|
||||||
|
|
||||||
return $opt;
|
return $opt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,12 +37,9 @@ class Select extends Base
|
|||||||
*/
|
*/
|
||||||
public function processValue()
|
public function processValue()
|
||||||
{
|
{
|
||||||
/** @var Opt $opt */
|
$option = $this->getSelectedOption();
|
||||||
foreach($this->options as $opt)
|
if($option) {
|
||||||
{
|
$this->setValue($option->getLabel());
|
||||||
if($opt->getId() == $this->getRawValue()) {
|
|
||||||
$this->setValue($opt->getLabel());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,5 +52,7 @@ class PaperSavedTest extends \PHPUnit_Framework_TestCase
|
|||||||
"offset_fix" => "0", "offset_var" => "0", "digital_fix" => "0", "digital_var" => "0", "volume" => "0.118" ] ]);
|
"offset_fix" => "0", "offset_var" => "0", "digital_fix" => "0", "digital_var" => "0", "volume" => "0.118" ] ]);
|
||||||
|
|
||||||
$this->assertEquals(162.19, $this->engine->getPrice());
|
$this->assertEquals(162.19, $this->engine->getPrice());
|
||||||
|
|
||||||
|
$this->assertEquals("Bilderdruck matt 250 gr", $this->engine->getArticle()->getOptionById('papier')->getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user