Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Apr 2010
    Posts
    39
    Plugin Contributions
    0

    Default Re: Disable COD Payment

    Thanks for your detailed explanation.
    I am indeed begun wrong with this topic.
    Now I had my information in the first post to fit, but it will be even more confusing.
    Maybe I should start a new topic for clarity?

    I will briefly explain what I want to do anything to summarize.
    I want to remove the moneyorder option for a customer.

    In the beginning of the topic I started about cod, but I had the wrong translation for myself.
    The change I would therefore run the file moneyorder.php

    If I put the following code in my file:

    Code:
          if (strstr($_SESSION['customers_id'],'3739')){
    	$this->enabled = false;
          }
    The option for selecting "moneyorder" is not showing at all if i put (!strstr in the code.
    Without the !strstr the option is showing for everyone.
    Including for customer 3739.

    I hope that now have more clearly put down.
    Problem for me also is the translation.
    Last edited by mdo82; 17 Jun 2014 at 04:19 PM.

  2. #12
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Disable COD Payment

    Quote Originally Posted by mdo82 View Post
    Maybe I should start a new topic for clarity?
    No, it's probably best to leave it here,

    Quote Originally Posted by mdo82 View Post

    If I put the following code in my file:

    Code:
          if (strstr($_SESSION['customers_id'],'3739')){
        $this->enabled = false;
          }
    The option for selecting "moneyorder" is not showing at all if i put (!strstr in the code.
    Without the !strstr the option is showing for everyone.
    Including for customer 3739.
    This is telling me that the 'if' check isn't functioning as expected.

    Try this:
    Find the line of code that reads:
    Code:
      $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
    Then add the following code immediately after it
    Code:
      if(($_SESSION['customer_id']) == "3739")  $this->enabled = false ;
    I've confirmed/verified that this works. There is no need to use 'strstr' because you are looking for an exact match. If you do use the 'strstr' ) and assuming it works) it would *also* match customerID's '123739' and '3739123' as well as all other customers with '3739' as *part* (substring) of their Id, which *isn't* what you want.

    Cheers
    RodG

  3. #13
    Join Date
    Apr 2010
    Posts
    39
    Plugin Contributions
    0

    Default Re: Disable COD Payment

    Quote Originally Posted by RodG View Post
    No, it's probably best to leave it here,



    This is telling me that the 'if' check isn't functioning as expected.

    Try this:
    Find the line of code that reads:
    Code:
      $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
    Then add the following code immediately after it
    Code:
      if(($_SESSION['customer_id']) == "3739")  $this->enabled = false ;
    I've confirmed/verified that this works. There is no need to use 'strstr' because you are looking for an exact match. If you do use the 'strstr' ) and assuming it works) it would *also* match customerID's '123739' and '3739123' as well as all other customers with '3739' as *part* (substring) of their Id, which *isn't* what you want.

    Cheers
    RodG
    Thank you for your clear explanation.
    It now works as I want

    Thank you!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v139h Disable COD When Customer Opts for USPS?
    By bi11i in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 17 Dec 2012, 12:04 PM
  2. disable cod
    By 100asa in forum General Questions
    Replies: 16
    Last Post: 20 Oct 2011, 05:07 PM
  3. Cod payment
    By Joe1 in forum Addon Payment Modules
    Replies: 0
    Last Post: 16 Apr 2011, 04:25 PM

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