Check if cart = 0 / coupon used

20.10.2014 16:12
#1
Jobos1
Joomshopping forum user no avatar
Name: J
07.10.2014
Posts: 30
Quote
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
#2
webdesigner
(Support Team)
User webdesigner
Name: Admin
05.08.2010
Posts: 16475
Quote
Aw: Check if cart = 0 / coupon used

See
http://demo.joomshopping.com/shop/cart/view

 
20.10.2014 16:23
#3
Jobos1
Joomshopping forum user no avatar
Name: J
07.10.2014
Posts: 30
Quote
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
#4
webdesigner
(Support Team)
User webdesigner
Name: Admin
05.08.2010
Posts: 16475
Quote
Aw: Check if cart = 0 / coupon used

See controller / checkout.php

$cart->getSum();

 
20.10.2014 16:55
#5
Jobos1
Joomshopping forum user no avatar
Name: J
07.10.2014
Posts: 30
Quote
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
#6
Jobos1
Joomshopping forum user no avatar
Name: J
07.10.2014
Posts: 30
Quote
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
#7
Jobos1
Joomshopping forum user no avatar
Name: J
07.10.2014
Posts: 30
Quote
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
#8
webdesigner
(Support Team)
User webdesigner
Name: Admin
05.08.2010
Posts: 16475
Quote
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
#9
Jobos1
Joomshopping forum user no avatar
Name: J
07.10.2014
Posts: 30
Quote
Aw: Check if cart = 0 / coupon used

Perfect!

Thank you very much.

It now redirects directly to step5 but this is no problem.

 
Copyrights MAXXmarketing GmbH. All Rights Reserved