Merge pull request #8329 from BadPixxel/7.0
BugFix Issue #8261: Variants module. Combinations cannot be edited
This commit is contained in:
commit
0b1b740a0e
@ -1677,7 +1677,7 @@ class Product extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newprice != '' || $newprice == 0)
|
if ($newprice !== '' || $newprice === 0)
|
||||||
{
|
{
|
||||||
if ($newpricebase == 'TTC')
|
if ($newpricebase == 'TTC')
|
||||||
{
|
{
|
||||||
@ -1703,8 +1703,8 @@ class Product extends CommonObject
|
|||||||
$price_ttc = ( $newnpr != 1 ) ? price2num($newprice) * (1 + ($newvat / 100)) : $price;
|
$price_ttc = ( $newnpr != 1 ) ? price2num($newprice) * (1 + ($newvat / 100)) : $price;
|
||||||
$price_ttc = price2num($price_ttc,'MU');
|
$price_ttc = price2num($price_ttc,'MU');
|
||||||
|
|
||||||
if ($newminprice != '' || $newminprice == 0)
|
if ( $newminprice !== '' || $newminprice === 0)
|
||||||
{
|
{
|
||||||
$price_min = price2num($newminprice,'MU');
|
$price_min = price2num($newminprice,'MU');
|
||||||
$price_min_ttc = price2num($newminprice) * (1 + ($newvat / 100));
|
$price_min_ttc = price2num($newminprice) * (1 + ($newvat / 100));
|
||||||
$price_min_ttc = price2num($price_min_ttc,'MU');
|
$price_min_ttc = price2num($price_min_ttc,'MU');
|
||||||
|
|||||||
@ -346,12 +346,12 @@ if (! empty($id) || ! empty($ref))
|
|||||||
foreach ($prodattr_all as $each) {
|
foreach ($prodattr_all as $each) {
|
||||||
$prodattr_alljson[$each->id] = $each;
|
$prodattr_alljson[$each->id] = $each;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
variants_available = <?php echo json_encode($prodattr_alljson) ?>;
|
variants_available = <?php echo json_encode($prodattr_alljson); ?>;
|
||||||
variants_selected = {
|
variants_selected = {
|
||||||
index: [],
|
index: [],
|
||||||
info: []
|
info: []
|
||||||
@ -425,8 +425,11 @@ if (! empty($id) || ! empty($ref))
|
|||||||
print '<form method="post" id="combinationform" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="post" id="combinationform" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="id" value="'.dol_escape_htmltag($id).'">'."\n";
|
print '<input type="hidden" name="id" value="'.dol_escape_htmltag($id).'">'."\n";
|
||||||
print '<input type="hidden" name="action" value="create">'."\n";
|
print '<input type="hidden" name="action" value="' . (($valueid > 0) ? "update" : "create") .'">'."\n";
|
||||||
|
if($valueid > 0) {
|
||||||
|
print '<input type="hidden" name="valueid" value="' . $valueid .'">'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print dol_fiche_head();
|
print dol_fiche_head();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -485,7 +488,7 @@ if (! empty($id) || ! empty($ref))
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($selectedvariant)) {
|
if (is_array($productCombination2ValuePairs1)) {
|
||||||
?>
|
?>
|
||||||
<hr>
|
<hr>
|
||||||
<table class="border" style="width: 100%">
|
<table class="border" style="width: 100%">
|
||||||
@ -494,18 +497,17 @@ if (! empty($id) || ! empty($ref))
|
|||||||
<td class="tdtop">
|
<td class="tdtop">
|
||||||
<div class="inline-block valignmiddle quatrevingtpercent">
|
<div class="inline-block valignmiddle quatrevingtpercent">
|
||||||
<?php
|
<?php
|
||||||
if (is_array($selectedvariant))
|
if (is_array($productCombination2ValuePairs1))
|
||||||
{
|
{
|
||||||
foreach ($selectedvariant as $key => $val) {
|
foreach ($productCombination2ValuePairs1 as $key => $val) {
|
||||||
$tmp = explode(':',$val);
|
$result1 = $prodattr->fetch($val->fk_prod_attr);
|
||||||
$result1 = $prodattr->fetch($tmp[0]);
|
$result2 = $prodattr_val->fetch($val->fk_prod_attr_val);
|
||||||
$result2 = $prodattr_val->fetch($tmp[1]);
|
if ($result1 > 0 && $result2 > 0)
|
||||||
if ($result1 > 0 && $result2 > 0)
|
{
|
||||||
{
|
print $prodattr->label . ' - '.$prodattr_val->value.'<br>';
|
||||||
print $prodattr->label . ' - '.$prodattr_val->value.'<br>';
|
// TODO Add delete link
|
||||||
// TODO Add delete link
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -533,7 +535,7 @@ if (! empty($id) || ! empty($ref))
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<input type="submit" name="create" <?php if (! is_array($selectedvariant)) print ' disabled="disabled"'; ?> value="<?php echo $action == 'add' ? $langs->trans('Create') : $langs->trans('Save') ?>" class="button">
|
<input type="submit" name="create" <?php if (! is_array($productCombination2ValuePairs1)) print ' disabled="disabled"'; ?> value="<?php echo $action == 'add' ? $langs->trans('Create') : $langs->trans('Save') ?>" class="button">
|
||||||
|
|
||||||
<input type="submit" name="cancel" value="<?php echo $langs->trans('Cancel'); ?>" class="button">
|
<input type="submit" name="cancel" value="<?php echo $langs->trans('Cancel'); ?>" class="button">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user