-
1 Attachment(s)
Re: One-Page Checkout [Support Thread]
Just to add onto my previous post above, even though the checkbox is not interactable or visible to the user, it IS still there to some degree.
If I go to the input element immediately preceding the Reward Points box, and then hit TAB (to jump to the invisible checkbox for Rewards), hit ENTER (to select it), and then APPLY, it will apply the rewards to the order.
It's just like the checkbox isn't displaying properly and I don't know what else to do to troubleshoot it.
Attachment 20238
-
Re: One-Page Checkout [Support Thread]
If it helps, this is currently how we have the Reward Points module creating the checkbox:
$prompt=zen_draw_checkbox_field('redeem_flag',true,isset($_SESSION['redeem_value']),' class="opc-cc-submit"').' '.zen_draw_hidden_field('redeem_checkout_flag',1);
-
1 Attachment(s)
Re: One-Page Checkout [Support Thread]
Cindy - Okay, I found out WHY it's not displaying, but need your advice on how to workaround it.
The reason why is the CLASS name of the input: custom-control-input
Not Working: <input type="checkbox" name="redeem_flag" value="1" class="custom-control-input opc-cc-submit">
Working: <input type="checkbox" name="redeem_flag" value="1" class="opc-cc-submit">
So I would like to know how to do one of the following:
1. Either how to remove the "custom-control-input" from being added to this checkbox
2. Or possibly better, I don't mind leaving things as-is (with a hidden checkbox) as long as hitting the APPLY button will automatically apply the Reward Point value towards the order. Right now, hitting APPLY with the hidden class="custom-control-input opc-cc-submit" is not applying anything.
But again, if I go into INSPECT MODE on my browser and remove the "custom-control-input" so that it looks like this (), then I see the checkbox perfectly fine and it will APPLY the Reward Points.
Any thoughts?
It looks like the code that the Reward Point module is using to create the checkbox is this:
$prompt=zen_draw_checkbox_field('redeem_flag',true,isset($_SESSION['redeem_value']),' class="opc-cc-submit"').' '.zen_draw_hidden_field('redeem_checkout_flag',1);
Attachment 20239
-
Re: One-Page Checkout [Support Thread]
@Jeff_Mash, using the formatting in the tpl_modules_opc_conditions.php as a base, it looks like the reward points module needs to format its checkbox using something like
Code:
$prompt =
'<div class="custom-control custom-checkbox">' .
zen_draw_checkbox_field('redeem_flag',true,isset($_SESSION['redeem_value']),' class="opc-cc-submit" id="redeem_flag"') .
' ' . zen_draw_hidden_field('redeem_checkout_flag',1) .
'<label class="custom-control-label checkboxLabel" for="redeem_flag"> </label>' .
'</div>';
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
@Jeff_Mash, using the formatting in the tpl_modules_opc_conditions.php as a base, it looks like the reward points module needs to format its checkbox using something like
Code:
$prompt =
'<div class="custom-control custom-checkbox">' .
zen_draw_checkbox_field('redeem_flag',true,isset($_SESSION['redeem_value']),' class="opc-cc-submit" id="redeem_flag"') .
'##' . zen_draw_hidden_field('redeem_checkout_flag',1) .
'<label class="custom-control-label checkboxLabel" for="redeem_flag">##</label>' .
'</div>';
You ROCK, Cindy! That did the trick!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
Jeff_Mash
You ROCK, Cindy! That did the trick!
Thanks, @Jeff_Mash; I'm happy to help.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
simon1066
Thanks for this. I'm currently on WebPay v1.0.1. I'll implement the temp workaround.
Have a good weekend.
hi simon,
i'm seeing different line numbers then what is in your error log.
no matter.
i would find the following code and make the following 2 code changes:
PHP Code:
//from
'administrative_district_level_1' => (string)zen_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']),
//to
'administrative_district_level_1' => (string)zen_get_zone_code($order->billing['country']['id'], (int)$order->billing['zone_id'], $order->billing['state']),
//from
'administrative_district_level_1' => (string)zen_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']),
//to
'administrative_district_level_1' => (string)zen_get_zone_code($order->delivery['country']['id'], (int)$order->delivery['zone_id'], $order->delivery['state']),
i would then revert line 173 back to its original form.
in addition, if there are still problems, lets move the conversation over to the square webpay forum thread so as to not continue to pollute this thread...
best.
-
Re: One-Page Checkout [Support Thread]
Having an issue when international customers are checking out.
I duplicated their issue and tried various admin settings but can't seem to make this work.
Customer enters there address. Moves to change the country from United States to say Canada and the menu for Canada does not load in. It leaves the US states and just says:
"Please select a state from the States pull down menu."
Where should I look to fix this issue?
I'm on 1.5.8 and the newest OPC install. I'm not sure when this started to be an issue.
As a work around for now I removed the states as a drop down and set the minimum state value to 0. but its not ideal.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
cruiser
Having an issue when international customers are checking out.
I duplicated their issue and tried various admin settings but can't seem to make this work.
Customer enters there address. Moves to change the country from United States to say Canada and the menu for Canada does not load in. It leaves the US states and just says:
"Please select a state from the States pull down menu."
Where should I look to fix this issue?
I'm on 1.5.8 and the newest OPC install. I'm not sure when this started to be an issue.
As a work around for now I removed the states as a drop down and set the minimum state value to 0. but its not ideal.
@cruiser, I'm unable to reproduce the issue on OPC 2.4.6, Zen Cart 158a. What template is in use?
-
Re: One-Page Checkout [Support Thread]
OPC 2.4.5 + Square + ZC 157c + Bootstrap
When I go to checkout, everything is fine unless I change shipping to "Store Pickup." When I do this, the credit card fields (number, expiry, cvv) change to a button labelled "Use Credit Card." Pressing this button grays the screen but doesn't reveal the fields.
The workaround I used was to change Admin > Configuration > OPC > Payment-Block Action on Shipping Change to Refresh (from Update), and this fixes it - the "Use Credit Card" button is displayed for just a second and then the fields re-appear.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
swguy
...the "Use Credit Card" button is displayed for just a second and then the fields re-appear.
the use credit card button is just a place holder. the button itself does nothing... it gets replaced by functions within the square javascript code.
if you do NOT want to see it you can find the code in includes/modules/payment/square_webPay.php and change:
Code:
//from
'fields' => [
[
'title' => '',
'field' => '<div id="card-container" ></div>
<button id="card-button" type="button">Use Credit Card</button>',
],
//to:
'fields' => [
[
'title' => '',
'field' => '<div id="card-container" ></div>
<button id="card-button" type="button" hidden>Use Credit Card</button>',
],
the problem that you are experiencing is again a javascript loading issue, and your workaround is fine. it would be nice to not have to do a complete page reload, but digging into the javascript right now is low on my totem pole...
-
Re: One-Page Checkout [Support Thread]
It's all good. I was just surprised because I don't recall ever having seen this scenario.
-
Re: One-Page Checkout [Support Thread]
Guest Checkout with OPC - PHP 7.4 and Zen Cart 1.5.7c, OPC 2.4.5 (2022-12-27). Has anyone else seen this? Happens once in a while, not consistently.
[14-May-2023 21:32:45 UTC] PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: {"id":"","title":"United Parcel Service (UPS Ground)","cost":35.76100000000000278532752417959272861480712890625} in /home/client/public_html/includes/classes/order.php on line 323
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
swguy
Guest Checkout with OPC - PHP 7.4 and Zen Cart 1.5.7c, OPC 2.4.5 (2022-12-27). Has anyone else seen this? Happens once in a while, not consistently.
[14-May-2023 21:32:45 UTC] PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: {"id":"","title":"United Parcel Service (UPS Ground)","cost":35.76100000000000278532752417959272861480712890625} in /home/client/public_html/includes/classes/order.php on line 323
I've seen that, usually on the shopping-cart page, when a shipping method like UPS or USPS can't ship to the customer's selected country/state; nothing IMO to do with OPC.
-
Re: One-Page Checkout [Support Thread]
Seems to only happen in OPC (and only occasionally). I'm going to try a page reload when this happens to see if that helps.
Happens when the user hits confirm.
-
Re: One-Page Checkout [Support Thread]
ZC 1.5.8a, OPC 2.4.5
I'm in the final stages of customizing a brand new website. I thought I finally had everything under control, but I must have done something wrong at the last minute yesterday, because today I'm getting the error message, "Please contact the store owner; some required elements of this page are missing," when the program switches from tpl_login_guest.php to tpl_checkout_one_default.php. When I hit F12, I am told that jscript is saying that "Missing #orderTotalDivs" is the culprit, but I'm not entirely sure what that signifies. I made some modifications to the classes/order.php file, but I have not touched the classes/order_total.php file. Moreover, reverting classes/order.php to the original file doesn't fix the problem. When I click the "OK" button on the error message, the program resumes and lets the transaction proceed all the way through without further complaint. Any ideas? Thanks!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
archelaus
ZC 1.5.8a, OPC 2.4.5
I'm in the final stages of customizing a brand new website. I thought I finally had everything under control, but I must have done something wrong at the last minute yesterday, because today I'm getting the error message, "Please contact the store owner; some required elements of this page are missing," when the program switches from tpl_login_guest.php to tpl_checkout_one_default.php. When I hit F12, I am told that jscript is saying that "Missing #orderTotalDivs" is the culprit, but I'm not entirely sure what that signifies. I made some modifications to the classes/order.php file, but I have not touched the classes/order_total.php file. Moreover, reverting classes/order.php to the original file doesn't fix the problem. When I click the "OK" button on the error message, the program resumes and lets the transaction proceed all the way through without further complaint. Any ideas? Thanks!
What template is in use? Those "missing elements" messages come from the OPC jQuery when it is looking for required "CSS Selectors", many of which (especially the order-total related ones) are customizable in the admin's Configuration :: One-Page Checkout Settings.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
What template is in use? Those "missing elements" messages come from the OPC jQuery when it is looking for required "CSS Selectors", many of which (especially the order-total related ones) are customizable in the admin's Configuration :: One-Page Checkout Settings.
I'm using a custom template that began as Responsive Classic but no longer has any meaningful similarity to it. I've also customized the various CSS files that came with OPC and deleted the responsive.css and responsive_default.css files, which were interfering with the way I was making the site responsive to changes in screen size. All of that was done, however, long before this problem happened today. I don't think I was changing any CSS files late yesterday, and I know I wasn't today.
The only thing I'm seeing in One-Page Checkout Settings that looks relevant is "Order Total, jQuery Selector," which has been set to "#ottotal > div:first-child" since the beginning, because I didn't know what it meant and had no reason to change it.
Does that help clarify where things stand? Sorry to be so clueless. Thanks in advance!
-
Re: One-Page Checkout [Support Thread]
Is the test site publicly available or could you send me a link to the site via PM so that I can see what's going on?
OPC expects to find all of the order-total names and prices within an HTML element with the 'id' of orderTotalDivs; that's where the "Missing #orderTotalDivs" message comes from.
-
Re: One-Page Checkout [Support Thread]
I can think of two possibilities.
1) you have modified the tpl_modules_opc_shopping_cart.php or its missing (YOURSITE>includes>templates>template_default>templates) or the copy in your template
2) MODULE_ORDER_TOTAL_INSTALLED is missing from the configuration table on your database.
-
1 Attachment(s)
Re: One-Page Checkout [Support Thread]
Hello ,
I am having a bit of trouble. My site version is v1.5.6c using php 7.4.25. I installed (One Page Checkout) - Version: v2.3.12 because that was the last version that supported my zencart version. It looks great when i load the plugin up. But if i change the shipping option, the credit card box changes to this
Attachment 20320
Customers can no longer enter credit card details and a small box shows up with the " use credit card" label in place of the number input box. This button does nothing. I followed the steps outlined in
https://github.com/lat9/one_page_che...ment-552207291
For the shipping estimator and my version of zencart but it doesn't fix my issue. What am i doing wrong here ?
Ps. Yeah i know i should be updating to the latest version of zencart. I plan to do that later this summer when i have some down time.
-
Re: One-Page Checkout [Support Thread]
My bad , i found the solution in this thread. Sorry about that !
The fix for my problem was by swguy here
https://www.zen-cart.com/showthread....76#post1394376
Thank you so much again for providing this wonderful plugin.
-
Re: One-Page Checkout [Support Thread]
According to post #1739 on this topic, the following code will make PAYPAL the default payment option (Radio-button selected on page load) -:
Code:
<?php
if (empty($_SESSION['payment'])) {
$_SESSION['payment'] = 'paypalwpp';
}
What would I need to edit in order to make SQUARE the default (option selected radio button)?
Customers are not clicking the radio button before inputting card details, and this seems to result in a square payment error. If this radio button is ON by default, then we may be able to aoid such Square errors.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
schoolboy
According to post #1739 on this topic, the following code will make PAYPAL the default payment option (Radio-button selected on page load) -:
Code:
<?php
if (empty($_SESSION['payment'])) {
$_SESSION['payment'] = 'paypalwpp';
}
What would I need to edit in order to make SQUARE the default (option selected radio button)?
Customers are not clicking the radio button before inputting card details, and this seems to result in a square payment error. If this radio button is ON by default, then we may be able to aoid such Square errors.
Code:
<?php
if (empty($_SESSION['payment'])) {
$_SESSION['payment'] = 'square';
}
-
Re: One-Page Checkout [Support Thread]
PHP Code:
if (empty($_SESSION['payment'])) {
$_SESSION['payment'] = 'square_webPay';
}
best.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
carlwhat
PHP Code:
if (empty($_SESSION['payment'])) {
$_SESSION['payment'] = 'square_webPay';
}
best.
Thanks, I was thinking of the built-in (albeit fairly non-functional) one.
-
Re: One-Page Checkout [Support Thread]
Thanks Carl and Cindy. At some point Carl, I hope to buy you more coffee... Your module literally saved my business. When profits allow, I'll be making another contribution (as should all those who have benefitted).
-
Re: One-Page Checkout [Support Thread]
Note that the "problem" of not selecting WebPay should not happen. In a 1.5.7 or later, OPC, WebPay and PayPal that the WebPay is listed first and, with the entry of the first digit of the CC #, the Credit Card option is automatically selected.
I could not create a scenario where the Credit Card was not selected when information was entered into the WebPay form.
HOWEVER, I could duplicate the CC info being sent but not selected by entering a 4 in the CC line, selectging PayPal, and then returning to the CC line to enter a valid CC info.
IOW, it takes a pretty big mistake sequence by the customer to get CC info entered without the button being selected.
-
Re: One-Page Checkout [Support Thread]
I'm probably stabbing in the dark here, but maybe someone can give me a nudge in the right direction...
My online store is currently running on ZenCart 1.5.7d and some months ago I installed OPC 2.4.3. (Great Plugin!) My host is on php 8.0
A number of payment methods are available to my customers, one of them is a (local) third-party payment gate called PayFast (they supplied a plugin for ZenCart).
Occasionally a strange error occurs during the payment process ONLY when the PayFast option is selected:
1. The delivery address and billing address is 'lost' during the payment process. When the order is 'returned' from the third party payment site, these fields are empty. (We have to contact the customer in cases where they have more than one address registered on their profile).
2. When the invoice is accessed in admin, an error message report 'unknown country name'. However, only ONE country is available when customers register a profile.
3. Error log shows: PHP Warning: Undefined variable $country_has_zones in /includes/classes/OnePageCheckout.php on line 1610 (Should not be important?)
4. Order in database show the correct value for the customer_address_format_id, BUT the delivery_address_format_id and billing_address_format_id shows a value of 0 (which isn't defined in the address format table)? The delivery and billing address fields are empty.
5. The error ONLY occurs when the PayFast option is selected and it MOSTLY happens when the customer has a delivery address different from the customer/billing address.
6. The error only happens occasionally (about 1 in 20 orders). Can't seem to see a pattern for what triggers it.
7. Due to the fact that PayFast only has a few ZenCart customers, they are not willing to help when the problem is linked to a plug in. Their payment gateway works 100% when OPC is not active.
8. Not sure if it is related, it happened twice that the VAT/TAX field is also lost, showing 0% instead of 15%.
I'm only an amateur at php and my developer is currently unavailable. Meanwhile, my customers complain about the missing OPC...
Any ideas, anyone?
-
Re: One-Page Checkout [Support Thread]
I'm not familiar with the PayFast payment method, making it a bit difficult to determine where the interaction with OPC is going awry.
1. Does this payment method send the customer off-site to collect their information or is the credit-card information gathered on-site?
2. Is there any additional verification (like a Verified-by-Visa call-back) that is performed by the payment method?
3. Does this happen during 'guest' checkout only or does it occur for both guests and account-holders?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
I'm not familiar with the PayFast payment method, making it a bit difficult to determine where the interaction with OPC is going awry.
1. Does this payment method send the customer off-site to collect their information or is the credit-card information gathered on-site?
2. Is there any additional verification (like a Verified-by-Visa call-back) that is performed by the payment method?
3. Does this happen during 'guest' checkout only or does it occur for both guests and account-holders?
Thank you for taking the time to help think about this!
1. Yes, the customer is taken off-site and can then select from a variety of payment methods e.g. credit card, instant EFT, Paypal etc.
2. Yes, card payments have a Verified-by-Visa service. The order is only 'returned' to us once payment has been fully accepted by PayFast.
3. The guest checkout facility is not activated because it does not work at all with the PayFast payment module. (We are not worried to get it working).
-
Re: One-Page Checkout [Support Thread]
That PayFast payment method (https://github.com/Payfast/mod-zencart_1_3) is "interesting". It apparently performs everything that the more normal checkout_process page does and fires notifications like it's running that page.
If you would, Francois, turn storefront debugging (Configuration :: Logging :: Log All Errors (Storefront), set to IgnoreDups and Backtrace on Notices to Yes). That will ensure that any PHP Notice issues (the harbingers of doom) are captured as well, noting that those settings have the propensity of filling your site's /logs directory quickly.
The next time you receive an order with missing address elements, you should revert the log-all-errors setting (the backtrace one can be left) and zip-up the myDEBUG*.log files in the /logs directory around the time of the errant order and send that zip to my direct email address (which I'll send you via PM).
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
That PayFast payment method (
https://github.com/Payfast/mod-zencart_1_3) is "interesting". It apparently performs everything that the more normal checkout_process page does and fires notifications like it's running that page.
If you would, Francois, turn storefront debugging (
Configuration :: Logging :: Log All Errors (Storefront), set to
IgnoreDups and
Backtrace on Notices to
Yes). That will ensure that any PHP Notice issues (the harbingers of doom) are captured as well, noting that those settings have the propensity of filling your site's /logs directory quickly.
The next time you receive an order with missing address elements, you should revert the log-all-errors setting (the backtrace one can be left) and zip-up the myDEBUG*.log files in the /logs directory around the time of the errant order and send that zip to my direct email address (which I'll send you via PM).
Hi Cindy, thank you so much for your willingness to help!
My error logging settings were on IgnoreDups, and I have now switched on the backtrace option. (And activated OPC again). Now to wait for the error to happen...
Just a note on the PayFast versions on GitHub:
Version 1.1.3 was released (Oct 2022) after we requested an update from PayFast last year. My host upgraded to pHp8.0 and we upgraded our store to ZenCart 1.5.7d. (The original PayFast plugin was not compatible with pHp8). THIS IS THE VERSION THAT WE ARE CURRENTLY USING.
Version 1.1.4 was released in January after we requested that they fix the problem with Guest Checkout. However, this version failed to send email notifications to customers, so we reverted back to 1.1.3.
-
Re: One-Page Checkout [Support Thread]
I know this is a long thread and MAYBE my question is answered but it might be faster to ask here. Is there a way to disable or completely remove some unwanted fields? I only sell digital downloads so I really don't need a full address or a phone number. Although I don't mind if someone puts bogus information, some people THINK that I really need all that and they are concerned. Is that possible?
-
Re: One-Page Checkout [Support Thread]
For the telephone number, set Configuration :: Minimum Values :: Telephone Number to 0; it'll still be displayed but it won't be required.
Doesn't your payment-provider need a billing address for credit-card purchases?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Doesn't your payment-provider need a billing address for credit-card purchases?
Oh... good question. I only added Stripe this year and I don't think I ever needed it for Paypal. I'll double-check.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
For the telephone number, set Configuration :: Minimum Values :: Telephone Number to 0; it'll still be displayed but it won't be required.
It looks like it was already set up like that, yet a customer emailed me complaining I was asking for too much information for a digital download. I guess it was not obvious to him that the phone number was not required since it was still there.
-
Re: One-Page Checkout [Support Thread]
What template's in use? You could always use CSS to "hide" that telephone number entry.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
What template's in use? You could always use CSS to "hide" that telephone number entry.
I'll check, but thanks for the hint.
As for the full address, you are right that it is needed for credit card payment, so i'll have to leave it there.
-
Re: One-Page Checkout [Support Thread]
Hello wonderful people ( who are very smart I might add ). I first off want to say , i love OPC. It seems i have had a sales boost with guest checkout enabled. But i have noticed a few customers tell me they are getting a error ( "We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN" )
How do i prevent this error so I don't lose customers who just bounce ?
Zencart 1.5.6b
OPC 2.3.12
php 7.4.25
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
jasonshanks
Hello wonderful people ( who are very smart I might add ). I first off want to say , i love OPC. It seems i have had a sales boost with guest checkout enabled. But i have noticed a few customers tell me they are getting a error ( "We have a problem on our end. So Sorry! Please report this error to the Store Owner: SQ-MISSING-TOKEN" )
How do i prevent this error so I don't lose customers who just bounce ?
Zencart 1.5.6b
OPC 2.3.12
php 7.4.25
you need to upgrade to a minimum of OPC 2.4.0. see:
https://github.com/lat9/one_page_che...ses/tag/v2.4.0
which will require a move to zc 157a.
once there, on the admin, you can got to:
configuration -> One-Page Checkout Settings -> Payment Methods Handling Form Submittal
and then esnure that square_webPay is listed there.
best.
-
Re: One-Page Checkout [Support Thread]
Wonderful , thank you so much Carl. Your help is very much appreciated and all that you do. hah Now to make the time for some down time to upgrade.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
jasonshanks
Now to make the time for some down time to upgrade.
Do the upgrade in a test site and swap them out when you're happy with the newer version. Just minutes of "down time".
https://myzencarthost.com/index.php?...th-cPanel.html
-
Re: One-Page Checkout [Support Thread]
I'm curious if anyone has seen this or had it reported as an 'issue'.
Zen Cart 1.5.8a
OPC 2.4.6beta3
When using Edge and using the browser pre-fill option to pre-fill the credit card fields, after the credit card fields are filled, the address section become active. My client says the Update button does not work, only the cancel. In my testing, both Cancel and Update are functional.
I can understand the pre-fill is trying to fill the address, it's part of the pre-fill settings. I don't know much about how the pre-fill works. Is there a way to prevent it from trying to prefill the address fields (without preventing it when actually trying to pre-fill the address fields)?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
jeking
I'm curious if anyone has seen this or had it reported as an 'issue'.
Zen Cart 1.5.8a
OPC 2.4.6beta3
When using Edge and using the browser pre-fill option to pre-fill the credit card fields, after the credit card fields are filled, the address section become active. My client says the Update button does not work, only the cancel. In my testing, both Cancel and Update are functional.
I can understand the pre-fill is trying to fill the address, it's part of the pre-fill settings. I don't know much about how the pre-fill works. Is there a way to prevent it from trying to prefill the address fields (without preventing it when actually trying to pre-fill the address fields)?
I don't often test with Edge (I know I should) and I never store credit-cards for prefills so I've never personally run across this issue.
If you open an issue on https://github.com/lat9/one_page_check as a reminder, I'll do some research when I've got more time and hopefully find a correction.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
I don't often test with Edge (I know I should) and I never store credit-cards for prefills so I've never personally run across this issue.
If you open an issue on
https://github.com/lat9/one_page_check as a reminder, I'll do some research when I've got more time and hopefully find a correction.
I never store credit card data this way either, but my client does. I've opened issue. Thank you.
-
Re: One-Page Checkout [Support Thread]
v2.4.6 of One-Page Checkout is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095
This release contains changes associated with the following GitHub issues:
#370: Remove PHP user-errors logged, attempt to recover from any environmental issue instead.
#372: Correct checkout-loop by interpreting characters as spaces.
#374: Use window.location.replace to emulate page redirects.
#375: zc158a: Change in zen_get_zone_code parameters causes Fatal PHP error.
#376: Correct guest-checkout interaction with PPEC's Shortcut button.
#379: Correct PHP Warnings logged when Configuration :: Customer Details :: State is set to 'false'.
#380: Browser pre-fill of credit-cart or address information results in address sections activating when they shouldn't.
#381: Correct "Invalid form control, element not visible" console-logs; required for square_webPay users.
#382: Correct spelling of 'cursor' (was 'curser') in the checkout_one.css file.
-
Re: One-Page Checkout [Support Thread]
Hi There,
Not sure if this is the proper place for this post but I am using OPC 2.4.3 (great mod), bootstrap template and ZC 1.5.7d. for months now I have been having an issue with the processing time when payments are made. I am using authorize.net as my main payment processor but also have PayPal and a module that payments are not require to checkout and once e-transfer payment is received, I manually release the order. The issue is that despite which payment option is chosen there is up to a minute delay after the confirm order button is clicked and the payment is processed. Despite have a loading gif stating that processing can take up to a minute, customer are, I believe refreshing the page before the process is complete causing the payment to be processed multiple times. Is there something that I can do to speed up the processing time. I have never been on a website, where processing the the payment takes as much time.
Cheers and thanks in advance!!!
-
Re: One-Page Checkout [Support Thread]
Notice that the post immediately prior to yours announces 2.4.6's release.
You'll also note that there were some changes that might be beneficial to you. You might want to try the new version. If possible, copy your info to a test site and use the newest version to see if it helps with your particular problem.
It's odd that you would have that delay without something being noted in your logs folder.
-
Re: One-Page Checkout [Support Thread]
Allmart -
I'm not sure it's OPC.. Which I love.. I have migrated a test site to 1.5.8 and setup Bootstrap on it.. It seems that all the updates to the database after a sale is done, is delaying the screen from showing a transaction is complete. It does not matter which template I am using. If I am using OPC or not.
I did a slow-query log and nothing is in there..
Query log is showing a bunch of database processess being done. Tax Rates, Special Pricing, etc,etc....
My website has:
548 Customers
5000 transactions
17,000 products
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
brian70809
Allmart -
I'm not sure it's OPC.. Which I love.. I have migrated a test site to 1.5.8 and setup Bootstrap on it.. It seems that all the updates to the database after a sale is done, is delaying the screen from showing a transaction is complete. It does not matter which template I am using. If I am using OPC or not.
I did a slow-query log and nothing is in there..
Query log is showing a bunch of database processess being done. Tax Rates, Special Pricing, etc,etc....
My website has:
548 Customers
5000 transactions
17,000 products
Just noting that once the customer confirms an order, OPC is no longer part of the processing. Having said that, does the same behavior occur if you temporarily disable OPC and run a purchase through the default, 3-page checkout?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Just noting that once the customer confirms an order, OPC is no longer part of the processing. Having said that, does the same behavior occur if you temporarily disable OPC and run a purchase through the default, 3-page checkout?
Yes. Its the same if it's 3- page or the OPC.. I don't know where to go with this.. I'm on wrong thread for this issue.
I don't know if PHP is purely a linear system, or if you can multitask(so to speak) by running multiple scripts at one time..
I just wanted to let that user know I think it's not OPC.
Thanks for everything you do lat9!
-
Re: One-Page Checkout [Support Thread]
Thanks for the report back that it's not OPC, @brian70809! Out of interest, what payment method and order-totals are "in play" for this order that takes a long time to record?
-
Re: One-Page Checkout [Support Thread]
HI all,
I have just problem.
I installed OPC 2.4.5 on my new instaltion of ZC 1.5.8a.
After I put some products in the cart and will to finish the order on the page "/index.php?main_page=checkout_one"
I receive error
"Your order\'s details have changed. Please review the current values and re-submit."
and the page could not be sent.
I don't understand why is the message generated.
On the page can be changed only shipping method. After change is the total amount of order well recalculated.
But after clicking on the button "Confirm order" will be the page reloded and show this Error Message.
thank yo for your help
Borek
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
Borek
HI all,
I have just problem.
I installed OPC 2.4.5 on my new instaltion of ZC 1.5.8a.
After I put some products in the cart and will to finish the order on the page "/index.php?main_page=checkout_one"
I receive error
"Your order\'s details have changed. Please review the current values and re-submit."
and the page could not be sent.
I don't understand why is the message generated.
On the page can be changed only shipping method. After change is the total amount of order well recalculated.
But after clicking on the button "Confirm order" will be the page reloded and show this Error Message.
thank yo for your help
Borek
What template is in use and what, if any, additional order-total modules are being used by the site?
-
Re: One-Page Checkout [Support Thread]
Hi. Have just returned to using Zen after some time with other carts. Got everything all working EXCEPT for one issue with the one page checkout plugin. Works fine with the guest checkout disabled, but when I enable guest checkout through admin the final stage - 'checkout_one_confirmation' just brings up a page not working message? Am running through wampserver so have attached the error log. Can someone point me in the right direction to resolve this, as really want the guest feature... Payment provider setup as PayPal Std which works fine when the guest feature disabled.
Thanks...
[29-Aug-2023 17:55:06 UTC] PHP Fatal error: Uncaught TypeError: Argument 2 passed to zen_get_zone_code() must be of the type int, string given, called in C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php on line 275 and defined in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php(275): zen_get_zone_code(222, '', '-- Please Selec...')
#1 C:\wamp64\www\zencart158a\includes\classes\payment.php(279): paypal->process_button()
#2 C:\wamp64\www\zencart158a\includes\modules\pages\checkout_one_confirmation\heade r_php.php(407): payment->process_button()
#3 C:\wamp64\www\zencart158a\index.php(35): require('C:\\wamp64\\www\\z...')
#4 {main}
thrown in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php on line 173
[29-Aug-2023 17:55:06 UTC] Request URI: /zencart158a/index.php?main_page=checkout_one_confirmation, IP address: ::1
--> PHP Fatal error: Uncaught TypeError: Argument 2 passed to zen_get_zone_code() must be of the type int, string given, called in C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php on line 275 and defined in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php(275): zen_get_zone_code(222, '', '-- Please Selec...')
#1 C:\wamp64\www\zencart158a\includes\classes\payment.php(279): paypal->process_button()
#2 C:\wamp64\www\zencart158a\includes\modules\pages\checkout_one_confirmation\heade r_php.php(407): payment->process_button()
#3 C:\wamp64\www\zencart158a\index.php(35): require('C:\\wamp64\\www\\z...')
#4 {main}
thrown in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php on line 173.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
PlanetDesign
Hi. Have just returned to using Zen after some time with other carts. Got everything all working EXCEPT for one issue with the one page checkout plugin. Works fine with the guest checkout disabled, but when I enable guest checkout through admin the final stage - 'checkout_one_confirmation' just brings up a page not working message? Am running through wampserver so have attached the error log. Can someone point me in the right direction to resolve this, as really want the guest feature... Payment provider setup as PayPal Std which works fine when the guest feature disabled.
Thanks...
[29-Aug-2023 17:55:06 UTC] PHP Fatal error: Uncaught TypeError: Argument 2 passed to zen_get_zone_code() must be of the type int, string given, called in C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php on line 275 and defined in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php(275): zen_get_zone_code(222, '', '-- Please Selec...')
#1 C:\wamp64\www\zencart158a\includes\classes\payment.php(279): paypal->process_button()
#2 C:\wamp64\www\zencart158a\includes\modules\pages\checkout_one_confirmation\heade r_php.php(407): payment->process_button()
#3 C:\wamp64\www\zencart158a\index.php(35): require('C:\\wamp64\\www\\z...')
#4 {main}
thrown in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php on line 173
[29-Aug-2023 17:55:06 UTC] Request URI: /zencart158a/index.php?main_page=checkout_one_confirmation, IP address: ::1
--> PHP Fatal error: Uncaught TypeError: Argument 2 passed to zen_get_zone_code() must be of the type int, string given, called in C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php on line 275 and defined in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php(275): zen_get_zone_code(222, '', '-- Please Selec...')
#1 C:\wamp64\www\zencart158a\includes\classes\payment.php(279): paypal->process_button()
#2 C:\wamp64\www\zencart158a\includes\modules\pages\checkout_one_confirmation\heade r_php.php(407): payment->process_button()
#3 C:\wamp64\www\zencart158a\index.php(35): require('C:\\wamp64\\www\\z...')
#4 {main}
thrown in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php on line 173.
Your "quickest path to success" is going to be the editing of /includes/modules/payment/paypal.php, line 275, changing that to read
Code:
'state' => zen_get_zone_code((int)$order->customer['country']['id'], (int)$order->customer['zone_id'], $order->customer['state']),
I'll create an issue on OPC's GitHub repository to ensure that those address-related values are integer values for a future release.
n.b. Issue created: https://github.com/lat9/one_page_checkout/issues/383
-
Re: One-Page Checkout [Support Thread]
Thanks for the prompt response Lat9.. I have amended line 275 exactly as above, but sadly it has not resolved the issue. It just when guest checkout is selected, there are issues.
-
Re: One-Page Checkout [Support Thread]
OK, so if there are more logs, please post them and we'll get them out of there.
-
Re: One-Page Checkout [Support Thread]
Hi. These are the results from when I added the (int) suggestion at line 275 of payment/paypal.php
[30-Aug-2023 08:01:42 UTC] PHP Fatal error: Uncaught TypeError: Argument 2 passed to zen_get_zone_code() must be of the type int, string given, called in C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php on line 290 and defined in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php(290): zen_get_zone_code(222, '', 'YO')
#1 C:\wamp64\www\zencart158a\includes\classes\payment.php(279): paypal->process_button()
#2 C:\wamp64\www\zencart158a\includes\modules\pages\checkout_one_confirmation\heade r_php.php(407): payment->process_button()
#3 C:\wamp64\www\zencart158a\index.php(35): require('C:\\wamp64\\www\\z...')
#4 {main}
thrown in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php on line 173
[30-Aug-2023 08:01:42 UTC] Request URI: /zencart158a/index.php?main_page=checkout_one_confirmation, IP address: ::1
--> PHP Fatal error: Uncaught TypeError: Argument 2 passed to zen_get_zone_code() must be of the type int, string given, called in C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php on line 290 and defined in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\wamp64\www\zencart158a\includes\modules\payment\paypal.php(290): zen_get_zone_code(222, '', 'YO')
#1 C:\wamp64\www\zencart158a\includes\classes\payment.php(279): paypal->process_button()
#2 C:\wamp64\www\zencart158a\includes\modules\pages\checkout_one_confirmation\heade r_php.php(407): payment->process_button()
#3 C:\wamp64\www\zencart158a\index.php(35): require('C:\\wamp64\\www\\z...')
#4 {main}
thrown in C:\wamp64\www\zencart158a\includes\functions\functions_addresses.php on line 173.
The only difference between logs 'appears' to have now moved the error from line 275 to line 290 of paypal.php. Nothing changed with fault though. Guest disabled it all works fine, when guest is enabled, the program still stalls and doesn't load up the PayPal window?
-
Re: One-Page Checkout [Support Thread]
Same issue, different line. Change line 290 to
Code:
'state' => ($order->delivery['country']['id'] != '' ? zen_get_zone_code((int)$order->delivery['country']['id'], (int)$order->delivery['zone_id'], $order->delivery['state']) : zen_get_zone_code((int)$order->billing['country']['id'], (int)$order->billing['zone_id'], $order->billing['state'])),
-
Re: One-Page Checkout [Support Thread]
la9 - I am pleased to report that the second line of code changes you provided to alter line 290 of payment/paypal.php has RESOLVED the issue and the guest checkout is now working fine. Looks like adding the (int) code to both lines 275 and 290 will sort this issue quite easily in future releases.
Thank you so much for your indulgence in getting this working for me.. One of the downsides of Zen Cart (for me) was always the over long checkout process. Last time I used Zen it was the COWOA checkout, but this OPC guest checkout was the final obstacle to me returning to Zen full time. All sorted now - thank you.!!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
PlanetDesign
la9 - I am pleased to report that the second line of code changes you provided to alter line 290 of payment/paypal.php has RESOLVED the issue and the guest checkout is now working fine. Looks like adding the (int) code to both lines 275 and 290 will sort this issue quite easily in future releases.
Thank you so much for your indulgence in getting this working for me.. One of the downsides of Zen Cart (for me) was always the over long checkout process. Last time I used Zen it was the COWOA checkout, but this OPC guest checkout was the final obstacle to me returning to Zen full time. All sorted now - thank you.!!
Glad to have you back, @PlanetDesign!
-
Re: One-Page Checkout [Support Thread]
Hi,
I am using Responsive Classic.
No additional modules used.
I have only tried to change some setting in the configuration of OPC.
May be the problem is on thhis settings:
Payment Methods Requiring Confirmation - I have changed only for payment method that I am using
From the name of the settinh I expect there must be only payment method tha I will to confirm.
thank you Dalibor
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
Borek
Hi,
I am using Responsive Classic.
No additional modules used.
I have only tried to change some setting in the configuration of OPC.
May be the problem is on thhis settings:
Payment Methods Requiring Confirmation - I have changed only for payment method that I am using
From the name of the settinh I expect there must be only payment method tha I will to confirm.
thank you Dalibor
You can identify multiple payment methods that require the customer's confirmation prior to submitting the order, as identified in that setting's description:
Identify (using a comma-separated list) the payment modules on your store that require confirmation.
Please note that some payment methods, e.g. the default eway_rapid,stripepay,gps, require confirmation due to the way that they handle the payments but you can identify any payment method (like moneyorder) as requiring customer-confirmation prior to placing the order. That adds another step to your site's checkout process.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
v2.4.6 of One-Page Checkout is now available for download:
https://www.zen-cart.com/downloads.php?do=file&id=2095
This release contains changes associated with the following GitHub issues:
#370: Remove PHP user-errors logged, attempt to recover from any environmental issue instead.
#372: Correct checkout-loop by interpreting ## characters as spaces.
#374: Use window.location.replace to emulate page redirects.
#375: zc158a: Change in zen_get_zone_code parameters causes Fatal PHP error.
#376: Correct guest-checkout interaction with PPEC's Shortcut button.
#379: Correct PHP Warnings logged when
Configuration :: Customer Details :: State is set to 'false'.
#380: Browser pre-fill of credit-cart or address information results in address sections activating when they shouldn't.
#381: Correct "Invalid form control, element not visible" console-logs; required for square_webPay users.
#382: Correct spelling of 'cursor' (was 'curser') in the checkout_one.css file.
Hi @lat9, my live site just updated to the 2.4.6 version and it worked smoothly. Thanks for your contribution!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks for the report back that it's not OPC, @brian70809! Out of interest, what payment method and order-totals are "in play" for this order that takes a long time to record?
Payment Method is Invoice or Square WebPay... Invoice module is from our Plugins section.
Order-totals - this may be what is causing my delays?
ot_group_pricing
ot_local_sales_tax (I have no choice.. Louisiana is complicated)
ot_shipping
ot_subtotal
ot_tax
ot_total
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
brian70809
Payment Method is Invoice or Square WebPay... Invoice module is from our Plugins section.
Order-totals - this may be what is causing my delays?
ot_group_pricing
ot_local_sales_tax (I have no choice.. Louisiana is complicated)
ot_shipping
ot_subtotal
ot_tax
ot_total
If a similar delay occurs when you use either payment method, then the most likely suspect is the "Local Sales Tax" order-total. Taxes anymore are complicated wherever you're collecting them!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
If a similar delay occurs when you use either payment method, then the most likely suspect is the "Local Sales Tax" order-total. Taxes anymore are complicated wherever you're collecting them!
i'm putting my money on square webPay. see this post.
i could be wrong.
-
Re: One-Page Checkout [Support Thread]
Thanks Brian70809, have you made any progress with this issue?
-
Re: One-Page Checkout [Support Thread]
I need to get the gender of the guest account. I checked the source code and found that I can get the user's birthday address like
PHP Code:
$dob_value = $_SESSION['opc']->getGuestDateOfBirth();
, but for the gender of the guest, I don't get it.
I can't use this in another php file
PHP Code:
$gender = $this->guestCustomerInfo['gender'];
To get effective help, can anyone provide some tips?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
ikirin
I need to get the gender of the guest account. I checked the source code and found that I can get the user's birthday address like
PHP Code:
$dob_value = $_SESSION['opc']->getGuestDateOfBirth();
, but for the gender of the guest, I don't get it.
I can't use this in another php file
PHP Code:
$gender = $this->guestCustomerInfo['gender'];
To get effective help, can anyone provide some tips?
Depending on which of the billing/shipping addresses' gender you are "looking for", you can use the following interfaces:
PHP Code:
$billing_address = $_SESSION['opc']->getAddressValues('bill');
$billing_gender = $billing_address['gender'];
$shipping_address = $_SESSION['opc']->getAddressValues('ship');
$shipping_gender = $shipping_address['gender'];
-
Re: One-Page Checkout [Support Thread]
Thank you bro, this parameter works:smile:
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
ikirin
Thank you bro, this parameter works:smile:
Thanks for the follow-up ... and it's sis!
-
Re: One-Page Checkout [Support Thread]
I had some time to look at this timeout I get once in awhile.. I think it's a server side issue, but here is a copy of the error from the log.
Quote:
2023/10/05 20:06:23 [error] 23835#0: *1048649 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xx.xx.xx.xx, server: gulfstatessupply.com, request: "POST /index.php?main_page=checkout_process HTTP/2.0", upstream: "fastcgi://unix:/var/www/vhosts/system/gulfstatessupply.com/php-fpm.sock", host: "gulfstatessupply.com", referrer: "https://gulfstatessupply.com/index.php?main_page=checkout_one_confirmation"
Does not matter if it's a payment module, COD, Invoice, etc.. I know how to make it so it doesn't error, but I don't know why the process is taking so long to get to the checkout final page. It doesn't happen all the time, but it happens enough to make me want to fix it.
Zen Cart 1.5.7a
17,000 items
UPS
Square
Othe payment options and Local Delivery Option.
I'm about to move to an AWS server on 1.5.8.. This weekend. I'll see if it persists.
Thanks for the great addon!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
brian70809
I had some time to look at this timeout I get once in awhile.. I think it's a server side issue, but here is a copy of the error from the log.
Does not matter if it's a payment module, COD, Invoice, etc.. I know how to make it so it doesn't error, but I don't know why the process is taking so long to get to the checkout final page. It doesn't happen all the time, but it happens enough to make me want to fix it.
Zen Cart 1.5.7a
17,000 items
UPS
Square
Othe payment options and Local Delivery Option.
I'm about to move to an AWS server on 1.5.8.. This weekend. I'll see if it persists.
Thanks for the great addon!
Hmm, while that log is unintelligible to me, but Google found this SO posting that looks promising: https://stackoverflow.com/questions/...g-response-hea
Unfortunately, there are a couple of proposed solutions in that posting and I don't 'speak' NGINX, so I'm hoping that someone who's conversant can chime in with the best "path to success".
-
Re: One-Page Checkout [Support Thread]
I'm so sorry, I thought you were a man, :D
I have a small suggestion. On the contact us page, add a read-only judgment for the contactname option on the guest account. I am currently doing this, but I don’t know if there is any other better method.
HTML Code:
includes/templates/template_default/templates/tpl_contact_us_default.php
PHP Code:
<?php if (zen_in_guest_checkout()) { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'.' readonly="true"'); ?>
<?php } else { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'); ?>
<?php } ?>
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
ikirin
I'm so sorry, I thought you were a man, :D
I have a small suggestion. On the contact us page, add a read-only judgment for the contactname option on the guest account. I am currently doing this, but I don’t know if there is any other better method.
HTML Code:
includes/templates/template_default/templates/tpl_contact_us_default.php
PHP Code:
<?php if (zen_in_guest_checkout()) { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'.' readonly="true"'); ?>
<?php } else { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'); ?>
<?php } ?>
No problems, I wouldn't have mentioned it if @dbltoe hadn't.
Noting that the contact_us page change is a Zen Cart core one. Why do you feel that it is important to make the 'contactname' field read-only during guest checkout?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
I can! It's a core-file issue; you'll need to edit /includes/classes/shipping.php's cheapest method:
Code:
function cheapest() {
if (!is_array($this->modules)) return false;
$rates = array();
foreach($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
if (isset($GLOBALS[$class]) && is_object($GLOBALS[$class]) && $GLOBALS[$class]->enabled) {
$quotes = isset($GLOBALS[$class]->quotes) ? $GLOBALS[$class]->quotes : null;
if (empty($quotes['methods'])) {
continue;
}
$size = sizeof($quotes['methods']);
for ($i=0; $i<$size; $i++) {
if (isset($quotes['methods'][$i]['cost'])){
$rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
'cost' => $quotes['methods'][$i]['cost'],
'module' => $quotes['id']
);
}
}
}
}
$cheapest = false;
$size = sizeof($rates);
for ($i=0; $i<$size; $i++) {
if (is_array($cheapest)) {
// never quote storepickup as lowest - needs to be configured in shipping module
if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
} else {
if ($rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
}
}
$this->notify('NOTIFY_SHIPPING_MODULE_CALCULATE_CHEAPEST', $cheapest, $cheapest, $rates);
return $cheapest;
}
... and change the highlighted line to read:
Code:
if ($size === 1 || $rates[$i]['module'] != 'storepickup') {
That change enables the storepickup to be selected as the cheapest ... if it's the only shipping method available.
Hi Cindy,
If the only shipping method is storepickup AND storepickup contains more than one pickup point, may be with different prices, then $size equals the number of pickup points (not 1).
Thus, $cheapest is false and shipping options are shown but none will be selected.
Tested in:
zc157d
OPC 2.4.6
Site has storepickup as the only shipping method but configured with 5 locations and different prices.
e.g.: Loc_A, 8.5045;Loc_B, 2.5045;Loc_C, 4.5045;Loc_D, 7.5045;Loc_E, 0.5045
To test, I changed shipping.php, round line 216
PHP Code:
} else {
if ($size === 5 || $rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
}
Thus, $size === 5.
The 5 locations are shown with bullets in the same order and the first bullet is selected (not cheapest!).
Payment options are shown as well.
Without my change in shipping.php, the shipping locations are shown in the same order, none populated and no Payments options are shown, need to refresh the screen to get the payment options (or set 'Payment-Block Action on Shipping Change' to 'Refresh' i.s.o 'Update').
Any suggestions?
Thanks,
@jpda
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Hello Cindy,
I should have sent you this before my previous post on october, 25th.
I had changed shipping.php, but the only available shipping method storepickup was not selected as cheapest.
IMHO because storepickup has an option to register more than one pickup point with different prices.
Did some testing described in my post https://www.zen-cart.com/showthread....04#post1397504
Thanks,
@jpda
-
Re: One-Page Checkout [Support Thread]
I'll note that this is a 'base' Zen Cart issue, not specific to OPC. I've opened the issue on the Zen Cart GitHub repository: https://github.com/zencart/zencart/issues/6023
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
@lat9
Thank you!
jpda
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
jpda
Hello Cindy,
I should have sent you this
before my previous post on october, 25th.
I had changed shipping.php, but the only available shipping method storepickup was not selected as cheapest.
IMHO because storepickup has an option to register more than one pickup point with different prices.
Did some testing described in my post
https://www.zen-cart.com/showthread....04#post1397504
Thanks,
@jpda
Please note that DrByte has provided a correction on the Zen Cart GitHub (https://github.com/zencart/zencart/p...b01164048b9c77).
@jpda, could you confirm that those changes correct the issue that you identified?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
@lat9
Short answer: no, they didn't.
Explanation:
I am testing on:
zc157d
OPC 2.4.6 (OPC is essential))
shipping method: storepickup with 5 locations, each with their own price.
Problem was: shipping methods are shown but none selected -> payment choices are not shown.
To test the github version of shipping.php, I only replaced its public function cheapest() in the v157d shipping.php.
(The entire github version of shipping.php doesn't work in my v157d environment.)
Tested, but no joy.
Did some debugging:
Changed line 272:
Code:
} elseif ($size === 1) {
in:
Code:
} elseif (count($modules_with_quotes) === 1) {
Reason:
module storepickup with more than one location has a $size that equals the number of locations (5 in my example).
Now it works. :smile:
Even whith more shipping modules than only storepickup, it is still working.
Tried with flat rate and table and storepickup together.
The lowest price is selected by OPC, even if it is one of the storepickup locations. Payment choices are shown.
Tested without OPC enabled. Three or four page checkout, no cheapest selected, user needs to select shipping to continue to next screen.
Would this be a solution?
Thanks,
jpda
-
Re: One-Page Checkout [Support Thread]
@jpda, would you post your "Pickup Locations" setting for the storepickup module (or send to me via PM) so that I can (a) replicate the issue and (b) give your solution a try?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
@jpda, would you post your "Pickup Locations" setting for the storepickup module (or send to me via PM) so that I can (a) replicate the issue and (b) give your solution a try?
@lat9
Of course, copy this string in storepickup:
Loc_A, 9.50;Loc_B, 2.50;Loc_C, 4.50;Loc_D, 7.50;Loc_E, 0.50
and whatever you want for taxes.
I have set CHECKOUT_ONE_ENABLE_SHIPPING_BILLING = true.
Thanks,
@jpda
-
Re: One-Page Checkout [Support Thread]
@lat9
Forgot this:
Shipping Cost
0.00
Tax Basis
Shipping
-
Re: One-Page Checkout [Support Thread]
Thanks for the info, @jpda. I'll look at that over the weekend.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks for the info, @jpda. I'll look at that over the weekend.
The change in shipping.php that I posted was:
Code:
} elseif (count($modules_with_quotes) === 1) {
is not correct if storepickup is not the only method available because count($modules_with_quotes) > 1.
I changed that line to: (rather weird...)
and then it works also when other shipping methods are available.
The selected price is not always the cheapest.:(
If I find a better solution, I will let you know.
@jpda
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
jpda
...
I changed that line to: (rather weird...)
...
code is never weird.... it is code... understanding it can be difficult.
without getting into the logic in question here, the above line of code would be better suited as:
best.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
carlwhat
code is never weird.... it is code... understanding it can be difficult.
without getting into the logic in question here, the above line of code would be better suited as:
best.
I understand the code, "weird" referred to my putting "true" at that place! :smile:
Quick changes, just testing. :laugh:
Thanks anyway!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
jpda
The change in shipping.php that I posted was:
Code:
} elseif (count($modules_with_quotes) === 1) {
is not correct if storepickup is
not the only method available because count($modules_with_quotes) > 1.
I changed that line to: (rather weird...)
and then it works also when other shipping methods are available.
The selected price is not always the cheapest.:(
If I find a better solution, I will let you know.
@jpda
I did fInd a better solution. :smile:
I'll send the public function "cheapest" via pm.
Thanks,
@jpda
-
Re: One-Page Checkout [Support Thread]
Hi Cindy! It's been a LONG time!
I'm building a test site to upgrade to 1.5.8a, and have minimal changes so far - ZCA Bootstrap, and added OPC 2.4.6.
It looks great so far, and a bunch faster too.
OPC works great for a logged-in user (me), but FAILS for a guest checkout:
Sorry, we are not accepting payments from your region at this time.
Please contact us for alternate arrangements.
Two payment modules :
COD - Ontario zone
moneyorder - NO ZONE
Both are available and work properly if logged in, but not guest
www.beadfx.com/shop
Play as you'd like
Thanks!
Dan
BeadFX
-
Re: One-Page Checkout [Support Thread]
Make sure OPC Order Total is set to
#ottotal > .ot-text
for bootstrap
Your Guest Checkout Methods?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
DTomlinson
Hi Cindy! It's been a LONG time!
I'm building a test site to upgrade to 1.5.8a, and have minimal changes so far - ZCA Bootstrap, and added OPC 2.4.6.
It looks great so far, and a bunch faster too.
OPC works great for a logged-in user (me), but FAILS for a guest checkout:
Sorry, we are not accepting payments from your region at this time.
Please contact us for alternate arrangements.
Two payment modules :
COD - Ontario zone
moneyorder - NO ZONE
Both are available and work properly if logged in, but not guest
www.beadfx.com/shop
Play as you'd like
Thanks!
Dan
BeadFX
One of the OPC configuration settings identifies payment methods are disallowed to guests (Guest Checkout: Disallowed Payment Methods). That setting's default is (drum roll) 'moneyorder, cod'.
Just update that setting to be a blank and you'll be good-to-go.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
One of the OPC configuration settings identifies payment methods are disallowed to guests (Guest Checkout: Disallowed Payment Methods). That setting's default is (drum roll) 'moneyorder, cod'.
Just update that setting to be a blank and you'll be good-to-go.
Oh my! How did I miss that one.
Sleepy time!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
DTomlinson
Oh my! How did I miss that one.
Sleepy time!
There are a ton of settings! Glad you found it.
-
Re: One-Page Checkout [Support Thread]
I installed OPC on v1.5.8 test site yesterday. On checkout the following headers are not shown properly. I can't seem to figure out how to insert the defines for these items.
MODULE_ORDER_TOTAL_COUPON_TITLE
MODULE_ORDER_TOTAL_GV_TITLE
Next to the input box the header there is missing these defines
MODULE_ORDER_TOTAL_COUPON_TEXT_ENTER_CODE
MODULE_ORDER_TOTAL_GV_TEXT_ENTER_CODE
MODULE_ORDER_TOTAL_GV_USER_PROMPT
I searched these in the forum but they didn't return any results.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
southshorepizza
I installed OPC on v1.5.8 test site yesterday. On checkout the following headers are not shown properly. I can't seem to figure out how to insert the defines for these items.
MODULE_ORDER_TOTAL_COUPON_TITLE
MODULE_ORDER_TOTAL_GV_TITLE
Next to the input box the header there is missing these defines
MODULE_ORDER_TOTAL_COUPON_TEXT_ENTER_CODE
MODULE_ORDER_TOTAL_GV_TEXT_ENTER_CODE
MODULE_ORDER_TOTAL_GV_USER_PROMPT
I searched these in the forum but they didn't return any results.
zc158 or zc158a? Those constants should be present in /includes/languages/english/modules/order_total/lang.ot_coupon.php and lang.ot_gv.php, respectively.
-
Re: One-Page Checkout [Support Thread]
Sorry it is 1.5.8a
Thank you I will update there.
Those were the 2 that I added the ~ at the end of the files per the instructions. I guess I need break. Details are slipping by me. The instructions clearly do not say to rename files in 1.5.8a. :frusty:
Thank you!!