Zen Cart Logo
Forums / All Other Contributions/Addons / One-Page Checkout [Support Thread]

One-Page Checkout [Support Thread]

Views: 629,515

Results 1,461 to 1,480 of 3,078
21 Jan 2020, 8:33 PM
#1461
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

One-Page Checkout [Support Thread]

lat9:

@linuxguy2, could you give me an example of the characters you're wanting to weed-out?

Hi Lat,
Exclude
!@$%^&*()+?><>:"{}|[];/=_

Basically I only want to allow alpha, Numeric , the # (hashtag) - (dash) and the ' (apostrophe).

Of course I need the @ sign in the email address.
The Password will need to accept some typical special characters but I can adjust those later.

Thanks, for your prompt response.

22 Jan 2020, 12:48 PM
#1462
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

linuxguy2:

Hi Lat,
Exclude
!@$%^&*()+?><>:"{}|[];/=_

Basically I only want to allow alpha, Numeric , the # (hashtag) - (dash) and the ' (apostrophe).

Of course I need the @ sign in the email address.
The Password will need to accept some typical special characters but I can adjust those later.

Thanks, for your prompt response.
You can use preg_match on each of those fields to weed those out:

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

23 Jan 2020, 4:47 PM
#1463
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

You can use preg_match on each of those fields to weed those out:

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.
23 Jan 2020, 5:14 PM
#1464
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

linuxguy2:

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,

23 Jan 2020, 9:02 PM
#1465
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

linuxguy2:

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 Feb 2020, 1:14 PM
#1466
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

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.

4 Feb 2020, 2:54 PM
#1467
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

perfumbg:

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.

4 Feb 2020, 3:04 PM
#1468
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

lat9:

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.

4 Feb 2020, 4:04 PM
#1469
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Re: One-Page Checkout [Support Thread]

lat9:

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.

4 Feb 2020, 4:20 PM
#1470
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Re: One-Page Checkout [Support Thread]

You were right the did some changes to tpl_modules_order_totals.php,


I have replaced them with the original from template_default and now it seems ok, at least it works and the customer can make order.

I will test it some more and if new problem is there I will report it here.

Thank you for pointing the exact cause of my problem, it may help others if they use ThemeForest templates!

4 Feb 2020, 4:24 PM
#1471
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

perfumbg:

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

Thank you in advance.
Got it (thanks). There are two issues causing the loop-back on order-confirmation:

  1. The payment method (cod) is, for some reason, not being registered in the session prior to the "Confirm" button click. This could be caused by some template-specific changes to OPC's tpl_modules_opc_payment_choices.php ('delivered' in the template_default).
  2. The template's order-total formatting is confusing OPC, as what is seen upon entering the checkout-confirmation step for the order's current total is 'Total:' rather than the order's total (559.99) as calculated during the confirmation step.
5 Feb 2020, 6:39 PM
#1472
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

linuxguy2:

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.

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);
    
	////
		}
	////
	
	}
  }
5 Feb 2020, 7:17 PM
#1473
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

linuxguy2:

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.

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

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

6 Feb 2020, 5:19 AM
#1474
linuxguy2 avatar

linuxguy2

Zen Follower

Join Date:
Sep 2013
Location:
Texas
Posts:
315
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Try changing that to

if (ACCOUNT_COMPANY == 'true') {
if ([B](/BENTRY_COMPANY_MIN_LENGTH > 0 && strlen($company) < ENTRY_COMPANY_MIN_LENGTH[B]) || !preg_match('/^/[A-Za-z0-9]$/', $company)[/B]) {
$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!

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

6 Feb 2020, 1:04 PM
#1475
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

linuxguy2:

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!

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

That extra / was a copy/paste boo-boo.  You might want to add a space to the list of characters that can be repeated, though.
6 Feb 2020, 3:22 PM
#1476
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Re: One-Page Checkout [Support Thread]

Hello, again I want to add litle more styling to the checkout_one page but I can't find how to edit the "size value"

<input type="text" name="firstname[bill]" value="ico" size="33" maxlength="32" id="firstname-bill" placeholder="*" required="">

Any hint will be good.
Thank you.

6 Feb 2020, 7:53 PM
#1477
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Re: One-Page Checkout [Support Thread]

perfumbg:

Hello, again I want to add litle more styling to the checkout_one page but I can't find how to edit the "size value"

<input type="text" name="firstname[bill]" value="ico" size="33" maxlength="32" id="firstname-bill" placeholder="*" required="">

Any hint will be good.
Thank you.

No need for help I just found it, if somebody needs the same thing here is what you should do:

In includes/clases/OnePageCheckout.php around line 1204 (in my case)

You can simply remove $field_len

from here zen_draw_input_field($field_name, $field_value, "$field_len id="$field_id" placeholder="$placeholder" $field_required") . PHP_EOL .

This removes the whole **size **thing from any input fields, now you can make them responsive with css.

6 Feb 2020, 8:18 PM
#1478
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

perfumbg:

No need for help I just found it, if somebody needs the same thing here is what you should do:

In includes/clases/OnePageCheckout.php around line 1204 (in my case)

You can simply remove $field_len

from here zen_draw_input_field($field_name, $field_value, "$field_len id="$field_id" placeholder="$placeholder" $field_required") . PHP_EOL .

This removes the whole **size **thing from any input fields, now you can make them responsive with css.
Just be sure to add sufficient comments to identify your changes, as the OnePageCheckout.php class is the "heart" of the OPC's processing and could easily be changed on a subsequent update.

7 Feb 2020, 6:45 PM
#1479
jboyjw avatar

jboyjw

New Zenner

Join Date:
Aug 2019
Posts:
5
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Has anyone had any luck using z_stripe (Zucando Z Stripe Payment Gateway) with One-Page Checkout?

I have the latest version of Zen Cart, OPC, and Z Stripe. Without OPC, Z Stripe works properly. With OPC and using another payment method works. With OPC & Z Stripe, I can't get past the main checkout page. I added z_stripe to the list of Payment Methods Requiring Confirmation like the other Stripe module. When I click on Continue Checkout, the cursor spins and nothing happens... In the Network tab of inspect element, /ajax.php?act=ajaxOnePageCheckout&method=updateShipping is called. No unexpected javascript errors.

7 Feb 2020, 7:40 PM
#1480
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

JboyJW:

Has anyone had any luck using z_stripe (Zucando Z Stripe Payment Gateway) with One-Page Checkout?

I have the latest version of Zen Cart, OPC, and Z Stripe. Without OPC, Z Stripe works properly. With OPC and using another payment method works. With OPC & Z Stripe, I can't get past the main checkout page. I added z_stripe to the list of Payment Methods Requiring Confirmation like the other Stripe module. When I click on Continue Checkout, the cursor spins and nothing happens... In the Network tab of inspect element, /ajax.php?act=ajaxOnePageCheckout&method=updateShipping is called. No unexpected javascript errors.
Does that payment method add any jscript_*.js or .php files to the /includes/modules/pages/checkout_payment directory? If so, those will need to be copied also to /includes/modules/pages/checkout_one.