Hello everyone!
I am a new zencart user ( version 1.37)
I need help to eliminate pay by COD for amounts exceeding the 200 euro ....
![]()
Hello everyone!
I am a new zencart user ( version 1.37)
I need help to eliminate pay by COD for amounts exceeding the 200 euro ....
![]()
(Firstly, I'd advise you upgrade to 1.3.8a if your shop is not yet operational.)
To "disable" the COD option when the EUR200 threshold is reached, you could try putting an "IF" condition into the COD payment module.
I don't know how to code this, but I imagine the condition would be inserted into
includes/modules/payment/cod.php
20 years a Zencart User
Hi and first of all thanks a lot for answering so fast!!
I analyze the file payement/cod.php and i found this condition ( line 69) that "hide" the COD for virtual products
//**if ($this->enabled == true) {
if ($order->content_type != 'physical') {
$this->enabled = false;
}
}**//
of course i need to recall all the order that the client is making and not the tipology of the object itself...
Searching in Zencart similary function i notice that in the file shipping/table.php ( from the line 93 and on) were defined the application's mode and the value of the sending costs based on the entir order, the weight and so on...
//**switch (MODULE_SHIPPING_TABLE_MODE) {
case ('price'):
$order_total = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
break;
case ('weight'):
$order_total = $shipping_weight;
break;
case ('item'):
$order_total = $total_count - $_SESSION['cart']->free_shipping_items();
break;
}**//
Now i'm trying to "melt" the two parts to get the hopened result...
if i found a solution i'll share it , if anyone has some suggests i'll appreciate it !!!!
thanks again and sorry for my english.
Hello ...
Finally I found a solution!
Just enter this "if" in the cod.php (line 64)
//**
if ($this->enabled == true) {
if ($order_total = $_SESSION['cart']->show_total()>= " 200 ") {
$this->enabled = false;
}
}
**//
Where "200" is the total value of the order ...
I hope it can be useful ...
Good night and thanks again
Excellent stuff! Glad you found the answer... and I agree, this could be useful to many other people!
PS: I'm no PHP coder, but should the value 200 be in inverted commas? Or not?
If a PHP expert is around, please advise... I seem to recall that numerical values (as opposed to text strings) are NOT enclosed in inverted commas.
Last edited by schoolboy; 4 Mar 2008 at 11:39 AM.
20 years a Zencart User
Hello ...
You are right !
value 200 should not be included in inverted commas.
Thanks again![]()