This is an old revision of the document!
Quantity discount
Coupon discount
Coupon discount completely overrides quantity discount. This means, if coupon code is entered, only coupon discount is used for price calculation. If no coupon code entered, quantity discount is used for price calculation (if activated in settings files).
Discount realization
The discount is showed on page as written in following screen shot.
In mail it is stated on a line just before “Totalt å betale”.
**There are two files was changed for merkalt.no: js\render.js and index.php.
And two files for merkalt.no\bedrift: js\render.js and index2.php.
**
All code, used for displaying of discounts surrounded with comments: begins with a string “DISCOUNT BLOCK BEGIN” and ends with “DISCOUNT BLOCK END”.
So, if you need to remove displaying of discount, you need to find such comments in files mentioned above and to comment out all strings between “DISCOUNT BLOCK BEGIN” and “DISCOUNT BLOCK END” the same way like this rows commented. For example:
PHP code:
If you find
// DISCOUNT BLOCK BEGIN
$whole_total += (int)$_POST['price_whole'.$section];
// DISCOUNT BLOCK END
comment it such way
//DISCOUNT BLOCK BEGIN
//$whole_total += (int)$_POST['price_whole'.$section];
//DISCOUNT BLOCK END
HTML code:
If you find
<!-- DISCOUNT BLOCK BEGIN -->
<input type="hidden" id="price_whole1" name="price_whole1" value="10" />
<!-- DISCOUNT BLOCK END -->
comment it such way
<!-- DISCOUNT BLOCK BEGIN -->
<!-- input type="hidden" id="price_whole1" name="price_whole1" value="10" / -->
<!-- DISCOUNT BLOCK END -->
JavaScript code:
If you find
// DISCOUNT BLOCK BEGIN
$('disc_amt').innerHTML = totalfullinnerHTML-totalinnerHTML;
// DISCOUNT BLOCK END
comment it such way
// DISCOUNT BLOCK BEGIN
// $('disc_amt').innerHTML = totalfullinnerHTML-totalinnerHTML;
// DISCOUNT BLOCK END
ATTENTION:
In index.php for merkalt.no and index2.php in bedrift subdirectory when you find and comment code:
// DISCOUNT BLOCK BEGIN
$disc_amt = $whole_total - $total;
array_push($table, array('Fraktkostnad', '', 'GRATIS', ''), array('Discount amount', '', 'Kr. '.$disc_amt, ''), array('Totalt е betale (ink. mva)', '', 'Kr. '.$total, ''));
array_push($table_customer, array('Fraktkostnad', '', 'GRATIS'), array('Discount amount', '', 'Kr. '.$disc_amt), array('Totalt е betale (ink. mva)', '', 'Kr. '.$total));
// DISCOUNT BLOCK END
please uncomment (delete double “/” characters from the beginning of row) the following rows above it:
//array_push($table, array('Fraktkostnad', '', 'GRATIS', ''), array('Totalt е betale (ink. mva)', '', 'Kr. '.$total, ''));
//array_push($table_customer, array('Fraktkostnad', '', 'GRATIS'), array('Totalt е betale (ink. mva)', '', 'Kr. '.$total));

