Merge pull request #14748 from andreubisquerra/master
Show buttons on products when 'Hide Product Images' is enabled
This commit is contained in:
commit
a6a2c6cfe1
@ -141,6 +141,27 @@ button.calcbutton3 {
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button.productbutton {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
padding: 0;
|
||||||
|
line-height: normal;
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-align: center;
|
||||||
|
overflow: visible; /* removes extra width in IE */
|
||||||
|
width: calc(100% - 2px);
|
||||||
|
height: calc(100% - 2px);
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: #a3a6a3;
|
||||||
|
color: #fff;
|
||||||
|
/* border-color: unset; */
|
||||||
|
border-width: 0;
|
||||||
|
margin: 1px;
|
||||||
|
font-size: 14pt;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
button.actionbutton {
|
button.actionbutton {
|
||||||
background: #EABCA6;
|
background: #EABCA6;
|
||||||
border: 2px solid #EEE;
|
border: 2px solid #EEE;
|
||||||
|
|||||||
@ -291,12 +291,18 @@ function LoadProducts(position, issubcat) {
|
|||||||
//console.log("ishow"+ishow+" idata="+idata);
|
//console.log("ishow"+ishow+" idata="+idata);
|
||||||
console.log(data[idata]);
|
console.log(data[idata]);
|
||||||
if (typeof (data[idata]) == "undefined") {
|
if (typeof (data[idata]) == "undefined") {
|
||||||
$("#prodivdesc"+ishow).hide();
|
<?php if (!$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES)
|
||||||
$("#prodesc"+ishow).text("");
|
{
|
||||||
|
echo '$("#prodivdesc"+ishow).hide();';
|
||||||
|
echo '$("#prodesc"+ishow).text("");';
|
||||||
|
echo '$("#proimg"+ishow).attr("title","");';
|
||||||
|
echo '$("#proimg"+ishow).attr("src","genimg/empty.png");';
|
||||||
|
} else {
|
||||||
|
echo '$("#probutton"+ishow).hide();';
|
||||||
|
echo '$("#probutton"+ishow).text("");';
|
||||||
|
}?>
|
||||||
$("#proprice"+ishow).attr("class", "hidden");
|
$("#proprice"+ishow).attr("class", "hidden");
|
||||||
$("#proprice"+ishow).html("");
|
$("#proprice"+ishow).html("");
|
||||||
$("#proimg"+ishow).attr("title","");
|
|
||||||
$("#proimg"+ishow).attr("src","genimg/empty.png");
|
|
||||||
$("#prodiv"+ishow).data("rowid","");
|
$("#prodiv"+ishow).data("rowid","");
|
||||||
$("#prodiv"+ishow).attr("class","wrapper2 divempty");
|
$("#prodiv"+ishow).attr("class","wrapper2 divempty");
|
||||||
$("#prowatermark"+ishow).hide();
|
$("#prowatermark"+ishow).hide();
|
||||||
@ -308,14 +314,22 @@ function LoadProducts(position, issubcat) {
|
|||||||
$titlestring .= " + ' - ".dol_escape_js($langs->trans("Barcode").': ')."' + data[idata]['barcode']";
|
$titlestring .= " + ' - ".dol_escape_js($langs->trans("Barcode").': ')."' + data[idata]['barcode']";
|
||||||
?>
|
?>
|
||||||
var titlestring = <?php echo $titlestring; ?>;
|
var titlestring = <?php echo $titlestring; ?>;
|
||||||
$("#prodivdesc"+ishow).show();
|
<?php if (!$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES)
|
||||||
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
|
{
|
||||||
|
echo '$("#prodivdesc"+ishow).show();';
|
||||||
|
echo '$("#prodesc"+ishow).text(data[parseInt(idata)][\'label\']);';
|
||||||
|
echo '$("#proimg"+ishow).attr("title", titlestring);';
|
||||||
|
echo '$("#proimg"+ishow).attr("src", "genimg/index.php?query=pro&id="+data[idata][\'id\']);';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo '$("#probutton"+ishow).show();';
|
||||||
|
echo '$("#probutton"+ishow).text(data[parseInt(idata)][\'label\']);';
|
||||||
|
}
|
||||||
|
?>
|
||||||
if (data[parseInt(idata)]['price_formated']) {
|
if (data[parseInt(idata)]['price_formated']) {
|
||||||
$("#proprice"+ishow).attr("class", "productprice");
|
$("#proprice"+ishow).attr("class", "productprice");
|
||||||
$("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']);
|
$("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']);
|
||||||
}
|
}
|
||||||
$("#proimg"+ishow).attr("title", titlestring);
|
|
||||||
$("#proimg"+ishow).attr("src", "genimg/index.php?query=pro&id="+data[idata]['id']);
|
|
||||||
$("#prodiv"+ishow).data("rowid", data[idata]['id']);
|
$("#prodiv"+ishow).data("rowid", data[idata]['id']);
|
||||||
$("#prodiv"+ishow).data("iscat", 0);
|
$("#prodiv"+ishow).data("iscat", 0);
|
||||||
$("#prodiv"+ishow).attr("class","wrapper2");
|
$("#prodiv"+ishow).attr("class","wrapper2");
|
||||||
@ -1070,11 +1084,14 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE)
|
|||||||
//echo '<img class="imgwrapper" src="img/arrow-next-top.png" height="100%" id="proimg'.$count.'" />';
|
//echo '<img class="imgwrapper" src="img/arrow-next-top.png" height="100%" id="proimg'.$count.'" />';
|
||||||
print '<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
|
print '<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
|
||||||
} else {
|
} else {
|
||||||
print '<div class="" id="proprice'.$count.'"></div>';
|
if ($conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) echo '<button type="button" id="probutton'.$count.'" class="productbutton" style="display: none;"></button>';
|
||||||
if (!$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) print '<img class="imgwrapper" height="100%" title="" id="proimg'.$count.'">';
|
else {
|
||||||
|
print '<div class="" id="proprice'.$count.'"></div>';
|
||||||
|
print '<img class="imgwrapper" height="100%" title="" id="proimg'.$count.'">';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php if ($count != ($MAXPRODUCT - 2) && $count != ($MAXPRODUCT - 1)) { ?>
|
<?php if ($count != ($MAXPRODUCT - 2) && $count != ($MAXPRODUCT - 1) && !$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) { ?>
|
||||||
<div class="description" id="prodivdesc<?php echo $count; ?>">
|
<div class="description" id="prodivdesc<?php echo $count; ?>">
|
||||||
<div class="description_content" id="prodesc<?php echo $count; ?>"></div>
|
<div class="description_content" id="prodesc<?php echo $count; ?>"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user