Thread: cod.php

Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2008
    Posts
    32
    Plugin Contributions
    0

    Default cod.php

    I was wondering is there a way i can modify the cod.php file so that you are not able to select cash on delivery if the order is above thirty pounds ?

  2. #2
    Join Date
    Sep 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: cod.php

    if anyone could help that would be great !!!! ive been trying to solve this for a wile really need it to be done !! :)

  3. #3
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    541
    Plugin Contributions
    0

    Default Re: cod.php

    Try this modification havent tested it but it should work.

    Replace lines 66 - 72

    Code:
    // disable the module if the order only contains virtual products
          if ($this->enabled == true) {
            if ($order->content_type != 'physical') {
              $this->enabled = false;
            }
          }
        }
    with this code
    ($totalsum should be in your main currency, $transaction_amount is the currency selected by the customer)

    Code:
    $my_currency = select_pp_currency();
    $totalsum = $order->info['total'];
    $transaction_amount = ($totalsum * $currencies->get_value($my_currency));
    
    // disable the module if the order only contains virtual products OR order total is more than 30
          if ($this->enabled == true) {
            if ($order->content_type != 'physical') {
              $this->enabled = false;
            } elseif ($totalsum > 30) {
    			$this->enabled = false;
    		  }
          }
        }

  4. #4
    Join Date
    Sep 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: cod.php

    thanks for the response :)

    i did the modifications however the page just goes blank now so i think there is something small with the code causing the problem any ideas ??

  5. #5
    Join Date
    Jul 2009
    Posts
    234
    Plugin Contributions
    1

    Default Re: cod.php

    it might be my eyes, but looks like there is one extra squigly bracket ....that might be the problem

  6. #6
    Join Date
    Sep 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: cod.php

    Code:
    $newd = ($_SESSION['cart']->show_total()); 
    
    // disable the module if the order only contains virtual products OR order total is more than 30
          if ($this->enabled == true) {
            if ($order->content_type != 'physical') {
              $this->enabled = false;
            } elseif ($newd > 30) {
    			$this->enabled = false;
    		  }
          }
    
        }

    got it working with a small mod thankyou :)

 

 

Similar Threads

  1. Replies: 4
    Last Post: 17 Jul 2015, 04:44 AM
  2. 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
  3. Cod
    By x9100 in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 4 Mar 2008, 05:57 PM
  4. Cod
    By godspeed27 in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 25 Jun 2006, 05:28 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR