Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
perfumbg
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.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
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.
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);
////
}
////
}
}
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
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.
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);
}
}
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
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);
}
}
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
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!
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);
}
}
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.
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.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
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.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
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.
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.
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
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.