-
One-Page Checkout [Support Thread]
Pleased to announce: One-Page Checkout for Zen Cart 1.5.4 and later!
This plugin's been developed from the ground-up, using the Zen Cart 1.5.5a checkout-handling as the basis. It's been validated on Zen Cart 1.5.4 and 1.5.5a with all the built-in shipping methods (plus ups and usps) and a couple of the more "complicated" (i.e. Authorize.net/AIM and PayPal Express Checkout) payment methods.
https://www.zen-cart.com/downloads.php?do=file&id=2095
(Zen Cart v1.5.5a is the latest version of Zen Cart as of today's posting. No doubt there will be future versions. Consult the /docs/ documentation and/or discussions in this thread for further updates.)
-
Re: One-Page Checkout [Support Thread]
What a great contribution! :clap::clap::clap:
Just obtained a copy from github (can't wait to get this installed and working on a production site!!!!) and had a play on my local dev server.
Page loads in great shape, displays all my zone rates (3 clones), store pickup and local delivery. Shows all my payment methods (eWay, PayPal and direct bank deposit) - great stuff!! I know that I need to modify the plugin for eWay to extend and show the CC, expiry date etc when selected but that's my problem for now...
But:
I have "Confirm Terms and Conditions During Checkout Procedure" set to true (the nature of this biz needs that confirmed) but there is no prompt / no checkbox (and link to terms & cond page) to confirm that the T&C have been read.
That seems to be the only little booboo in the module, but if that's all then this is a great addition and should be made core!!! Well done indeed!!
You may want to update the docs stating that zone rates and most payment modules are supported.
Well done again, this has been lacking in ZC for a decade.
Cheers / Frank
-
Re: One-Page Checkout [Support Thread]
Thanks for the report, Frank. I'd found a couple of other "misses" that I've just noted in the plugin's GitHub repository. I'll note that one as well and expect to have v1.0.1 available within a week (waiting for additional reports).
I've never used the eWay payment method, what does it do "differently" with respect to the credit-card displays?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks for the report, Frank. I'd found a couple of other "misses" that I've just noted in the plugin's
GitHub repository. I'll note that one as well and expect to have v1.0.1 available within a week (waiting for additional reports).
I've never used the eWay payment method, what does it do "differently" with respect to the credit-card displays?
Thanks Cindy.
If selected eWay just shows the usual fields for CC, name on card, expiry and CVV for completion. The customer does not leave the site, all is done in the store. The mod is available from the downloads. I tweaked it a bit for my needs but the basics are the same.
You can do a test on one of my sites frnt dot com dot au (needs an account creation ofc).
-
Re: One-Page Checkout [Support Thread]
Thanks, again, Frank. That, too, is a boo-boo:oops:. I've got it noted in the plugin's GitHub issues and hope to have a solution real-soon-now.
-
1 Attachment(s)
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, again, Frank. That, too, is a boo-boo:oops:. I've got it noted in the plugin's GitHub issues and hope to have a solution real-soon-now.
What a great contribution, just what I've been after for 1.5.5a :clap:
I've set this up on a clone of my main site and everything is working well with the add-on installed. I have tested it with the PayPal Express (sandbox), COD and moneyorder payment modules and all of them work.
The only minor point I noticed is that the checkout page selects the cheapest non-free postage however the order total shown at the bottom of the page doesn't include the postage unless the radio button is clicked again or a different postage option is selected. I use a cloned table shipping module and the default being selected by the checkout page in my case is table2 (UK 2nd class postage). The correct order total still goes through when the order is confirmed however I wondered if there is some way to get the page to refresh the total when the default is selected by the checkout page or if it is possible to have no postage selected so that the customer needs to pick from the list?
I've attached a screen shot of the page in use on my test site.
Attachment 16558
Kind regards,
Gary
-
Re: One-Page Checkout [Support Thread]
Gary, since you've got the plugin installed on a clone (so you're the only customer accessing that "clone"), you could create me a debug-file and send it to me via PM.
It's important to note at which point the shipping doesn't get included in the total. Is it the very first time you "hit" the checkout_one page after you've logged in? I'm "assuming so", so:
- Log off of the store front.
- Log into your admin and set the One Page Checkout Settings, Debug to true.
- Sign back into your storefront, place a product in your cart and click the Checkout button.
Does the symptom display itself at this point (i.e. no shipping selected)? If so, look in your store's /logs folder for a file named myDebug-one_page_checkout-xxx.log (the xxx is your customer_id), make a copy and PM that to me.
-
Re: One-Page Checkout [Support Thread]
zc 1.5.5a. Responsive Sheffield Blue 2.0 adapted to zc 1.5.5a, Canada Post only shipping module, Paypal regular with express enabled. Live site is SSL, test site not ssl.
I tried installing this mod on my WAMP clone test site.
I didn't have the issue mentioned above with shipping selection - CanadaPost mod offered a number of choices/rates, with none pre-selected. Clicking on any one of them automatically recalculated total at bottom of page. (my CanadaPost mod is live connected on my test site)
I clicked through as far as I could. My test site isn't actually hooked into Paypal live so I got an error at that point. I presume that is only because of the test situation but I had enabled the debug and can send if desired.
I did receive an email from the test site notifying me of paypal error.
-
Re: One-Page Checkout [Support Thread]
@soxophoneplayer, please send that log!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Gary, since you've got the plugin installed on a clone (so you're the only customer accessing that "clone"), you could create me a debug-file and send it to me via PM.
It's important to note at which point the shipping doesn't get included in the total. Is it the very first time you "hit" the checkout_one page after you've logged in? I'm "assuming so", so:
- Log off of the store front.
- Log into your admin and set the One Page Checkout Settings, Debug to true.
- Sign back into your storefront, place a product in your cart and click the Checkout button.
Does the symptom display itself at this point (i.e. no shipping selected)? If so, look in your store's /logs folder for a file named myDebug-one_page_checkout-xxx.log (the xxx is your customer_id), make a copy and PM that to me.
Thanks for your reply. Yes it happens either when I'm logged in and first click checkout or click checkout and then login. The radio button for 2nd class post is already selected and the sub-total and shipping are both show at the bottom of the page above the confirm order button, however the total shows the same amount as the sub-total (i.e. the shipping isn't added). I'll PM you the log file created at this stage. It's not a major problem and the total does go through once the order is confirmed.
Gary
-
Re: One-Page Checkout [Support Thread]
Got the log, Gary, and it's weird. The shipping-method chosen (table2_table2) is set in the order, but it doesn't appear to be set into the session (and that's what's "confusing" the one-page checkout page's handling).
Do you have any plugin observers (files present in /includes/classes/observers) that might be performing that update?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Got the log, Gary, and it's weird. The shipping-method chosen (table2_table2) is set in the order, but it doesn't appear to be set into the session (and that's what's "confusing" the one-page checkout page's handling).
Do you have any plugin observers (files present in /includes/classes/observers) that might be performing that update?
I have the Google recaptcha plugin on my site which includes an additional file in the observers folder called class.google_recaptcha.php which adds a recaptcha check on the contact page and create account pages. The only other file in this folder is the class.products_viewed_counter.php which I believe is part of the original install.
Thanks,
Gary
-
Re: One-Page Checkout [Support Thread]
I've got a couple of updates available on the plugin's github repository, specifically to address the two issues that @frank18 identified:
- Missing T&C block; if enabled, it's now displayed just above the submit button.
- Support for eWay payment method, which seems to do a bit of a one-off in its handling of the process_button function.
These will be included in a forth-coming v1.0.1 release of the plugin.
-
Re: One-Page Checkout [Support Thread]
v1.0.0 is now available for download from the Zen Cart plugins: https://www.zen-cart.com/downloads.php?do=file&id=2095
As I indicated above, I'm "gathering" additional updates that will comprise v1.0.1 with corrections for the items currently reported.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
I've got a couple of updates available on the plugin's
github repository, specifically to address the two issues that @frank18 identified:
- Missing T&C block; if enabled, it's now displayed just above the submit button.
- Support for eWay payment method, which seems to do a bit of a one-off in its handling of the process_button function.
These will be included in a forth-coming v1.0.1 release of the plugin.
The latest github download works a treat for me, especially for a payment module like eWay.
Made some tweaks such as pre-selecting eWay as payment method and added a few bits and pieces which are only relevant for one of my stores. All good!
But found another little 'boo-boo':
In the file includes/templates/template_default/templates/tpl_checkout_one_confirmation_default.php the $editShippingButtonLink takes me back to the home page instead to the address book for editing the shipping address in the order.
It looks like that $editShippingButtonLink does not carry from the previous page.
So in the file includes/modules/pages/checkout_one_confirmation/header_php.php below line 95 I added
Code:
$editShippingButtonLink = zen_href_link (FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL');
and that did the trick for me.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
frank18
The latest github download works a treat for me, especially for a payment module like eWay.
Made some tweaks such as pre-selecting eWay as payment method and added a few bits and pieces which are only relevant for one of my stores. All good!
But found another little 'boo-boo':
In the file includes/templates/template_default/templates/tpl_checkout_one_confirmation_default.php the
$editShippingButtonLink takes me back to the home page instead to the address book for editing the shipping address in the order.
It looks like that
$editShippingButtonLink does not carry from the previous page.
So in the file includes/modules/pages/checkout_one_confirmation/header_php.php below line 95 I added
Code:
$editShippingButtonLink = zen_href_link (FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL');
and that did the trick for me.
Thanks, Frank, I had a feeling that I was going to need to get those "edit-button-link" values set when the on-page confirmation is displayed. I'll get that noted/updated as well.
-
Re: One-Page Checkout [Support Thread]
Question?
Does Auth.net AIM mean it has only been tested & functional with AIM?
Does that mean it has not been tested or known to not function with Auth.net SIM?
I don't want to go down a path of known headache unnecessarily.
ZC1.5.4
Not ready to go down the ZC1.5.5a road.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
RixStix
Question?
Does Auth.net AIM mean it has only been tested & functional with AIM?
Does that mean it has not been tested or known to not function with Auth.net SIM?
I don't want to go down a path of known headache unnecessarily.
ZC1.5.4
Not ready to go down the ZC1.5.5a road.
Rick, the plugin "should" work just fine with Auth.net SIM. Since the A.net AIM implementation accepts credit-card-data-onsite, my thought was that that method was going to be (one of) the edge cases.
One-Page Checkout's default installation overwrites only one core-file (/includes/classes/message_stack.php) and can be turned on/off with a single configuration click. If you've got a test-site for your store, you could "drop" the files into that file-system to do a validation.
The plugin has been verified on ZC 1.5.4, with those additional core-/template-file overwrites.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, Frank, I had a feeling that I was going to need to get those "edit-button-link" values set when the on-page confirmation is displayed. I'll get that noted/updated as well.
That update is now available from the plugin's GitHub repository.
-
Re: One-Page Checkout [Support Thread]
Thanks Cindy.
We switched from AIM to SIM because the latest PCI version moved from SAQ-c to SAQ-d which is a significantly more onerous.
-
Re: One-Page Checkout [Support Thread]
Just wanted to say Thank you for this excellent plugin. I installed it according to instructions without a hitch. Absolutely no problem with payment or shipping modules or anything else. Thank you again. Are you accepting donations? I think you should and I will be glad to contribute.
Thanks again,
Frank
-
Re: One-Page Checkout [Support Thread]
Thanks, @fjbern1943, donations to the Zen Cart project are always welcomed.
What payment and shipping modules are you using? I'm trying to compile a list of those that people have used with the One Page Checkout.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
......What payment and shipping modules are you using? I'm trying to compile a list of those that people have used with the One Page Checkout.
Direct Bank Deposit
eWay
PayPal
and all good :thumbsup:
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
frank18
Direct Bank Deposit
eWay
PayPal
and all good :thumbsup:
Thanks, Frank (was that PayPal Express Checkout?). Now, if I could only determine why the shipping-method is not pre-selected on some sites ...
-
1 Attachment(s)
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, Frank (was that PayPal Express Checkout?). Now, if I could only determine why the shipping-method is not pre-selected on some sites ...
Not sure if my example is your ref. I have CanadaPost mod. It is the only shipping I offer. In that respect, the method is pre-selected. Within CanadaPost there are several choices that I offer. These successfully show on the checkout screen, with none of those pre-selected. An attempt to checkout without selecting one choice will not proceed - basically the screen refreshes as is. Selecting any choice will adjust the total sale cost and changing the choice will follow through and change the total.
On the cart screen, before hitting the checkout, the shipping choices and respective costs are presented, with the least expensive estimate hi-lighted. The estimate doesn't become an actual cost until selected on checkout.
Here's a screen shot of checkout shipping section:
Attachment 16567
As is, my thought is to simply change the message in the language file to reinforce that the customer must select a choice.
I'm still on test store with this. I have also tested in the mobile/tablet simulators with no issues presenting.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, @fjbern1943, donations to the Zen Cart project are always welcomed.
What payment and shipping modules are you using? I'm trying to compile a list of those that people have used with the One Page Checkout.
Shipping Methods - free shipping options, usps and fed ex
Payment Methods - Pay Pal express, check/money order, layaway plan, and Braintree
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
soxophoneplayer
Not sure if my example is your ref. I have CanadaPost mod. It is the only shipping I offer. In that respect, the method is pre-selected. Within CanadaPost there are several choices that I offer. These successfully show on the checkout screen, with none of those pre-selected. An attempt to checkout without selecting one choice will not proceed - basically the screen refreshes as is. Selecting any choice will adjust the total sale cost and changing the choice will follow through and change the total.
On the cart screen, before hitting the checkout, the shipping choices and respective costs are presented, with the least expensive estimate hi-lighted. The estimate doesn't become an actual cost until selected on checkout.
Here's a screen shot of checkout shipping section:
Attachment 16567
As is, my thought is to simply change the message in the language file to reinforce that the customer must select a choice.
I'm still on test store with this. I have also tested in the mobile/tablet simulators with no issues presenting.
That helps a lot! I think that the most recent change that I made to /includes/modules/pages/checkout_one/header_php.php will correct that issue.
If you click on that link, you'll be presented with the "raw" file data, just copy/paste that file's contents into the like-named file in your store's file-system.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
That helps a lot! I think that the most recent change that I made to
/includes/modules/pages/checkout_one/header_php.php will correct that issue.
If you click on that link, you'll be presented with the "raw" file data, just copy/paste that file's contents into the like-named file in your store's file-system.
Yup. That's got it. I envy your geekerly skills.
Out of curiosity - is it coincidence that the buttons in your mod are the same colours as in my template (Sheffield Blue Responsive) or have you put in a magic code to sniff out and use colour scheme of the user?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
soxophoneplayer
Yup. That's got it. I envy your geekerly skills.
Out of curiosity - is it coincidence that the buttons in your mod are the same colours as in my template (Sheffield Blue Responsive) or have you put in a magic code to sniff out and use colour scheme of the user?
OK, another one bites the dust ...:clap:
No magic code involved, the plugin simply uses the button-related HTML constructs and built-in Zen Cart functions to create those buttons.
As such, it either pulls in the graphic buttons you've specified for your template or the CSS-styling for those buttons, depending on your store's "CSS Buttons" configuration setting (present in Configuration->My Store for Zen Cart versions prior to 1.5.5 or Configuration->Layout Settings otherwise.
-
Re: One-Page Checkout [Support Thread]
Hello,
Just changed the /includes/modules/pages/checkout_one/header_php.php file, as shown in post#28 above. When I change the shipping method the subtotal or the total do not update. Changed the file back to the original plugin file and the behavior is the same.
Frank
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
fjbern1943
Hello,
Just changed the /includes/modules/pages/checkout_one/header_php.php file, as shown in post#28 above. When I change the shipping method the subtotal or the total do not update. Changed the file back to the original plugin file and the behavior is the same.
Frank
Does it update correctly if you change back to the conventional 3 page checkout?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, Frank (was that PayPal Express Checkout?)....
Yes it is Cindy.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
frank18
Does it update correctly if you change back to the conventional 3 page checkout?
Yes when I switch back to the standard 3 page checkout the shipping charges change and the totals are updated when I goto step 2.
Frank
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
fjbern1943
Yes when I switch back to the standard 3 page checkout the shipping charges change and the totals are updated when I goto step 2.
Frank
Ok, if the conventional checkout works as expected then your basic configuration is ok. Now pls check that all files/folders contained in this package are uploaded to the correct locations.
Cheers / (another) Frank
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
frank18
Ok, if the conventional checkout works as expected then your basic configuration is ok. Now pls check that all files/folders contained in this package are uploaded to the correct locations.
Cheers / (another) Frank
yes, all files have been uploaded and are in their right place. Did notice however that not all template files in the template_default folder are in the responsive_sheffield_blue folder only the css folder is there.
Frank
Frank
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
fjbern1943
yes, all files have been uploaded and are in their right place. Did notice however that not all template files in the template_default folder are in the responsive_sheffield_blue folder only the css folder is there.
Frank
Frank
oK I lied found out the 1.54 only file jscript_framework.php file was missing from both the template_default and responsive_sheffield_blue folders. Uploaded them and guess what everything is working now.
Frank
-
Re: One-Page Checkout [Support Thread]
@fjbern1943, thanks for the update that applying the Zen Cart 1.5.5a corrections to the jscript_framework.php file corrected your issues (make sure that you also updated the /ajax.php file since you're running Zen Cart 1.5.4).
-
Re: One-Page Checkout [Support Thread]
I've just submitted v1.0.1 to the plugins area; it will be available for download once reviewed.
This version contains the following changes; the change numbers identify the issue numbers from the plugin's GitHub repository:
#1: Add check for customer's authorization level
#2: AJAX changes apply to Zen Cart 1.5.5, too.
#3: Add support for the terms&conditions block.
#4: Add instructions for updating ROBOTS_PAGES_TO_SKIP
#5: Correction for payment methods that insert form methods (like eWay) on the confirmation page
#6: Shipping not calculated/selected on initial entry to checkout on some stores
#7: Remove unwanted extra double-quote in checkout_one_confirmation page's template
#8: Set shipping/payment button edit-flags on confirmation page
#9: Correct progress indicator not showing on confirmation page.
#10: Update debug.
#11: Pre-integration with Products' Options' Stock Manager.
-
Re: One-Page Checkout [Support Thread]
Using One-Page Checkout with PDP (Product Delivery By Postcode) Shipping Module
If you are using my shipping module 'Product Delivery By Postcode (PDP)' https://www.zen-cart.com/showthread....-(PDP)-Support ) you need to make 2 additions to the One-Page Checkout module.
1. File includes/modules/pages/checkout_one/header_php.php
After line 203 insert
PHP Code:
// bof postcode allowed (PDP)
$check_delivery_postcode = $order->delivery['postcode'];
// shorten UK / Canada postcodes to use first part only
$check_delivery_postcode = zen_get_UKPostcodeFirstPart($check_delivery_postcode);
// now check db for allowed postcodes and enable / disable relevant shipping modules
if (in_array($check_delivery_postcode,explode(",", MODULE_SHIPPING_LOCALDELIVERY_POSTCODE))) {
// continue as normal
} else {
$localdelivery = false;
}
if (in_array($check_delivery_postcode,explode(",", MODULE_SHIPPING_STOREPICKUP_POSTCODE))) {
// continue as normal
} else {
$storepickup = false;
}
// eof postcode allowed (PDP)
2. File includes/templates/template_default/tpl_checkout_one_default.php
Find
Code:
<h2 id="checkoutShippingHeadingMethod"><?php echo TITLE_NO_SHIPPING_AVAILABLE; ?></h2>
<div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_NO_SHIPPING_AVAILABLE; ?></div>
and change to
PHP Code:
<h2 id="checkoutShippingHeadingMethod"><?php echo TITLE_NO_SHIPPING_AVAILABLE; ?></h2>
<!--bof local delivery only alert -->
<div id="cartLocalText">
<?php
// check if product marked local delivery only is in cart
global $cart ;
$chk_local_delivery_only = $_SESSION['cart']->in_cart_check('product_is_local_delivery','1');
if ($chk_local_delivery_only) {
echo TEXT_PRODUCT_LOCAL_DELIVERY_ONLY;
}
?>
</div>
<!--eof local delivery only alert -->
<div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_NO_SHIPPING_AVAILABLE; ?></div>
Cheers / Frank
-
Re: One-Page Checkout [Support Thread]
Thanks for that, Frank. I'll just note that any changes to the One-Page Checkout's default templates should be treated just like any other template-override, i.e. copy the file from /includes/templates/template_default/templates into /includes/templates/YOUR_TEMPLATE/templates before making those changes!
Otherwise, those changes (like the ones to the page's header_php.php) will be overwritten on a plugin update (unless you remember where you made those changes).
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks for that, Frank. I'll just note that any changes to the One-Page Checkout's default templates should be treated just like any other template-override, i.e. copy the file from /includes/templates/template_default/templates into /includes/templates/YOUR_TEMPLATE/templates before making those changes!
Otherwise, those changes (like the ones to the page's header_php.php) will be overwritten on a plugin update (unless you remember where you made those changes).
Makes sense Cindy - noted. Pls check PM
-
Re: One-Page Checkout [Support Thread]
Grrr, :censored: IE. Why do I always leave the testing of that browser for the end?
Turns out that the checkout_one page's form doesn't submit properly on IE (IE-11, at least) and just redisplays the checkout_one page on submit-key click.
The issue is that by disabling the HTML <div> in which the submit-button resides on-click, IE disables all the hidden-input variables in that section as well, so the plugin's confirmation page doesn't "see" that it was a real form-submit and redirects back to the main checkout page.
That said, a two-line change to /includes/modules/pages/checkout_one/jscript_main.php is required (it'll be staged for v1.0.2 in the plugin's GitHub repository). Towards the bottom of the file, find:
Code:
$('form[name="checkout_payment"]').submit(function() {
zcLog2Console ('Form submitted, orderConfirmed ('+orderConfirmed+')');
if (orderConfirmed) {
$('#checkoutOneSubmit').attr('disabled', true);
<?php
if ($flagOnSubmit) {
?>
var formPassed = check_form();
zcLog2Console ('Form checked, passed ('+formPassed+')');
if (formPassed == false) {
$('#checkoutOneSubmit').attr('disabled', false);
}
return formPassed;
<?php
}
?>
}
});
and make the two highlighted changes:
Code:
$('form[name="checkout_payment"]').submit(function() {
zcLog2Console ('Form submitted, orderConfirmed ('+orderConfirmed+')');
if (orderConfirmed) {
$('#confirm-order').attr('disabled', true);
<?php
if ($flagOnSubmit) {
?>
var formPassed = check_form();
zcLog2Console ('Form checked, passed ('+formPassed+')');
if (formPassed == false) {
$('#confirm-order').attr('disabled', false);
}
return formPassed;
<?php
}
?>
}
});
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Grrr, :censored: IE. Why do I always leave the testing of that browser for the end?
Turns out that the checkout_one page's form doesn't submit properly on IE (IE-11, at least) and just redisplays the checkout_one page on submit-key click.
The issue is that by disabling the HTML
<div> in which the submit-button resides on-click, IE disables
all the hidden-input variables in that section as well, so the plugin's confirmation page doesn't "see" that it was a real form-submit and redirects back to the main checkout page.
That said, a two-line change to /includes/modules/pages/checkout_one/jscript_main.php is required (it'll be staged for v1.0.2 in the plugin's GitHub repository). Towards the bottom of the file, find:
Code:
$('form[name="checkout_payment"]').submit(function() {
zcLog2Console ('Form submitted, orderConfirmed ('+orderConfirmed+')');
if (orderConfirmed) {
$('#checkoutOneSubmit').attr('disabled', true);
<?php
if ($flagOnSubmit) {
?>
var formPassed = check_form();
zcLog2Console ('Form checked, passed ('+formPassed+')');
if (formPassed == false) {
$('#checkoutOneSubmit').attr('disabled', false);
}
return formPassed;
<?php
}
?>
}
});
and make the two highlighted changes:
Code:
$('form[name="checkout_payment"]').submit(function() {
zcLog2Console ('Form submitted, orderConfirmed ('+orderConfirmed+')');
if (orderConfirmed) {
$('#confirm-order').attr('disabled', true);
<?php
if ($flagOnSubmit) {
?>
var formPassed = check_form();
zcLog2Console ('Form checked, passed ('+formPassed+')');
if (formPassed == false) {
$('#confirm-order').attr('disabled', false);
}
return formPassed;
<?php
}
?>
}
});
Hello,
I am unhappy to report that I am having a problem with this plugin when trying to use Braintree Credit Card Processor.
I have version 1.01 installed and the above modifications. I can't tell you if it was working before with version 1.00 because I assumed it was working because the payment method appeared on the one-page checkout form but I never really tested it. Shame on me!
I am getting this error in my logs:
[08-Aug-2016 07:30:55 America/Chicago] PHP Parse error: syntax error, unexpected T_STRING in /hsphere/local/home/religiousshop/religious-shop.com/includes/languages/english/responsive_sheffield_blue/checkout_confirmation.php on line 15
I have debug turned on in the admin for this plugin nd here is a copy of it:
2016-08-08 08:02:02 checkout_one_observer: checkout_one redirect: Array
(
[main_page] => checkout_shipping
)
2016-08-08 08:02:03 checkout_one: CHECKOUT_ONE_ENTRY, version (1.0.1 (2016-08-06)), Zen Cart version (1.5.4), template (responsive_sheffield_blue)
2016-08-08 08:02:03 checkout_one: CHECKOUT_ONE_AFTER_SHIPPING_CALCULATIONS, pass (), free_shipping (), array (
'id' => 'freeoptions_freeoptions',
'title' => 'Free Shipping Options (Free Shipping)',
'cost' => 0,
'extras' => '',
)
2016-08-08 08:02:06 checkout_one: CHECKOUT_ONE_SHIPPING_CHECK (freeoptions_freeoptions)
Array
(
[0] => Array
(
[id] => freeoptions
[module] => Free Shipping Options
[methods] => Array
(
[0] => Array
(
[id] => freeoptions
[title] => Free Shipping
[cost] => 0
)
)
)
[1] => Array
(
[id] => usps
[module] => United States Postal Service (1 Boxes) (0 lbs, 8 oz)
[methods] => Array
(
[0] => Array
(
[id] => First-Class Mail Parcel
[title] => First-Class Mail Parcel (2 - 5 days)
[cost] => 8.9
[insurance] => 0
)
[1] => Array
(
[id] => Priority MailTM
[title] => Priority Mail™ (2 - 3 days)
[cost] => 11.25
[insurance] => 0.00
)
)
[tax] =>
[icon] => <img src="includes/templates/template_default/images/icons/shipping_usps.gif" alt="United States Postal Service" title=" United States Postal Service " width="50" height="13" />
)
[2] => Array
(
[id] => fedexwebservices
[module] => FedEx (1 x 0.50lbs)
[info] =>
[methods] => Array
(
[0] => Array
(
[id] => PRIORITYOVERNIGHT
[title] => Priority Overnight
[cost] => 34.28
)
[1] => Array
(
[id] => STANDARDOVERNIGHT
[title] => Standard Overnight
[cost] => 31.96
)
[2] => Array
(
[id] => FEDEX2DAY
[title] => Fedex 2 Day
[cost] => 23.62
)
[3] => Array
(
[id] => FEDEXEXPRESSSAVER
[title] => Fedex Express Saver
[cost] => 22.73
)
[4] => Array
(
[id] => GROUNDHOMEDELIVERY
[title] => Ground Home Delivery (1 business day)
[cost] => 13.88
)
)
)
)
Array
(
[0] => freeoptions_freeoptions
[1] => usps_First-Class Mail Parcel
[2] => usps_Priority MailTM
[3] => fedexwebservices_PRIORITYOVERNIGHT
[4] => fedexwebservices_STANDARDOVERNIGHT
[5] => fedexwebservices_FEDEX2DAY
[6] => fedexwebservices_FEDEXEXPRESSSAVER
[7] => fedexwebservices_GROUNDHOMEDELIVERY
)
2016-08-08 08:02:06 checkout_one: CHECKOUT_ONE_AFTER_SHIPPING_QUOTES
array (
'id' => 'freeoptions_freeoptions',
'title' => 'Free Shipping Options (Free Shipping)',
'cost' => 0,
'extras' => '',
)order Object
(
[info] => Array
(
[order_status] => 1
[currency] => USD
[currency_value] => 1.00000000
[payment_method] =>
[payment_module_code] =>
[coupon_code] =>
[shipping_method] => Free Shipping Options (Free Shipping)
[shipping_module_code] => freeoptions_freeoptions
[shipping_cost] => 0
[subtotal] => 8.1
[shipping_tax] =>
[tax] => 0
[total] => 8.1
[tax_groups] => Array
(
[0] => 0
)
[comments] =>
[ip_address] => 96.245.162.177 - 96.245.162.177
)
[totals] => Array
(
)
[products] => Array
(
[0] => Array
(
[qty] => 1
[name] => Round Swarovski Dark Amethyst Birthstones
[model] => CB506FEB
[tax_groups] => Array
(
[0] => Sales Tax
)
[tax_description] => Sales Tax
[price] => 8.1000
[final_price] => 8.1
[vendors_id] => 3
[vendors_name] => HMH
[onetime_charges] => 0
[weight] => 0.5
[products_priced_by_attribute] => 0
[product_is_free] => 0
[products_discount_type] => 0
[products_discount_type_from] => 0
[id] => 3830
[rowClass] => rowEven
[tax] => 0
)
)
[customer] => Array
(
[firstname] => Frank
[lastname] => Bernstein
[company] =>
[street_address] => 31115 Beaver Circle
[suburb] =>
[city] => Lewes
[postcode] => 19958
[state] => Delaware
[zone_id] => 15
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[format_id] => 2
[telephone] => 3022978848
[email_address] => [email protected]
)
[delivery] => Array
(
[firstname] => Frank
[lastname] => Bernstein
[company] =>
[street_address] => 31115 Beaver Circle
[suburb] =>
[city] => Lewes
[postcode] => 19958
[state] => Delaware
[zone_id] => 15
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[country_id] => 223
[format_id] => 2
)
[content_type] => physical
[email_low_stock] =>
[products_ordered_attributes] =>
[products_ordered] =>
[products_ordered_email] =>
[attachArray] =>
[billing] => Array
(
[firstname] => Frank
[lastname] => Bernstein
[company] =>
[street_address] => 31115 Beaver Circle
[suburb] =>
[city] => Lewes
[postcode] => 19958
[state] => Delaware
[zone_id] => 15
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[country_id] => 223
[format_id] => 2
)
)
messageStack Object
(
[messages] => Array
(
)
)
Array
(
[0] => Array
(
[id] => freeoptions
[module] => Free Shipping Options
[methods] => Array
(
[0] => Array
(
[id] => freeoptions
[title] => Free Shipping
[cost] => 0
)
)
)
[1] => Array
(
[id] => usps
[module] => United States Postal Service (1 Boxes) (0 lbs, 8 oz)
[methods] => Array
(
[0] => Array
(
[id] => First-Class Mail Parcel
[title] => First-Class Mail Parcel (2 - 5 days)
[cost] => 8.9
[insurance] => 0
)
[1] => Array
(
[id] => Priority MailTM
[title] => Priority Mail™ (2 - 3 days)
[cost] => 11.25
[insurance] => 0.00
)
)
[tax] =>
[icon] => <img src="includes/templates/template_default/images/icons/shipping_usps.gif" alt="United States Postal Service" title=" United States Postal Service " width="50" height="13" />
)
[2] => Array
(
[id] => fedexwebservices
[module] => FedEx (1 x 0.50lbs)
[info] =>
[methods] => Array
(
[0] => Array
(
[id] => PRIORITYOVERNIGHT
[title] => Priority Overnight
[cost] => 34.28
)
[1] => Array
(
[id] => STANDARDOVERNIGHT
[title] => Standard Overnight
[cost] => 31.96
)
[2] => Array
(
[id] => FEDEX2DAY
[title] => Fedex 2 Day
[cost] => 23.62
)
[3] => Array
(
[id] => FEDEXEXPRESSSAVER
[title] => Fedex Express Saver
[cost] => 22.73
)
[4] => Array
(
[id] => GROUNDHOMEDELIVERY
[title] => Ground Home Delivery (1 business day)
[cost] => 13.88
)
)
)
)
2016-08-08 08:02:06 checkout_one: CHECKOUT_ONE_AFTER_ORDER_TOTAL_PROCESSING
order_total Object
(
[modules] => Array
(
[0] => ot_subtotal.php
[1] => ot_shipping.php
[2] => ot_coupon.php
[3] => ot_group_pricing.php
[4] => ot_quantity_discount.php
[5] => ot_bogo.php
[6] => ot_tax.php
[7] => ot_loworderfee.php
[8] => ot_gv.php
[9] => ot_total.php
)
)
order Object
(
[info] => Array
(
[order_status] => 1
[currency] => USD
[currency_value] => 1.00000000
[payment_method] =>
[payment_module_code] =>
[coupon_code] =>
[shipping_method] => Free Shipping Options (Free Shipping)
[shipping_module_code] => freeoptions_freeoptions
[shipping_cost] => 0
[subtotal] => 8.1
[shipping_tax] =>
[tax] => 0
[total] => 8.1
[tax_groups] => Array
(
[0] => 0
)
[comments] =>
[ip_address] => 96.245.162.177 - 96.245.162.177
)
[totals] => Array
(
)
[products] => Array
(
[0] => Array
(
[qty] => 1
[name] => Round Swarovski Dark Amethyst Birthstones
[model] => CB506FEB
[tax_groups] => Array
(
[0] => Sales Tax
)
[tax_description] => Sales Tax
[price] => 8.1000
[final_price] => 8.1
[vendors_id] => 3
[vendors_name] => HMH
[onetime_charges] => 0
[weight] => 0.5
[products_priced_by_attribute] => 0
[product_is_free] => 0
[products_discount_type] => 0
[products_discount_type_from] => 0
[id] => 3830
[rowClass] => rowEven
[tax] => 0
)
)
[customer] => Array
(
[firstname] => Frank
[lastname] => Bernstein
[company] =>
[street_address] => 31115 Beaver Circle
[suburb] =>
[city] => Lewes
[postcode] => 19958
[state] => Delaware
[zone_id] => 15
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[format_id] => 2
[telephone] => 3022978848
[email_address] => [email protected]
)
[delivery] => Array
(
[firstname] => Frank
[lastname] => Bernstein
[company] =>
[street_address] => 31115 Beaver Circle
[suburb] =>
[city] => Lewes
[postcode] => 19958
[state] => Delaware
[zone_id] => 15
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[country_id] => 223
[format_id] => 2
)
[content_type] => physical
[email_low_stock] =>
[products_ordered_attributes] =>
[products_ordered] =>
[products_ordered_email] =>
[attachArray] =>
[billing] => Array
(
[firstname] => Frank
[lastname] => Bernstein
[company] =>
[street_address] => 31115 Beaver Circle
[suburb] =>
[city] => Lewes
[postcode] => 19958
[state] => Delaware
[zone_id] => 15
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[country_id] => 223
[format_id] => 2
)
)
messageStack Object
(
[messages] => Array
(
)
)
2016-08-08 08:02:06 checkout_one: CHECKOUT_ONE_AFTER_PAYMENT_MODULES_SELECTION
payment Object
(
[modules] => Array
(
[0] => braintree_api.php
[1] => moneyorder.php
[2] => freecharger.php
[3] => paypalwpp.php
[4] => layaway.php
)
[selected_module] =>
[doesCollectsCardDataOnsite] => 1
[paymentClass] => layaway Object
(
[code] => layaway
[title] => Layaway Payments <br/>Available for orders above $300.00. This splits the cost of your order into monthly payments, Your first payment is due now, please send your down payment check to us as soon as possible. Your order will NOT ship until paid in full
[description] => Monthly Payments
[icon] =>
[enabled] => 1
[sort_order] => 5
[email_footer] => Layaway Payment Plan
[layaway_payment_lengths_list] => Array
(
[0] => 3 Months
[1] => 6 Months
)
[layaway_payment_lengths_list_dropdown] => Array
(
[0] => Array
(
[id] => 0
[text] => 3 Months
)
[1] => Array
(
[id] => 1
[text] => 6 Months
)
)
)
)
array (
'id' => 'freeoptions_freeoptions',
'title' => 'Free Shipping Options (Free Shipping)',
'cost' => 0,
'extras' => '',
)
2016-08-08 08:02:06 checkout_one: CHECKOUT_ONE_TEMPLATE_SHIPPING_QUOTES:
array (
'id' => 'freeoptions_freeoptions',
'title' => 'Free Shipping Options (Free Shipping)',
'cost' => 0,
'extras' => '',
)
array (
0 =>
array (
'id' => 'freeoptions',
'module' => 'Free Shipping Options',
'methods' =>
array (
0 =>
array (
'id' => 'freeoptions',
'title' => 'Free Shipping',
'cost' => 0,
),
),
),
1 =>
array (
'id' => 'usps',
'module' => 'United States Postal Service (1 Boxes) (0 lbs, 8 oz)',
'methods' =>
array (
0 =>
array (
'id' => 'First-Class Mail Parcel',
'title' => 'First-Class Mail Parcel (2 - 5 days)',
'cost' => 8.9,
'insurance' => 0,
),
1 =>
array (
'id' => 'Priority MailTM',
'title' => 'Priority Mail™ (2 - 3 days)',
'cost' => 11.25,
'insurance' => '0.00',
),
),
'tax' => NULL,
'icon' => '<img src="includes/templates/template_default/images/icons/shipping_usps.gif" alt="United States Postal Service" title=" United States Postal Service " width="50" height="13" />',
),
2 =>
array (
'id' => 'fedexwebservices',
'module' => 'FedEx (1 x 0.50lbs)',
'info' => '',
'methods' =>
array (
0 =>
array (
'id' => 'PRIORITYOVERNIGHT',
'title' => 'Priority Overnight',
'cost' => 34.28,
),
1 =>
array (
'id' => 'STANDARDOVERNIGHT',
'title' => 'Standard Overnight',
'cost' => 31.96,
),
2 =>
array (
'id' => 'FEDEX2DAY',
'title' => 'Fedex 2 Day',
'cost' => 23.62,
),
3 =>
array (
'id' => 'FEDEXEXPRESSSAVER',
'title' => 'Fedex Express Saver',
'cost' => 22.73,
),
4 =>
array (
'id' => 'GROUNDHOMEDELIVERY',
'title' => 'Ground Home Delivery (1 business day)',
'cost' => 13.88,
),
),
),
)
When I switch back to the old multi-page checkout everything works ok.
Please help,
Frank
-
Re: One-Page Checkout [Support Thread]
Frank, I appreciate the posting of the log file! Next time, though, you should post that (or any code-related items) using the "CODE" tags (the big # in the menu-bar as you're writing your post). That just places that information into a scrollable text-box so that the information doesn't occupy so much screen-space.
There are two issues ... first, the debug-log that you received. Find the following block in your /includes/languages/english/YOUR_TEMPLATE/checkout_confirmation.php (where, for your case, YOUR_TEMPLATE is responsive_sheffield_blue):
Code:
//-bof-one_page_checkout-lat9 *** 1 of 1 ***
if (defined ('CHECKOUT_ONE_ENABLED') && CHECKOUT_ONE_ENABLED == 'true') {
define ('NAVBAR_TITLE_2', 'Review and Submit')
define ('HEADING_TITLE', 'Review Order Details and Submit Your Order');
} else {
define('NAVBAR_TITLE_2', 'Confirmation');
define('HEADING_TITLE', 'Step 3 of 3 - Order Confirmation');
}
//-eof-one_page_checkout-lat9 *** 1 of 1 ***
and add that missing semi-colon:
Code:
//-bof-one_page_checkout-lat9 *** 1 of 1 ***
if (defined ('CHECKOUT_ONE_ENABLED') && CHECKOUT_ONE_ENABLED == 'true') {
define ('NAVBAR_TITLE_2', 'Review and Submit');
define ('HEADING_TITLE', 'Review Order Details and Submit Your Order');
} else {
define('NAVBAR_TITLE_2', 'Confirmation');
define('HEADING_TITLE', 'Step 3 of 3 - Order Confirmation');
}
//-eof-one_page_checkout-lat9 *** 1 of 1 ***
Now, as to the Braintree payment method "not working", could you elaborate a bit on what's not working? I see from the log that the payment-method collects payment data on-site and you're running Zen Cart 1.5.4. I think you'd mentioned previously, but I have to ask: Have you copied the ajax.php and jscript_framework.php files from the plugin's /pre_zc155a folder to your store (and the template's jscript folder)?
-
Re: One-Page Checkout [Support Thread]
FWIW, I just created a Braintree sandbox account, installed and configured Braintree 1.3.1 and, with the ZC 1.5.5a responsive_classic template, successfully placed an order.
That said, @fjbern1943, I'm puzzled as to the source of the issue you're having.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
FWIW, I just created a Braintree sandbox account, installed and configured Braintree 1.3.1 and, with the ZC 1.5.5a responsive_classic template, successfully placed an order.
That said, @fjbern1943, I'm puzzled as to the source of the issue you're having.
Hello,
I added the ";" to the checkout_confirmation.php page. I had already uploaded the ajax.php and jscript_framework.php files from the plugin's /pre_zc155a folder. Everything now looks ok and was able to checkout with Braintree. So, the problem was only the missing ";" .
Thanks for the help.
Frank
-
Re: One-Page Checkout [Support Thread]
Thanks, @fjbern1943, for the update! That "missing semi-colon" fix is booked for the plugin's 1.0.2 release.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, @fjbern1943, for the update! That "missing semi-colon" fix is booked for the plugin's 1.0.2 release.
Unfortunately I have another problem. I have a vendor type application installed on the site, which associates an order with a vendor, produces a packing slip pdf file which attaches to an email that is automatically sent to the vendor with our order information and packing slip. This works fine with the standard 3 page checkout but is not working with the new one-page checkout. The main file that has been modified to accomplish this is the includes/modules/checkout_process.php file which is called by the header_php.php file. I examined both of the regular checkout and checkout one files and can't see why the checkout_process file is not being called by the checkout one files.
This more than likely off topic but might be valuable for other zeners with this type or similar applications that might be called by the checkout_process.php file.
Any help or direction would be greatly appreciated.
Frank
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, @fjbern1943, for the update! That "missing semi-colon" fix is booked for the plugin's 1.0.2 release.
Noted and done - thanks!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
fjbern1943
Unfortunately I have another problem. I have a vendor type application installed on the site, which associates an order with a vendor, produces a packing slip pdf file which attaches to an email that is automatically sent to the vendor with our order information and packing slip. This works fine with the standard 3 page checkout but is not working with the new one-page checkout. The main file that has been modified to accomplish this is the includes/modules/checkout_process.php file which is called by the header_php.php file. I examined both of the regular checkout and checkout one files and can't see why the checkout_process file is not being called by the checkout one files.
This more than likely off topic but might be valuable for other zeners with this type or similar applications that might be called by the checkout_process.php file.
Any help or direction would be greatly appreciated.
Frank
Frank, the checkout_process functionality is untouched by the One-Page Checkout's processing. There might be, however, some changes that your application introduced into the checkout_payment/confirmation processing that are not getting picked up.
Are there any observer-class (i.e. /includes/classes/observers) modules that "help" with the operation? Or any additional header_php_xxxx.php files present in the /includes/modules/pages/checkout_payment or /includes/modules/pages/checkout_confirmation folders?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Frank, the checkout_process functionality is untouched by the One-Page Checkout's processing. There might be, however, some changes that your application introduced into the checkout_payment/confirmation processing that are not getting picked up.
Are there any observer-class (i.e. /includes/classes/observers) modules that "help" with the operation? Or any additional header_php_xxxx.php files present in the /includes/modules/pages/checkout_payment or /includes/modules/pages/checkout_confirmation folders?
There aren't any additional header.php files or observers that I am aware of or can find but the vendor application does modify the checkout payment, process, shipping and confirmation pages. That should explain why the vendor application works with standard checkout process and not the one page checkout. I will try to merge these changes with the one page checkout files. I will let you know I make out.
Frank
Thanks for jogging my memory
-
Re: One-Page Checkout [Support Thread]
Darn it, another bug, this one occurs if the customer's applied a discount coupon to their order and then updated their shipping-method.
When that happens, a debug log similar to:
Code:
Call to a member function bindVars() on null in /dir_fs_catalog/classes/ajax/zcAjaxOnePageCheckout.php on line 34
gets generated.
The correction's simple: edit /includes/classes/ajax/zcAjaxOnePageCheckout.php (line 20), adding the $db to the list of globally-referenced variables:
Code:
// -----
// Since we're running as a function, need to declare the objects we're instantiating here, for use by the various classes
// involved in creating the order's total-block.
//
global $db, $order, $currencies, $checkout_one, $total_weight, $total_count, $discount_coupon;
global $shipping_weight, $uninsurable_value, $shipping_quoted, $shipping_num_boxes, $current_page_base, $current_page, $template;
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Darn it, another bug, this one occurs if the customer's applied a discount coupon to their order and then updated their shipping-method.
When that happens, a debug log similar to:
Code:
Call to a member function bindVars() on null in /dir_fs_catalog/classes/ajax/zcAjaxOnePageCheckout.php on line 34
gets generated.
The correction's simple: edit /includes/classes/ajax/zcAjaxOnePageCheckout.php (line 20), adding the $db to the list of globally-referenced variables:
Code:
// -----
// Since we're running as a function, need to declare the objects we're instantiating here, for use by the various classes
// involved in creating the order's total-block.
//
global $db, $order, $currencies, $checkout_one, $total_weight, $total_count, $discount_coupon;
global $shipping_weight, $uninsurable_value, $shipping_quoted, $shipping_num_boxes, $current_page_base, $current_page, $template;
Thank you Cindy, all noted and implemented :smile:
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
fjbern1943
There aren't any additional header.php files or observers that I am aware of or can find but the vendor application does modify the checkout payment, process, shipping and confirmation pages. That should explain why the vendor application works with standard checkout process and not the one page checkout. I will try to merge these changes with the one page checkout files. I will let you know I make out.
Frank
Thanks for jogging my memory
As far as I can see there is no file correlation between my vendor application and one-page checkout.
The below code is from my existing checkout_confirmation.php page. Please note the two instances of MVS Start and End code. I think that this is the code I need to add to the one-page checkout plugin.
Code:
<?php
/*
$Id$
$Loc: /catalog/ $
$Mod: MVS V1.3 Kymation $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2014 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
// MVS start
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);
// If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page
if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS
if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected
tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL'));
}
}
// MVS end
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($cart->count_contents() < 1) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
if ($cart->cartID != $cartID) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
}
// if no shipping method has been selected, redirect the customer to the shipping method selection page
if (!tep_session_is_registered('shipping')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
if (!tep_session_is_registered('payment')) tep_session_register('payment');
if (isset($_POST['payment'])) $payment = $_POST['payment'];
if (!tep_session_is_registered('comments')) tep_session_register('comments');
if (isset($_POST['comments']) && tep_not_null($_POST['comments'])) {
$comments = tep_db_prepare_input($_POST['comments']);
}
// load the selected payment module
require(DIR_WS_CLASSES . 'payment.php');
$payment_modules = new payment($payment);
require(DIR_WS_CLASSES . 'order.php');
$order = new order;
$payment_modules->update_status();
if ( ($payment_modules->selected_module != $payment) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
}
if (is_array($payment_modules->modules)) {
$payment_modules->pre_confirmation_check();
}
// load the selected shipping module
//MVS start
if (SELECT_VENDOR_SHIPPING == 'true') {
include_once (DIR_WS_CLASSES . 'vendor_shipping.php');
} else{
include_once (DIR_WS_CLASSES . 'shipping.php');
}
//MVS End
$shipping_modules = new shipping($shipping);
require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;
$order_total_modules->process();
// Stock Check
$any_out_of_stock = false;
if (STOCK_CHECK == 'true') {
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
$any_out_of_stock = true;
}
}
// Out of Stock
if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION);
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2);
require(DIR_WS_INCLUDES . 'template_top.php');
?>
<h1><?php echo HEADING_TITLE; ?></h1>
<?php
if ($messageStack->size('checkout_confirmation') > 0) {
echo $messageStack->output('checkout_confirmation');
}
if (isset($$payment->form_action_url)) {
$form_action_url = $$payment->form_action_url;
} else {
$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
}
echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');
?>
<div class="contentContainer">
<h2><?php echo HEADING_SHIPPING_INFORMATION; ?></h2>
<div class="contentText">
<table border="0" width="100%" cellspacing="1" cellpadding="2">
<tr>
<?php
if ($sendto != false) {
?>
<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo '<strong>' . HEADING_DELIVERY_ADDRESS . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
</tr>
<tr>
<td><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'); ?></td>
</tr>
<?php
if ($order->info['shipping_method']) {
?>
<tr>
<td><?php echo '<strong>' . HEADING_SHIPPING_METHOD . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
</tr>
<tr>
<td><?php echo $order->info['shipping_method']; ?></td>
</tr>
<?php
}
?>
</table></td>
<?php
}
?>
<td width="<?php echo (($sendto != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
if (sizeof($order->info['tax_groups']) > 1) {
?>
<tr>
<td colspan="2"><?php echo '<strong>' . HEADING_PRODUCTS . '</strong> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
<td align="right"><strong><?php echo HEADING_TAX; ?></strong></td>
<td align="right"><strong><?php echo HEADING_TOTAL; ?></strong></td>
</tr>
<?php
} else {
?>
<tr>
<td colspan="3"><?php echo '<strong>' . HEADING_PRODUCTS . '</strong> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
</tr>
<?php
}
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
echo ' <tr>' . "\n" .
' <td align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
' <td valign="top">' . $order->products[$i]['name'];
if (STOCK_CHECK == 'true') {
echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);
}
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
}
}
echo '</td>' . "\n";
if (sizeof($order->info['tax_groups']) > 1) echo ' <td valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
echo ' <td align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "\n" .
' </tr>' . "\n";
}
?>
</table></td>
</tr>
</table>
</div>
<h2><?php echo HEADING_BILLING_INFORMATION; ?></h2>
<div class="contentText">
<table border="0" width="100%" cellspacing="1" cellpadding="2">
<tr>
<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo '<strong>' . HEADING_BILLING_ADDRESS . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
</tr>
<tr>
<td><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br />'); ?></td>
</tr>
<tr>
<td><?php echo '<strong>' . HEADING_PAYMENT_METHOD . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
</tr>
<tr>
<td><?php echo $order->info['payment_method']; ?></td>
</tr>
</table></td>
<td width="70%" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="2">
<?php
if (MODULE_ORDER_TOTAL_INSTALLED) {
echo $order_total_modules->output();
}
?>
</table></td>
</tr>
</table>
</div>
<?php
if (is_array($payment_modules->modules)) {
if ($confirmation = $payment_modules->confirmation()) {
?>
<h2><?php echo HEADING_PAYMENT_INFORMATION; ?></h2>
<div class="contentText">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="4"><?php echo $confirmation['title']; ?></td>
</tr>
<?php
if (isset($confirmation['fields'])) {
for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td>
</tr>
<?php
}
}
?>
</table>
</div>
<?php
}
}
if (tep_not_null($order->info['comments'])) {
?>
<h2><?php echo '<strong>' . HEADING_ORDER_COMMENTS . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></h2>
<div class="contentText">
<?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?>
</div>
<?php
}
?>
<div class="contentText">
<div style="float: left; width: 60%; padding-top: 5px; padding-left: 15%;">
<div id="coProgressBar" style="height: 5px;"></div>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="center" width="33%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
<td align="center" width="33%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td>
<td align="center" width="33%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
</tr>
</table>
</div>
<div style="float: right;">
<?php
if (is_array($payment_modules->modules)) {
echo $payment_modules->process_button();
}
echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary');
?>
</div>
</div>
</div>
<script type="text/javascript">
$('#coProgressBar').progressbar({
value: 100
});
</script>
</form>
<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
It looks like the I need to modify the modules/pages/checkout_confirmation/header_php.php file to incorporate these changes.
Am I on the right track? Can you help me in making these changes?
Thanks,
Frank
-
Re: One-Page Checkout [Support Thread]
Frank, just so I understand ... you've got an application that runs separately from the "normal" storefront, i.e. you access that application as https://www.example.com/application_name.php (where the application_name.php file is in the root directory of your store)?
-
Re: One-Page Checkout [Support Thread]
Hello Again, Thanks for the response.
The answer to your question is NO. In addition to the core files for this application there are also over writes of some of the store standard files.
The way this works is after the order is confirmed the order information is stored in the database in the normal manner but also stored as an order associated with a particular vendor.
Then the admin can access the order and the associated vendor order and is shown as an order associated with a particular vendor. At that point you can elect to have the vendor order sent automatically or manually to the vendor via email with a copy of the packing slip.
The only part of the application, that I can tell, that is not being passed by one-page checkout is the MVS stuff (Vendor Shipping) in the file above.
So I think that if there is no vendor shipping associated with the order then the application does not recognize it as vendor order. Just a presumption on my part since I did not write the application, done by third party, which I believe was a modification and ##############ization of the old zencart plugin, MVS with PDF.
I hope that explains things a little. If you need any additional information, please let me know.
Frank
-
Re: One-Page Checkout [Support Thread]
@fjbern1943, I'm still not getting it. Is this "application" something that gets invoked by your Zen Cart's admin-console after the customer has placed the order?
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
@fjbern1943, I'm still not getting it. Is this "application" something that gets invoked by your Zen Cart's admin-console after the customer has placed the order?
Hello,
Every product is associated with a particular vendor. When a customer orders a product the information is not only registered in the database as an order in the regular way but is also associated with that particular vendor. After the order and vendor information is written to the database in the backend the order with packing slip is sent to the vendor again either automatically or by sending it manually in the admin by pushing a button.. This can be set in the vendor setup. Everything is drop shipped by the vendor, I do not normally carry any inventory.
This allows me to automate the ordering process with my vendors. Otherwise, I would have to send them an order by email manually. This was setup with the expectation that there would be a lot of orders to enter daily. I hope this helps to clarify what the application does and how it is used.
Frank
-
Re: One-Page Checkout [Support Thread]
Frank, since the code you posted in post#55 starts by loading application_top.php and ends by loading application_bottom.php, I've got to assume that the script either runs under the admin or is stand-alone running from the root of your store-front.
The only thing that I can think of that might work is for that script to have its own auto-load "prefix" so that the one-page checkout doesn't interfere with that after-order script.
First, copy the file /includes/auto_loaders/config.core.php to a file named mvs.core.php in the same folder. Next, modify that script you posted, adding the following statement just prior to the require for the application_top.php script:
Code:
$loaderPrefix = 'mvs';
That will result in that script processing like the one-page checkout wasn't in the picture since its observer won't be loaded due to the change in that loader-prefix value.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Frank, since the code you posted in post#55 starts by loading application_top.php and ends by loading application_bottom.php, I've got to assume that the script either runs under the admin or is stand-alone running from the root of your store-front.
The only thing that I can think of that might work is for that script to have its own auto-load "prefix" so that the one-page checkout doesn't interfere with that after-order script.
First, copy the file /includes/auto_loaders/config.core.php to a file named mvs.core.php in the same folder. Next, modify that script you posted, adding the following statement just prior to the require for the application_top.php script:
Code:
$loaderPrefix = 'mvs';
That will result in that script processing like the one-page checkout wasn't in the picture since its observer won't be loaded due to the change in that loader-prefix value.
Hello,
First let me thank you very much, especially since this is away off topic for this thread.
I will give this a try and see how I make out. Seems like a very reasonable approach.
Frank
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
fjbern1943
Hello,
First let me thank you very much, especially since this is away off topic for this thread.
I will give this a try and see how I make out. Seems like a very reasonable approach.
Frank
OK it didn't work. It produces an error:
Code:
[11-Aug-2016 15:36:31 America/Chicago] PHP Warning: Invalid argument supplied for foreach() in /hsphere/local/home/religiousshop/religious-shop.com/includes/classes/order.php on line 713
Here is Line 712 to 719 in order.php:
Code:
712 $shipping_array = $_SESSION['cart']->vendor_shipping;
713 foreach ($shipping_array as $vendors_id => $shipping_data) {
714 $vendors = $db->Execute("select vendors_name from " . TABLE_VENDORS . " where vendors_id = '" . (int)$vendors_id . "'");
715 $vendors_name = 'Unknown';
716 if ($vendors) {
717 $vendors_name = $vendors->fields['vendors_name'];
718 }
719 $shipping_method_array = explode ('_', $shipping_data['id']);
What do you think?
Frank
-
Re: One-Page Checkout [Support Thread]
Frank, I was thinking last night that there's a better way ... and there is.
Rather than going down the config.core.php replacement, simply place the following define statement just before your script loads application_top.php:
Code:
define ('CHECKOUT_ONE_ENABLED', 'false');
That definition will "preempt" the database setting and will allow your script to run in "normal" checkout mode regardless the configuration of the One-Page Checkout plugin.
-
Re: One-Page Checkout [Support Thread]
v1.0.1 is now available for download from the Zen Cart plugins. There are a couple of issues (identified in postings above) that are targeted for a v1.0.2 release, which will most likely happen within the next week.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Frank, I was thinking last night that there's a better way ... and there is.
Rather than going down the config.core.php replacement, simply place the following define statement just before your script loads application_top.php:
Code:
define ('CHECKOUT_ONE_ENABLED', 'false');
That definition will "preempt" the database setting and will allow your script to run in "normal" checkout mode regardless the configuration of the One-Page Checkout plugin.
Hello,
Well it took all my brainpower and a very long investigation to figure this out. The file we were looking at in post #55 had absolutely nothing to do with my MVS/Vendor plugin. It was to be used if you wanted to charge freight, not per order but by vendor. In other words if an order went to two different vendors that file would have been used to charge the customer multiple shipping charges. When I was working with the plugin developer I had them change the way the plugin work so that the customer was only charged for one freight charge. Unfortunately they left that file in the distribution but it didn't do anything. The more I looked at the file the more I realized that it made no sense. I removed it from the server and placed an order using the standard multi form check out and the order was processed and the vendor information was posted and vendor email was sent.. Just as it was suppose to, even though that file was removed.
I placed another order using the on-page checkout and it processed the order but it did not produce any vendor information or vendor email.
I looked at the standard modules/pages/header_php.php pages and compared them to modules/pages/checkout_one/header_php.php file.
I ended up adding this code:
$vendor_shipping = $_SESSION['cart']->vendor_shipping(); to the confirmation_one/header_php.php page code, and then ran another test order and guess what it all worked. Problem solved. Sorry for being so winded but I wanted you to know the full story
I want to thank you for all your assistance and certainly going the extra mile to help out a fellow zenner.
P.S. Don't think abut this tonight put your valuable talents to work on something really worth while. Suggestion, a new COWA plugin to go along with the one-page checkout. :-)
-
Re: One-Page Checkout [Support Thread]
A couple more bugfixes have been posted to the plugin's GitHub repository:
Need to move the customers_auth check to after we know the customer's logged in (there were PHP Notify errors being recorded). Change needed to /includes/modules/pages/checkout_one/header_php.php to move that checking block. Currently:
Code:
// -----
// If the plugin's debug-mode is set to "full", then enable ALL error reporting for the checkout_one page.
//
if (CHECKOUT_ONE_DEBUG == 'full') {
@ini_set('error_reporting', -1 );
}
// -----
// In the "normal" Zen Cart checkout flow, the module /includes/init_includes/init_customer_auth.php performs the
// following check to see that the customer is authorized to checkout. Rather than changing the code in that
// core-file, we'll repeat that check here.
//
if ($_SESSION['customers_authorization'] != 0) {
$messageStack->add_session ('header', TEXT_AUTHORIZATION_PENDING_CHECKOUT, 'caution');
zen_redirect (zen_href_link (FILENAME_DEFAULT));
}
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
zen_redirect (zen_href_link (FILENAME_SHOPPING_CART, '', 'NONSSL'));
}
// if the customer is not logged on, redirect them to the login page
if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
$_SESSION['navigation']->set_snapshot();
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
} else {
// validate customer
if (zen_get_customer_validate_session ($_SESSION['customer_id']) == false) {
$_SESSION['navigation']->set_snapshot (array ('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_ONEPAGE));
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
}
}
to
Code:
// -----
// If the plugin's debug-mode is set to "full", then enable ALL error reporting for the checkout_one page.
//
if (CHECKOUT_ONE_DEBUG == 'full') {
@ini_set('error_reporting', -1 );
}
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
zen_redirect (zen_href_link (FILENAME_SHOPPING_CART, '', 'NONSSL'));
}
// if the customer is not logged on, redirect them to the login page
if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
$_SESSION['navigation']->set_snapshot();
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
} else {
// validate customer
if (zen_get_customer_validate_session ($_SESSION['customer_id']) == false) {
$_SESSION['navigation']->set_snapshot (array ('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_ONEPAGE));
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
}
}
// -----
// In the "normal" Zen Cart checkout flow, the module /includes/init_includes/init_customer_auth.php performs the
// following check to see that the customer is authorized to checkout. Rather than changing the code in that
// core-file, we'll repeat that check here.
//
if ($_SESSION['customers_authorization'] != 0) {
$messageStack->add_session ('header', TEXT_AUTHORIZATION_PENDING_CHECKOUT, 'caution');
zen_redirect (zen_href_link (FILENAME_DEFAULT));
}
... essentially, moving that customers_authorization check to after we know the customer's logged in.
I'll identify the other issue in a follow-on post.
-
Re: One-Page Checkout [Support Thread]
Here's the other one:
The "collectsCardDataOnsite" interface changed between Zen Cart 1.5.4 and 1.5.5 and the plugin's using the 1.5.4 version (which was used to verify the authorizenet_aim payment method). Need to update /includes/modules/pages/checkout_one/jscript_main.php to include the ZC 1.5.5 version of the interface as well.
To correct, add the highlighted code sections:
Code:
function shippingIsBilling ()
{
var shippingAddress = document.getElementById ('checkoutOneShipto');
if (shippingAddress) {
if (document.getElementById ('shipping_billing').checked) {
shippingAddress.className = 'hiddenField';
shippingAddress.setAttribute ('className', 'hiddenField');
} else {
shippingAddress.className = 'visibleField';
shippingAddress.setAttribute ('className', 'visibleField');
}
}
}
<?php
// -----
// The "collectsCartDataOnsite" interface built into Zen Cart magically transformed between
// Zen Cart 1.5.4 and 1.5.5, so this module for the One-Page Checkout plugin includes both
// forms. That way, if a payment module was written for 1.5.4 it'll work, ditto for those
// written for the 1.5.5 method.
//
?>
function collectsCardDataOnsite(paymentValue)
{
zcJS.ajax({
url: "ajax.php?act=ajaxPayment&method=doesCollectsCardDataOnsite",
data: {paymentValue: paymentValue}
}).done(function( response ) {
if (response.data == true) {
var str = $('form[name="checkout_payment"]').serializeArray();
zcJS.ajax({
url: "ajax.php?act=ajaxPayment&method=prepareConfirmation",
data: str
}).done(function( response ) {
$('#checkoutPayment').hide();
$('#navBreadCrumb').html(response.breadCrumbHtml);
$('#checkoutPayment').before(response.confirmationHtml);
$(document).attr('title', response.pageTitle);
});
} else {
zcLog2Console ('collectsCartDataOnsite: submitting form');
$('form[name="checkout_payment"]')[0].submit();
}
});
return false;
}
function doesCollectsCardDataOnsite(paymentValue)
{
if ($('#'+paymentValue+'_collects_onsite').val()) {
if ($('#pmt-'+paymentValue).is(':checked')) {
return true;
}
}
return false;
}
function doCollectsCardDataOnsite(paymentValue)
{
var str = $('form[name="checkout_payment"]').serializeArray();
zcJS.ajax({
url: "ajax.php?act=ajaxPayment&method=prepareConfirmation",
data: str
}).done(function( response ) {
$('#checkoutPayment').hide();
$('#navBreadCrumb').html(response.breadCrumbHtml);
$('#checkoutPayment').before(response.confirmationHtml);
$(document).attr('title', response.pageTitle);
});
}
-
Re: One-Page Checkout [Support Thread]
I've just submitted v1.0.2 to the plugins' area for review (if you can't wait, you can download it from either the plugin's GitHub repository or my website).
This version provides changes to address the following issues (as identified by their issue numbers in the plugin's GitHub repository):
#13: Form won't submit under IE-11
#14: Pre-integration with "Product Delivery by Postcode (PDP)"
#17: Missing semi-colon in language file
#18: Error-log generated when the customer has applied a discount coupon
#19: Move customer's authorization check
#20: Include both ZC1.5.4 and 1.5.5 versions of "handlesCreditCardDataOnSite"
#21: Correct interoperation with some shipping methods
#22: Correct AJAX session-save issue
#23: Session time-out handling
#24: Display payment-method block when in "special checkout"
-
Re: One-Page Checkout [Support Thread]
I am using v1.5.4 and template 'Tableau'
Do I have to have FEC installed as well? nothing seems to work correctly;
Reading through the install instructions 'D. Click the "Admin Home" link in your Zen Cart's top admin menu. This action will cause the plugin's installation script to run.' For me this does not happen.
When I go to checkout all the boxes and format is missing.
I have been trying to give you a picture of what is happening but I cannot remember how to get the page in to a displayable picture, sorry.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
adb34
I am using v1.5.4 and template 'Tableau'
Do I have to have FEC installed as well? nothing seems to work correctly;
Reading through the install instructions 'D. Click the "Admin Home" link in your Zen Cart's top admin menu. This action will cause the plugin's installation script to run.' For me this does not happen.
When I go to checkout all the boxes and format is missing.
I have been trying to give you a picture of what is happening but I cannot remember how to get the page in to a displayable picture, sorry.
You absolutely, positively don't want to have FEC installed to use the One-Page Checkout! That would actually be a disaster waiting to happen.
Once you've copied the plugin's files to your store, changing the YOUR_ADMIN and YOUR_TEMPLATE names appropriately, that click on "Admin Home" installs the plugin's configuration information into the database. Now, go to Configuration->One-Page Checkout Settings and enable the plugin.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
You absolutely, positively don't want to have FEC installed to use the One-Page Checkout! That would actually be a disaster waiting to happen.....
And a BIG nod from me - this plugin is the best thing since sliced bread was invented. FEC is definitely not needed at all - and, yes, it would be a disaster waiting to happen......
Since I installed this plugin, sales have increased considerably, even had comments from long-standing clients/customers that their checkout experience is so much easier. And since making my favorite payment modules eWay a default selected, it's thumbs up all round.
-
Re: One-Page Checkout [Support Thread]
Thanks for your kind words, @frank18!
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
You absolutely, positively don't want to have FEC installed to use the One-Page Checkout! That would actually be a disaster waiting to happen.
Once you've copied the plugin's files to your store, changing the YOUR_ADMIN and YOUR_TEMPLATE names appropriately, that click on "Admin Home" installs the plugin's configuration information into the database. Now, go to Configuration->One-Page Checkout Settings and enable the plugin.
I would love to find out what is happening. I have done all the changes; merges; uploads; Enabled, still looking a mess. I have also uploaded the v1.5.4 put of your plugin. I am wondering if this plugin will not work with 'Tableau' template? I know this template does not like v1.5.5/a. I will try to get you an image of the screen so that you will see what I am on about, but until then.
Question: At part "D. Click the "Admin Home" link in your Zen Cart's top admin menu. This action will cause the plugin's installation script to run." when I login to the backoffice, what should expect to see? should there be a log file?
-
Re: One-Page Checkout [Support Thread]
You might have some other checkout-related observers installed that are "not helping". Please list the files you've got in your store's /includes/classes/observers folder.
Once you've uploaded the files to your store's file-system and click that "Admin Home" button, you will see the Admin->Configuration->One-Page Checkout Settings menu item which, when clicked, shows you the plugin's current settings. No message is issued.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
You might have some other checkout-related observers installed that are "not helping". Please list the files you've got in your store's /includes/classes/observers folder.
Once you've uploaded the files to your store's file-system and click that "Admin Home" button, you will see the Admin->Configuration->One-Page Checkout Settings menu item which, when clicked, shows you the plugin's current settings. No message is issued.
One-Page Checkout Setting
Version/Release Date 1.0.1 (2016-08-06)
Enable One-Page Checkout? True
Enable One-Page Checkout debug? False
Debug: Customer List Nothing showing
-
Re: One-Page Checkout [Support Thread]
OK, so you got the plugin installed and enabled. What about the file-list in your store's /includes/classes/observers folder?
If you have this installed on an accessible server (i.e. not a local test setup), you could PM me the link so that I can see for myself what's going on.
-
1 Attachment(s)
Re: One-Page Checkout [Support Thread]
I have managed to get a screen shot of my challenge
Attachment 16611
I have been going through the merged files again, but nothing is standing out as a problem
-
Re: One-Page Checkout [Support Thread]
Did you copy the checkout_one.css file to your template's /css folder?
If this isn't a local installation, would you send me a PM with the site's link so that I can see what's going on myself?
-
Re: One-Page Checkout [Support Thread]
I have run the debug 'true' and 'full'. these file a massive 'true' @ just over 64k and full @ 154k. How can I show them without filling every bodies screen?
-
Re: One-Page Checkout [Support Thread]
@adb34, I don't think that the debug file is going to show me anything. As I asked before, do you have a publicly-accessible link for the site? If so, please send it to me via PM.
-
Re: One-Page Checkout [Support Thread]
@adb34, got your PM. The Tableau template makes a ton of changes to the Zen-Cart standard CSS; for example it's not including the stylesheet_css_buttons.css so that your buttons display wonky and there are many other as-shipped Zen Cart CSS selectors that aren't included.
That's why the page looks so disorganized, since the One-Page Checkout plugin was designed/tested using templates that conform to the ZC standard.
I don't have free time to debug/determine what changes will be needed for that template to properly support this plugin. I will update the plugin's readme to add a section identifying templates that aren't supported -- Tableau will be noted along with the TM ones.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
@adb34, got your PM. The Tableau template makes a ton of changes to the Zen-Cart standard CSS; for example it's not including the stylesheet_css_buttons.css so that your buttons display wonky and there are many other as-shipped Zen Cart CSS selectors that aren't included.
That's why the page looks so disorganized, since the One-Page Checkout plugin was designed/tested using templates that conform to the ZC standard.
I don't have free time to debug/determine what changes will be needed for that template to properly support this plugin. I will update the plugin's readme to add a section identifying templates that aren't supported -- Tableau will be noted along with the TM ones.
Thanks mate. I did think it was me, but when I had a play it was all leading to the template. I have also removed you as a customer. Thanks for your time.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
I've just submitted v1.0.2 to the plugins' area for review (if you can't wait, you can download it from either the plugin's
GitHub repository or my website).
This version provides changes to address the following issues (as identified by their issue numbers in the plugin's GitHub repository):
#13: Form won't submit under IE-11
#14: Pre-integration with "Product Delivery by Postcode (PDP)"
#17: Missing semi-colon in language file
#18: Error-log generated when the customer has applied a discount coupon
#19: Move customer's authorization check
#20: Include both ZC1.5.4 and 1.5.5 versions of "handlesCreditCardDataOnSite"
#21: Correct interoperation with some shipping methods
#22: Correct AJAX session-save issue
#23: Session time-out handling
#24: Display payment-method block when in "special checkout"
v1.0.2 is now available for download from the Zen Cart Plugins area.
-
Re: One-Page Checkout [Support Thread]
Had some difficulty with v 1.0.2 on my WAMP test site, zc 1.5.5a, updated Responsive Sheffield Blue, Canada Post only shipping mod
Am I correct that the ajax.php file should be in the pre-1.5.5 folder rather than in the root (ie not to be merged in 1.5.5.a install)?
Also, includes/temp/temp_default/temp/tpl_checkout_one_confirmation_default, around line #189:
Code:
echo zen_draw_form ('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation"' . ($confirmation_required) ? ' onsubmit="submitonce();"' : '');
Should that be 'confirmation_one' rather than 'checkout_confirmation'.
If I leave ajax.php alone, and change the 'checkout_confirmation' then I am able to proceed with a transaction as far as I can with a test store and fake customer and no curl for paypal - which is to say I get a paypal error message on top of the one page checkout, and I get an email from admin notifying me of the error.
Without the above changes when I click checkout I get a death spiral of the loading gif ;o) (I tried to attach log of this in code quote but it seems to be too big as it won't send).
(I acknowledge Canada Post isn't in the list of validated shipping for this mod, but it 'seems' to work with the fiddling above, test site only, although it does select most expensive CP shipping choice by default)
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
v1.0.2 is now available for download from the Zen Cart Plugins area.
The new one to download, is that the one dated 19th August dated 9 days before your post?
-
Re: One-Page Checkout [Support Thread]
@soxophonplayer: The core-file /ajax.php is a required change to ensure that any session-related changes are saved, as is the change to the checkout_one_confirmation page's form name (for compatability with some payment methods).
What payment method were you using when you encountered the "spiral of death"?
I've sent you a PM with my direct email address so you can send that log file over.
@adb34: That's the date I submitted v1.0.2 to the plugins!
-
Re: One-Page Checkout [Support Thread]
@soxophoneplayer: In reviewing the change-list for v1.0.2, I've found that the readme neglected to identify the following changes introduced in the v1.0.1->v1.0.2 transition:
- /includes/modules/pages/checkout_one_confirmation/jscript_main.php
- /includes/templates/template_default/templates/tpl_checkout_one_confirmation_default.php
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
@soxophoneplayer: In reviewing the change-list for v1.0.2, I've found that the readme neglected to identify the following changes introduced in the v1.0.1->v1.0.2 transition:
- /includes/modules/pages/checkout_one_confirmation/jscript_main.php
- /includes/templates/template_default/templates/tpl_checkout_one_confirmation_default.php
OK that gets it sorted. I had a bit in jscript_main that also had 'checkout_one' in place of 'checkout_confirmation' which explains the death spiral that occured when I merged tpl_checkout_one_confirmation but not the jscript_main.
Tested several times. Life is good.
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
soxophoneplayer
OK that gets it sorted. I had a bit in jscript_main that also had 'checkout_one' in place of 'checkout_confirmation' which explains the death spiral that occured when I merged tpl_checkout_one_confirmation but not the jscript_main.
Tested several times. Life is good.
Great, thanks for posting back.
May I ask what modifications you've needed to make to the template files? I've tried real hard to get those into a shape so that they're usable as-is so that upgrades (especially during these early days) are simple drop-ins (i.e. total file replacement).
-
Re: One-Page Checkout [Support Thread]
Quote:
Originally Posted by
lat9
Great, thanks for posting back.
May I ask what modifications you've needed to make to the template files? I've tried real hard to get those into a shape so that they're usable as-is so that upgrades (especially during these early days) are simple drop-ins (i.e. total file replacement).
None of the template files needed merging with my Responsive Sheffield Blue 2.0 files. I left the 3 template default files that required merging in /template default.
I made small change of wording in includes/lang/eng/checkout_one define:text_enter_shipping_info. I use only one shipper - Canada Post - and they have several options - so existing mod text 'you have only one method available (sic) could be unclear to the reader.
I use only paypal (until Square Regiter mod is developed) and I don't particularly like the paypal img because it implies it can be clicked (while the actual click to confirm button is lower down and off initial screen view. I don't actually see that img in your files so I presume it is paypal driven.
Big bonus of Responsive Sheffield Blue users is that the buttons in One Page Checkout are dead on.
I tested the mod on my iphone 6s+ and it looks/works fine in portrait and landscape.
-
Re: One-Page Checkout [Support Thread]
Working my way through an authorizenet_aim issue that was working correctly on Zen Cart 1.5.4 but not on 1.5.5a, I've discovered an issue with the ZC 1.5.5a payment class that will necessitate yet another update to One-Page Checkout.
I'll post back here when I've got v1.0.3 available with those changes.
-
Re: One-Page Checkout [Support Thread]
I'm looking to use this on a rebuild from an old, old version that has been using FEC and COWOA. We use the Ceon Advanced Shipper module which is set up to use USPS, FedEx and UPS. I am assuming that it should work without any issues but has anyone tried AS with this mod yet?
-
Re: One-Page Checkout [Support Thread]
Just installed this addon for my 1.5.5a upgrade test install. My old installs used FEC, but now I attempting to use COWOA in conjunction with One-Page-Checkout.
Everything looks to be working fine except the shipping selection radio buttons do not trigger the shipping method to change in the shopping cart contents box below.
Am I missing a javascript file? Or more likely, is there perhaps an old file or file mod carried over from an old 1.3.9 installation (with FEC) that is interfering with this action (i thought i had taken care of all those)?
Any help or pointing in the right direction is appreciated.
(btw, this mod is exactly what I have been looking for! Thanks!)
-
Re: One-Page Checkout [Support Thread]
@lankeeyankee: I haven't encountered a site that uses Ceon Advanced Shipper, so I can't answer ... hoping that somebody out there has access to that plugin and can chime in.
@LightBrown: Is your installation on a publically-available site? If so, either PM the site link to me or post it here (if you don't want the site to be found by search engines, identify it as www.mysite(dot)com. What template are you using?
-
Re: One-Page Checkout [Support Thread]
@LightBrown, your template doesn't include the jscript_framework.php file in the template's /jscript folder, so the AJAX requests are not being issued.
-
Re: One-Page Checkout [Support Thread]
I tried adding the jscript_framework.php file to my template /jscript folder, and it is still not adding the shipping method to the total. Is there something else with my theme or another addon that could be blocking that AJAX request? Could there be another jscript file that is blocking or overriding the jscript_framework.php?
Thanks!
-
Re: One-Page Checkout [Support Thread]
My bad; your site is also not loading any form of jQuery.
-
Re: One-Page Checkout [Support Thread]
If I am reading the inspector correctly, it seems like jquery is loading on most other pages, but not loading on the checkout_one page.
-
Re: One-Page Checkout [Support Thread]
You're right, I see a version of jQuery loading ... but jQuery 1.2.2 isn't going to work. I've tested the plugin with jQuery 1.8.2 and 1.11.2; you'll need to update your version of jQuery as well.
-
Re: One-Page Checkout [Support Thread]
alright, so I updated jquery to the latest 1.x version (1.12.4), and the issue still persists. I know it just has to be something dumb that I am missing, and I am sorry for asking so many questions...
I just hardly understand javascript at all. And all the other js functions on the site and even the checkout_one page seem to work, like the shippingIsBilling checkbox (even though it is hidden by the css for whatever reason).
-
Re: One-Page Checkout [Support Thread]
I've just submitted v1.0.3 to the Plugins section for review. That version includes the following changes
- Disable plugin if jscript_framework.php isn't present in the active template.
- Update documentation to identify template-specific requirements.
- Some shipping methods require additional time; new configuration setting added.
- Correct interlock for shipping methods that require "extra" information
- Update readme/configuration to v1.0.3
- ZC1.5.5, correct "collectsCardDataOnsite" payment processing
- ZC1.5.4, correct jQuery error when the payment method "collectsCardDataOnsite"
- Update documentation to identify templates known to have compatibility issues.