N
N
Naim Mahkamov2017-10-30 17:46:26
opencart
Naim Mahkamov, 2017-10-30 17:46:26

Is it possible to make the final discount less than 10%?

Can it be implemented in such a way that during the final pricing, the total final discount will never be more than 10%?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2017-10-30
@zoozag

catalog/model/total/total.php - model responsible for the Total
In it you need to:
1. Get subtotal - $this->cart->getSubTotal(); (it most likely already takes into account the discount for the customer group)
2. Check the customer group $this->customer->getCustomerGroupId();
3. Calculate the desired total with a 10% discount, suppose we call the variable $totalten
4. Replace

'text'       => $this->currency->format(max(0, $total)),
'value'      => max(0, $total),

on the
'text'       => $this->currency->format(max(0, $total, $totalten)),
'value'      => max(0, $total, $totalten),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question