20.10.2014 16:12
|
|
Jobos1
Name: J
07.10.2014
Posts: 30
|
Check if cart = 0 / coupon used
Hello!
I would like to check if the customer cart value = 0 at the checkout (because of using a coupon).
If he uses it, I want to set the payment-method select area to display: none; because then it is useless.
With which function or query can I check whether the customer entered a coupon code or the total order amount is 0?
if ($order_total == 0) doesn't work..
Thank you!
|
|
20.10.2014 16:18
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25930
|
Aw: Check if cart = 0 / coupon used
See
http://demo.joomshopping.com/shop/cart/view
|
|
20.10.2014 16:23
|
|
Jobos1
Name: J
07.10.2014
Posts: 30
|
Aw: Check if cart = 0 / coupon used
Hi and thanks for the answer.
But the customer should have a product in cart and then I want to check if he uses a coupon, that makes the total value 0. Because then I want to hide the payment settings.
|
|
20.10.2014 16:29
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25930
|
Aw: Check if cart = 0 / coupon used
See controller / checkout.php
$cart->getSum();
|
|
20.10.2014 16:55
|
|
Jobos1
Name: J
07.10.2014
Posts: 30
|
Aw: Check if cart = 0 / coupon used
How can I include this in the payment.php?
I also tried with
<?php print formatprice($this->summ_payment);?><?php print $this->_tmp_ext_payment?>
but this always shows 0..
Letzte Änderung: 20.10.2014 17:06
|
|
20.10.2014 21:06
|
|
Jobos1
Name: J
07.10.2014
Posts: 30
|
Aw: Check if cart = 0 / coupon used
If I want to execute the function getSum(); the page is displayed incorrect..
|
|
21.10.2014 19:04
|
|
Jobos1
Name: J
07.10.2014
Posts: 30
|
Aw: Check if cart = 0 / coupon used
Can you please help me?
I can't get it to work and it might also be interesting to other people.
|
|
21.10.2014 20:31
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25930
|
Aw: Check if cart = 0 / coupon used
Try
Change
Controller / checkout
function step2save(){
after
$cart->setShippingId(0);
$cart->setShippingPrId(0);
$cart->setShippingPrice(0);
$cart->setPaymentId(0);
$cart->setPaymentParams("");
$cart->setPaymentPrice(0);
Add
if ($cart->getSum(0, 1, 0)==0){
$jshopConfig->without_payment = 1;
}
|
|
21.10.2014 21:55
|
|
Jobos1
Name: J
07.10.2014
Posts: 30
|
Aw: Check if cart = 0 / coupon used
Perfect!
Thank you very much.
It now redirects directly to step5 but this is no problem.
|
|