Thread: Cod

Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2008
    Location
    Firenze
    Posts
    4
    Plugin Contributions
    0

    red flag Cod

    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 ....

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Cod

    (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

  3. #3
    Join Date
    Feb 2008
    Location
    Firenze
    Posts
    4
    Plugin Contributions
    0

    red flag Re: Cod

    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.

  4. #4
    Join Date
    Feb 2008
    Location
    Firenze
    Posts
    4
    Plugin Contributions
    0

    red flag Re: Cod

    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

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Cod

    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

  6. #6
    Join Date
    Feb 2008
    Location
    Firenze
    Posts
    4
    Plugin Contributions
    0

    Default Re: Cod

    Hello ...
    You are right !
    value 200 should not be included in inverted commas.


    Thanks again

 

 

Similar Threads

  1. v150 Need some Help in COD. COD fee depending on order price
    By bratsangels in forum Built-in Shipping and Payment Modules
    Replies: 20
    Last Post: 16 Sep 2012, 12:53 PM
  2. Cod
    By godspeed27 in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 25 Jun 2006, 05:28 AM
  3. COD Fee
    By Svanis in forum Basic Configuration
    Replies: 4
    Last Post: 23 Jun 2006, 02:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg