Page 1 of 2 12 LastLast
Results 1 to 10 of 3052

Hybrid View

  1. #1
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    You can use preg_match on each of those fields to weed those out:
    Code:
    if (preg_match('/[!@$%^&*\(\)\+\?><>:"{}|\[\]\;\/=_]/', $variable_name)) {
        // Contains unwanted characters
    }
    I'll need to review the various spots within OPC where I can throw notifications that enable you to provide those additional checks.

    Note that there's a sweet little tool (rubular.com) that can help you test various regex patterns.

    GitHub issue for tracking: https://github.com/lat9/one_page_checkout/issues/226
    Lat9

    That would be great!

    Thanks, I'll check rubular out.

  2. #2
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by linuxguy2 View Post
    Lat9

    That would be great!

    Thanks, I'll check rubular out.
    Hi Lat9,

    You probably are way ahead of me on this but when the notice (Characters ..... not allowed in this field) is thrown I'd like the form to retain data that has already been entered.

    Thanks,

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by linuxguy2 View Post
    Hi Lat9,

    You probably are way ahead of me on this but when the notice (Characters ..... not allowed in this field) is thrown I'd like the form to retain data that has already been entered.

    Thanks,
    Understood.

  4. #4

    Default Re: One-Page Checkout [Support Thread]

    Hello, I am having some template related issue resulting in

    Your order's details have changed. Please review the current values and re-submit.

    Fresh zencart 1.5.6.b with only CEON URI installed and the OPC 2.2.2.

    When I test it with the responsive template OPC seems to work nicely, but when I change to my template GOODWIN something goes wrong and

    Message Your order's details have changed. Please review the current values and re-submit. appears.

    I am using only cod as payment and store pickup delivery.

    What may cause this error? It is quite possible something from the template part but where to look for?

    Kind regards.
    My most recent work: magprom.net

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by perfumbg View Post
    Hello, I am having some template related issue resulting in

    Your order's details have changed. Please review the current values and re-submit.

    Fresh zencart 1.5.6.b with only CEON URI installed and the OPC 2.2.2.

    When I test it with the responsive template OPC seems to work nicely, but when I change to my template GOODWIN something goes wrong and

    Message Your order's details have changed. Please review the current values and re-submit. appears.

    I am using only cod as payment and store pickup delivery.

    What may cause this error? It is quite possible something from the template part but where to look for?

    Kind regards.
    That themeforest template, as others from that template-provider, make various non-standard changes to the store's /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_order_totals.php. Those changes make it so that OPC can't locate the order's current total, resulting in that 'details changed' message.

    I'll update the One-Page Checkout documentation to indicate that all templates from themeforest are problematic.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    That themeforest template, as others from that template-provider, make various non-standard changes to the store's /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_order_totals.php. Those changes make it so that OPC can't locate the order's current total, resulting in that 'details changed' message.

    I'll update the One-Page Checkout documentation to indicate that all templates from themeforest are problematic.
    I might be able to work out something. If you enable the One-Page Checkout's debug ... just prior to clicking the "Confirm" button, an OPC log will be created in the site's /logs directory that will identify what the underlying loop-back issue is.

    I'll PM you my direct email address and you can send me that log for analysis.

  7. #7

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    I might be able to work out something. If you enable the One-Page Checkout's debug ... just prior to clicking the "Confirm" button, an OPC log will be created in the site's /logs directory that will identify what the underlying loop-back issue is.

    I'll PM you my direct email address and you can send me that log for analysis.

    Yes I have the debug file you can download it from http://autofox.net/OPC.log

    Thank you in advance.
    Last edited by perfumbg; 4 Feb 2020 at 05:09 PM.
    My most recent work: magprom.net

  8. #8
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by linuxguy2 View Post
    Hi Lat9,

    You probably are way ahead of me on this but when the notice (Characters ..... not allowed in this field) is thrown I'd like the form to retain data that has already been entered.

    Thanks,
    Hi, Lat9

    I have researched how preg_match works and was able to do some matches in test files but I'm totally lost on how to properly implement it in Zencart..
    Tried this but I know there needs to be more code involved.
    I'm looking for a way to limit the company name to only alphanumeric Characters with the appropriate warning if the rule is not followed.
    Here's what I tried in includes/modules/clone_classic/create_account.php around line 130 but no joy.

    Thank You for Your time.

    Code:
    if (ACCOUNT_COMPANY == 'true') {
        if ((int)ENTRY_COMPANY_MIN_LENGTH > 0 && strlen($company) < ENTRY_COMPANY_MIN_LENGTH) {
    	 ////// ADDED 02-04-2020
    	  if (preg_match('/^/[A-Za-z0-9]$/', $company)); {
    	  //////////
    	
          $error = true;
          $messageStack->add('create_account', ENTRY_COMPANY_ERROR);
        
    	////
    		}
    	////
    	
    	}
      }

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by linuxguy2 View Post
    Hi, Lat9

    I have researched how preg_match works and was able to do some matches in test files but I'm totally lost on how to properly implement it in Zencart..
    Tried this but I know there needs to be more code involved.
    I'm looking for a way to limit the company name to only alphanumeric Characters with the appropriate warning if the rule is not followed.
    Here's what I tried in includes/modules/clone_classic/create_account.php around line 130 but no joy.

    Thank You for Your time.

    Code:
    if (ACCOUNT_COMPANY == 'true') {
        if ((int)ENTRY_COMPANY_MIN_LENGTH > 0 && strlen($company) < ENTRY_COMPANY_MIN_LENGTH) {
         ////// ADDED 02-04-2020
          if (preg_match('/^/[A-Za-z0-9]$/', $company)); {
          //////////
        
          $error = true;
          $messageStack->add('create_account', ENTRY_COMPANY_ERROR);
        
        ////
            }
        ////
        
        }
      }
    Try changing that to
    Code:
    if (ACCOUNT_COMPANY == 'true') {
        if (((int)ENTRY_COMPANY_MIN_LENGTH > 0 && strlen($company) < ENTRY_COMPANY_MIN_LENGTH) || !preg_match('/^/[A-Za-z0-9]$/', $company)) {
          $error = true;
          $messageStack->add('create_account', ENTRY_COMPANY_ERROR);
        }
    }

  10. #10
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    Try changing that to
    Code:
    if (ACCOUNT_COMPANY == 'true') {
        if (((int)ENTRY_COMPANY_MIN_LENGTH > 0 && strlen($company) < ENTRY_COMPANY_MIN_LENGTH) || !preg_match('/^/[A-Za-z0-9]$/', $company)) {
          $error = true;
          $messageStack->add('create_account', ENTRY_COMPANY_ERROR);
        }
    }
    Excellent!!! Works after a slight mod. Removed the / after the circumflex and added + before the $ sign to repeat characters.
    What was the purpose of the /
    Also tweaked the "ENTRY_COMPANY_ERROR" Define.
    Thank You for Your Time and Expertise!

    Code:
    if (ACCOUNT_COMPANY == 'true') {
        if (((int)ENTRY_COMPANY_MIN_LENGTH > 0 && strlen($company) < ENTRY_COMPANY_MIN_LENGTH) || !preg_match('/^[A-Za-z0-9]+$/', $company)) {
          $error = true;
          $messageStack->add('create_account', ENTRY_COMPANY_ERROR);
        }
    }

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Set number of products displayed per page (support thread)
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 146
    Last Post: 2 Nov 2023, 12:50 AM
  2. v151 Banners In Main Page - Support Thread
    By stevesh in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Sep 2021, 03:36 PM
  3. v151 Site Map/Page Not Found: Combined [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 4 Jan 2016, 02:19 PM
  4. v151 PayPal Express Checkout Using NVP 84.0 [Support Thread]
    By lat9 in forum Addon Payment Modules
    Replies: 32
    Last Post: 28 Dec 2015, 04:54 PM
  5. Checkout Amazon Style -- Support Thread
    By CJPinder in forum All Other Contributions/Addons
    Replies: 72
    Last Post: 13 Apr 2011, 08:18 PM

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