How do I do this? Say, If your order is above $100, then you can pay by COD, else it wont appear, so you can only pay by other methods?
I am using 1.36
Printable View
How do I do this? Say, If your order is above $100, then you can pay by COD, else it wont appear, so you can only pay by other methods?
I am using 1.36
no quick fix or tweak?
You would need to customize the cod.php and change the $this->enable so that it is only true when the Total >= $XXX.XX ...
Hi, I know nuts on php...
which line should I edit?
would the following additional code work?
-------------------------------------------------
// additonal code
if Total >= $100.00 {
$this->enabled = false;
-------------------------------------------------
Pls assist....
You want to try something more like this:
I don't have the "exact" CONSTANT in front of me for the COD shipping part, but you get the idea. You'll want to replace that with the proper one.PHP Code:
if (zen_get_shipping_enabled($this->code) and $total_cart >= 100) {
$this->enabled = ((MODULE_SHIPPING_COD_STATUS == 'True') ? true : false);
}
did I miss something?? the COD is still shown?
my code
-----------------------------------
// turn off COD for low value
if (zen_get_shipping_enabled($this->code) and $total_cart >= 50) {
$this->enabled = ((MODULE_SHIPPING_COD_STATUS == 'True') ? true : false);
}
// turn off COD for table
if (substr_count($_SESSION['shipping']['id'], 'table') == 1) {
$this->enabled = false;
}
// disable the module if the order only contains virtual products
if ($this->enabled == true) {
if ($order->content_type != 'physical') {
$this->enabled = false;
}
}
}
-----------------------------------
Hi, what is this MODULE_SHIPPING_COD_STATUS?
Does not appear any where else in any other file.... I am using 1.36, if that matters
That is probably why it isn't working for you. That was just a DEMO variable I used to represent the actual one (which would be in the module you are trying to edit). I do not have that module in front of me so I don't know the exact terminology.
"MODULE_SHIPPING_COD_STATUS" is the Constant that refers back to the language file for that module (cod).
To make it work, you should replace that with the proper constant value (found in that shipping module you are trying to edit).
Hi, this does not work either
------------------------
// turn off COD for low value
if (zen_get_shipping_enabled($this->code) and $total_cart >= 50) {
$this->enabled = ((MODULE_PAYMENT_COD_STATUS == 'True') ? true : false);
}
-----------------------
I'd have to actually see the page of code you are trying to alter to tell you where to place it and to find out if that code is the exact code you need.
It is the "style" you want to follow though. I used it on a few sites (for shipping etc..) and it worked fine. Again, though, those are different modules.