Mike, you identified which credit-cart type is causing the issue but you haven't identified the payment method that is being used when the issue surfaces.
Are there any debug-logs created when the Visa-type card is rejected by that payment method?
Printable View
Hi Cindy - payment method is Guest Checkout, Credit Card, when the error occurs. There aren't any error logs generated. Same credit card works fine with standard inbuilt checkout and when checkout with PayPal is selected with either inbuilt or Guest.
I only have PayPal active as the payment gateway - I do not use any other providers.
cheers,
Mike
p.s. altering that code fixed the error logs - thanks :)
Mike, which PayPal version are you using, e.g. paypalwpp (Express Checkout) or paypaldp (Payments Pro)? At what point in the checkout process does the message appear?
Hi Cindy, short answer is Payments Pro (Canada - suggested by PayPal) - both Express Checkout and Payments Pro are enabled - as far as I am aware Express is required to be enabled for Pro to be activated - Payments Pro is required for OPC, Express is used for 'checkout with PayPal' in standard inbuilt process - right?.
The error occurs using the credit card payment option in Guest Checkout at the very last stage when 'confirm order' is pressed.
The PayPal settings are exactly the same (copied DB) in the problematic new build site (dazzlersharmonynecklace.com) as in the existing 1.5.5f site (harmonyballpendant.com) where everything there works fine - the only differences between the two is the domain name and that the new build is 1.5.6b
The new build site (it is a 're-branded clone' of harmonyballpendant.com) is live with robots.txt set to Disallow: / .... until guest checkout is sorted (and HBP not yet redirected)
Would it be helpful if I enable OPC error logs and try another transaction and send you the log?
cheers,
Mike
Mike, let's start by getting any/all PHP Notices that are generated when the issue occurs. How about you start by installing Report All Errors (https://www.zen-cart.com/downloads.p...file&id=1792)?
That plugin will overwrite the store's /includes/extra_configures/enable_error_logging.php to give a bit of control over the logging of those notices. Upon installation, there will be additional settings in Configuration->Logging. Set Report All Errors (storefront) to IgnoreDups and Backtrace on Notice Errors to true.
Once installed and configured, go through the OPC process to the point/page where the issue raises itself, grab a copy of the myDEBUG*.log generated at that time and send it on over.
Hello there,
I think I have an unrelated payment issue with credit cards by having this file present:-
jscript_framework.php
Before installing my template did not have this file (customised store). But it wouldn't let me install without this file present. I think it is CSS Loader or similar setup causing a clash.
I realised from a failed checkout tonight that there was a problem and from testing I narrowed it down to this file.
I don't suppose there is also a log of the customer email (I think it was a guest checkout) so I can email them to offer them apology and coupon.
Thanks in advance, again I think this is more to do with my setup and this requred file clashing with something.
@HeathenMagic, you can safely copy the like-named file from Zen Cart's zc157 branch (see https://github.com/zencart/zencart/t...efault/jscript) to /includes/templates/YOUR_TEMPLATE/jscript/jscript_framework.php to see if that helps.
Thanks for that. I did a winmerge and it looks the same content, but I realise I have this file in temlate_default. I get the message that the onepagecheckout disables without this in my custom template so maybe this module is not compatible with my setup (due to CSS Loader no doubt). If I put back in custom template folder it stops credit card payments working (payflow UK).
@HeathenMagic, where did that 'titanium' template come from?
I bought from Zucando, although I am looking to buy a Bootstrap 4 theme, but no joy so far. This template I use at the moment is CSS Loader
How can I merge the registration page into a one-page payment?
Yes,Can that be like that?
Registration page, shipping page, credit card page, confirmation order page are merged into one page.
I must have gotten up this morning with a case of dumbass because the install instructions are not making sense regardless of how many times I read them.
Vanilla install in sandbox. drop tables. import live db backup into sandbox. rerun zc_install?
Which set of 'includes' files are used for a 156b install.
Only the ones in the zc156b folder or both folders worth of includes files?
How bad am I over thinking this?
Nope, they're confusing (not intentionally), but for zc156b and later the only additional change that needs to be made is to your active template's tpl_header.php, as identified in these online instructions (https://lat9.github.io/one_page_chec..._or_later.html).
Other than that change, the only in-distribution changes for OPC v2.1.2 are those 3 language file's template overrides. All the other files in the plugin's zip-file are specific to OPC (no more core file overwrites!).
Sorry, I'm still confused.
There are 3 separate/different 'includes' folders in the distribution and I want to make sure that I use the correct folder for the specific edits required.
So since this is an initial install on 156b, I use the unlabeled 'includes' folder and ignore the zc155f and zc156b 'includes' folders because the specific labeled 'includes' folders are ONLY used for upgrading OPC from a previous version TO the specific labeled OPC 'includes' folder?
I don't mean to be a PIA but the zc156 upgrade process has been the most confusing in my past 10 years of use and I don't want to get 2 weeks into the upgrade to find out that on day 1 the wrong file was used and require a complete do-over.
Thank you Cindy
Looking in zc156b responsive_classic and my clone of responsive_classic
zc156b\includes\templates\responsive_classic\common\tpl_header.php
has already been changed in the distribution files toCode:if ($_SESSION['customer_id']) {
Code:if (zen_is_logged_in() && !zen_in_guest_checkout()) {
Cindy, on a fresh 1.5.6b install I have loaded the files in the separate 1.5.6b directory as well - so what do I need to do to correct that apparent error? - delete all files uploaded from that directory and then reload the corresponding files in the unlabeled directory? ... anything else? Would that have anything to do with the warning I am getting "not recognizing the credit card'?
Did you receive the error log files I emailed?
cheers,
Mike
Thanks for that reminder, Rick ... that's (additional) good news for a fresh zc156b install with a fresh clone of the responsive_classic template! That change still applies to sites that are dragging their previous template along.
Mike, that shouldn't be a problem, since the files in the 156b sub-directory are from the zc156 distribution just bringing zc156/zc156a up to the zc156b level.
Yes, I reviewed those logs; check your email for my response.
I've created a GitHub issue (https://github.com/lat9/one_page_checkout/issues/203) to track the changes for this unwanted behavior, which affects all payment methods that 'collect credit cart information on-site'.
The jist is that for this processing, the call to the zcAjaxPayment processing to initiate that confirmation sends back some jQuery to be run at document ready. The OPC AJAX was being too quick with its form-submission so that the payment-method processing wasn't being run.
The correction is to (a) ensure that the payment methods' jQuery runs on the ajaxComplete event and (b) stage OPC's form-submittal to the end of the ajaxComplete event.
OPC 2.1.1 installed in zc 156b
Not losing any sleep here because still playing in the sandbox.
Guest checkout
Item purchased: FREE downloadable file
Step through checkout with email address, phone, etc.
Payment selection is a bit confusing showing credit cards and a line for free order but no radio button.
Attachment 18524
Complete the checkout process.
Success screen as expected for a normal checkout with a link to the downloadable file(s) which functions as expected.
The comment about
is on the screen. That is really an impossibility, isn't it?Quote:
If the checkout success screen is exited without paying attention to the link, how does a customer get to the download file at a later date?
I think this might be a 'haven't thought about that moment' or a Rick forgot to take his nap moment.
If the customer checked out as a guest, they can access their download via the orders_status page. I'll see what's going on with the scenario you posed (i.e. a checkout with a free download) later today.
When I checked-out a Sample of Document Product Type using Guest Checkout, the text on the checkout_success page reads:
That text is defined in /includes/languages/english/checkout_success_guest.php (or overridden in YOUR_TEMPLATE) and is displayed by the tpl_checkout_success_guest.php file, present in /template_default but possibly overridden by YOUR_TEMPLATE.Code:You can view the status of this order by going to the Order Status page and supplying this order number and your email address.
Please direct any questions to customer service.
I've just submitted v2.1.2 to the Zen Cart moderators for review and will post back when it's available for download.
This release contains changes associated with the following GitHub issues:
#201: Virtual orders can't be checked out; correct the root-cause, not the symptom.
#202: Correct PHP Notice on checkout_success after guest-checkout.
#203: Correct integration with payment methods that "collect credit-card data onsite".
Thanks Cindy,
I did find the new checkout success page for guest.
I've never seen a link to an order status page anywhere other than on the checkout success page which makes it difficult later. Maybe there's a link in the email confirmation. Regardless, I'm sorry to stir the nest with questions that I could have/should have answered myself.
OPC comes with an 'Orders Status' sidebox which not-logged-in customers can use to lookup their previous orders. The text associated with 'where to find my order's history' is also slightly modified for guest-checkout, pointing them to the orders_status page rather than to their (non-existing) account!
TNX again Cindy
I'll have a look at the OPC docs to figure out the where and how to enable that sidebox (or what I did wrong).
Have a good 4th
The trifocals are blurry at this hour. I've gone over and over a new install on 1.5.5f. Followed the instructions for first time on 1.5.5f and get partial main page load with the changes to includes/templates/YOUR_TEMPLATE/common/tpl_header.phpGet the same with Guest turned on or off.Code:[05-Jul-2019 09:55:50 UTC] PHP Fatal error: Call to undefined function zen_is_logged_in() in /home/******/public_html/includes/templates/sepia/common/tpl_header.php on line 132
[05-Jul-2019 09:55:50 UTC] Request URI: /index.php?main_page=index, IP address: 216.177.186.199
--> PHP Fatal error: Call to undefined function zen_is_logged_in() in /home/******/public_html/includes/templates/sepia/common/tpl_header.php on line 132.
:sleepy:
Newest from GitHub BTW
You're right (I hope you didn't look for too long); there's an order_status page that should have a link in the site's information sidebox.
I'll update OPC's documentation to indicate that a template-override is required for /includes/modules/sidebox/information.php, adding that link. Unfortunately, it appears that I 'lost' that Orders' Status sidebox link name somewhere along the way, so the quick fix is to modify your template's copy of that sidebox, e.g. /includes/modules/sidebox/MY_TEMPLATE/information.php to read:
... and I'll get that constant added to the OPC distribution and update the documentation accordingly!Code:<?php
/**
* information sidebox - displays list of general info links, as defined in this file
*
* @package templateSystem
* @copyright Copyright 2003-2019 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: DrByte 2019 Jan 04 Modified in v1.5.6a $
*/
unset($information);
if (DEFINE_SHIPPINGINFO_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>';
}
if (DEFINE_PRIVACY_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>';
}
if (DEFINE_CONDITIONS_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>';
}
if (DEFINE_CONTACT_US_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>';
}
//-bof-one-page-checkout-lat9 *** 1 of 1 ***
if (defined('FILENAME_ORDER_STATUS')) {
if (!defined('BOX_INFORMATION_ORDER_STATUS')) {
define('BOX_INFORMATION_ORDER_STATUS', 'Order Status');
}
$information[] = '<a href="' . zen_href_link(FILENAME_ORDER_STATUS, '', 'SSL') . '">' . BOX_INFORMATION_ORDER_STATUS . '</a>';
}
//-eof-one-page-checkout-lat9 *** 1 of 1 ***
// forum/bb link:
if (!empty($external_bb_url) && !empty($external_bb_text)) {
$information[] = '<a href="' . $external_bb_url . '" target="_blank">' . $external_bb_text . '</a>';
}
if (DEFINE_SITE_MAP_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_SITE_MAP) . '">' . BOX_INFORMATION_SITE_MAP . '</a>';
}
// only show GV FAQ when installed
if (defined('MODULE_ORDER_TOTAL_GV_STATUS') && MODULE_ORDER_TOTAL_GV_STATUS == 'true') {
$information[] = '<a href="' . zen_href_link(FILENAME_GV_FAQ) . '">' . BOX_INFORMATION_GV . '</a>';
}
// only show Discount Coupon FAQ when installed
if (DEFINE_DISCOUNT_COUPON_STATUS <= 1 && defined('MODULE_ORDER_TOTAL_COUPON_STATUS') && MODULE_ORDER_TOTAL_COUPON_STATUS == 'true') {
$information[] = '<a href="' . zen_href_link(FILENAME_DISCOUNT_COUPON) . '">' . BOX_INFORMATION_DISCOUNT_COUPONS . '</a>';
}
if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') {
$information[] = '<a href="' . zen_href_link(FILENAME_UNSUBSCRIBE) . '">' . BOX_INFORMATION_UNSUBSCRIBE . '</a>';
}
require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');
$title = BOX_HEADING_INFORMATION;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
I've created a GitHub issue to track the above change: https://github.com/lat9/one_page_checkout/issues/204
[QUOTE=lat9;1359362]You're right (I hope you didn't look for too long); there's an order_status page that should have a link in the site's information sidebox.
I'll get that added later. Didn't kill myself looking but enough so that I wouldn't feel really bad when/if you pointed to that snake :-)
I was looking for a separate side box instead of a link in an existing box but do have the Information sidebox turned on.
TNX again
I am using the 1.55F version.
There is a problem with PayPal Express Payment.
But click on the PayPal page to confirm the payment back to the website, the page can not be clicked.
How do I need to modify it to fix this problem?
Attachment 18562
Which version of One Page Checkout is installed? What template are you using? Have you modified any of the OPC template files for use on your store?
I am using the 1.55F version.
one_page_checkout-2.0.5
Use adaptive templates
There have been many changes to OPC since v2.0.5 (the current version is v2.1.2). Noting that a couple of those changes have corrected interaction with the PayPal payment methods.
Can zencart 1.55F use the v2.1.2 version?
Testing v2.1.2 with payment module from Network Merchants LLC, and pressing submit won't complete the transaction; just goes back to the checkout_one page with no error message. This payment module *does* work with standard checkout.
On the off chance that there's something obviously wrong with the implementation, here's the payment module.
Attachment 18564
I want to separate the registration and shipping address.
When you register, you only need to fill in the email, password and name.
Can it be achieved?
Since you've already got this payment method installed, you could create an OPC debug log for the looping transaction and send it to me directly.
Enable OPC debug, take the checkout process to the point of clicking that "Confirm" button, delete the current OPC log, click that button and then (after the loop-back) grab a copy of that OPC log.
1,Upgrade to the latest version and download the v2.1.2 version directly, overwriting the old version, can you?
2,How to remove the email confirmation,Can a subscription be set to the default subscription?
Attachment 18565
The good news, and the bad.
Yes, it can be done.
What you are wanting to do is not part of the OPC mod. You may be forced to modify core files for that. See if https://www.zen-cart.com/showthread....e-Account-Form will get you started.
Might we ask why you do not want to make sure you have a correct email?
Change Configuration->One-Page Checkout Settings->Guest Checkout: Require Email Confirmation? to false.
:blush: Guess I need to train the trifocals on the top of the image.
The zencart version is 1.55f and the plugin version is 2.0.5.
Set is not effective
Attachment 18566
Attachment 18567
The version I am currently using zencart1.55f is 2.0.5
Want to upgrade to the latest 2.1.2, directly overwrite old files?
Another question is that the 2.1.2 version can perfectly support the 1.55F version of zencart?
I hope to get a serious reply
I am using the adaptive template that comes with the program.
All my modifications are based on the adaptive template that comes with the system.
I am using zencart1.55F version
Installed one_page_checkout-2.1.2
There is a 155f file in the downloaded file. Must it be uploaded and overwritten?
What's the use of two files in a folder
urgent
If you mean that there's a /155f sub-directory in the installation zip-file, then: Yes, those files should be copied to your store's file-system, as identified in the link specified in the OPC readme: https://lat9.github.io/one_page_chec..._or_later.html
Zencart1.55 F version installation 2.1.2 version.
Besides uploading files in the plug-in, do I need to manually modify two places?
Should the following screenshots be manually modified?
1.
Attachment 18575
2.
Attachment 18576
Can the customer click settlement to directly jump to the registration page? Instead of letting customers choose whether to sign up or log in
How did you modify the code page
Click "Checkout" on shopping to directly jump to the registration page.
Customers no longer have to choose whether to register or log in.
Jump straight to this page /index.php?main_page=create_account
Instead of jumping to the landing page.
How do I modify this?
Attachment 18584
Attachment 18585
No I modified the button to point to index.php?main_page=checkout_one
I've just submitted v2.1.3 of OPC to the plugin moderators for review; I'll post back once it's available for download from Zen Cart. You can also download directly from the plugin's GitHub repository: https://github.com/lat9/one_page_che...ses/tag/v2.1.3
This release contains changes associated with the following GitHub issues:
#204: Add information sidebox link for the order_status page.
#206: Correct session-handling when javascript is disabled in the customer's browser.
#207: Remove unwanted guest-account address-book entries.
Note: At a minimum, I highly suggest that stores running any previous version of OPC that included the guest-checkout feature update their copy of /includes/functions/extra_functions/one_page_checkout_functions.php to use the v2.1.3 version:
Code:<?php
// -----
// Part of the One-Page Checkout plugin, provided under GPL 2.0 license by lat9 ([email protected]).
// Copyright (C) 2013-2019, Vinos de Frutas Tropicales. All rights reserved.
//
// -----
// For versions of OPC prior to v2.1.0, it was possible that additional address-book entries were recorded
// for the temporary (guest) account. We'll clean those up, if present, on each page-load, recording any
// addresses found for the store-owner's inspection.
//
if (defined('CHECKOUT_ONE_ENABLED') && defined('CHECKOUT_ONE_GUEST_CUSTOMER_ID')) {
$check = $db->Execute(
"SELECT COUNT(*) AS count
FROM " . TABLE_ADDRESS_BOOK . "
WHERE customers_id = " . (int)CHECKOUT_ONE_GUEST_CUSTOMER_ID,
false,
false,
0,
true
);
if ($check->fields['count'] > 2) {
$entry_count = $check->fields['count'] - 2;
$entries = $db->Execute(
"SELECT *
FROM " . TABLE_ADDRESS_BOOK . "
WHERE customers_id = " . (int)CHECKOUT_ONE_GUEST_CUSTOMER_ID . "
ORDER BY address_book_id DESC
LIMIT $entry_count",
false,
false,
0,
true
);
$entries_to_remove = array();
$log_file_name = DIR_FS_LOGS . '/opc_address_book_cleanup.log';
error_log(date('Y-m-d H:i:s') . ": Removing $entry_count guest address-book entries." . PHP_EOL, 3, $log_file_name);
while (!$entries->EOF) {
error_log(str_replace(',"', ', "', json_encode($entries->fields)) . PHP_EOL, 3, $log_file_name);
$entries_to_remove[] = $entries->fields['address_book_id'];
$entries->MoveNext();
}
$db->Execute(
"DELETE FROM " . TABLE_ADDRESS_BOOK . "
WHERE address_book_id IN (" . implode(', ', $entries_to_remove) . ")"
);
}
}
// -----
// This function identifies whether (true) or not (false) the current customer session is
// associated with a guest-checkout process.
//
if (!function_exists('zen_in_guest_checkout')) {
function zen_in_guest_checkout()
{
$in_guest_checkout = false;
$GLOBALS['zco_notifier']->notify('NOTIFY_ZEN_IN_GUEST_CHECKOUT', '', $in_guest_checkout);
return (bool)$in_guest_checkout;
}
}
// -----
// This function identifies whether (true) or not (false) a customer is currently logged into the site.
//
if (!function_exists('zen_is_logged_in')) {
function zen_is_logged_in()
{
$is_logged_in = (!empty($_SESSION['customer_id']));
$GLOBALS['zco_notifier']->notify('NOTIFY_ZEN_IS_LOGGED_IN', '', $is_logged_in);
return (bool)$is_logged_in;
}
}
// -----
// This function identifies whether (true) or not (false) the current page is being accessed
// by a spider.
//
if (!function_exists('zen_is_spider_session')) {
function zen_is_spider_session()
{
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
$spider_flag = false;
if (zen_not_null($user_agent)) {
$spiders = file(DIR_WS_INCLUDES . 'spiders.txt');
for ($i=0, $n=count($spiders); $i<$n; $i++) {
if (zen_not_null($spiders[$i]) && strpos($spiders[$i], '$Id:') !== 0) {
if (strpos($user_agent, trim($spiders[$i])) !== false) {
$spider_flag = true;
break;
}
}
}
}
return $spider_flag;
}
}
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095
I am using version 2.1.2 now, I found a problem, using PayPal Express payment, when returning to the page is not a page payment.
It takes 4 clicks to complete the payment
Thanks! I had this same issue on a 1.5.6c site and running the code below through the Admin's Install My SQL patches worked great!
[QUOTE=lankeeyankee;1347945]I think you're missing what I meant:It looks like there is a missing column in the orders table. That is what this error message is telling you. "Unknown column 'is_guest_order'"PHP Code:
PHP Fatal error: 1054:Unknown column 'is_guest_order' in 'field list' :: UPDATE orders....
[QUOTE=stellarweb;1360513]Thanks! I had this same issue on a 1.5.6c site and running the code below through the Admin's Install My SQL patches worked great!
Hmm, that's weird. That field was added via admin initialization for OPC v2.0.0. What version are you running, @stellarweb?
How to remove the BR tag in the picture below, I want to use the DIV tag to beautify
Attachment 18604
As in the screenshot below, add a DIV tag to each of the fields
Attachment 18605
Checkout button on the shopping cart page
As shown in the screenshot below
Attachment 18607
This link should be judged by existence, where is the real link modified?
Attachment 18608
Hello everyone.
Installed the mod on a fresh installation v1.5.6c. While testing the checkout process I'm getting this error "Please contact the store owner; some required elements of this page are missing". No log files generated (weird right?)
So looking at the console I get:
Missing #current-order-total
Missing #opc-order-confirm
Missing #opc-order-review
from jquery.checkout_one.min.js
Any idea why??
@mvstudio, those console-errors are logged by OPC's jQuery (so there aren't any logs). From the missing elements, it looks like there's been a change (or template-override) to the /includes/templates/template_default/templates/tpl_modules_opc_submit_block.php; that's where those elements are added to the checkout_one page.
Thank you Lat9 for the quick reply. I thought I made sure when I installed the plugin that all the files were exactly in the folders they were supposed to be. But I did miss copying the rest of the files on the modules>pages>checkout_payment to the modules>pages>checkout_one. It seems to be working now the way it should.
I do have another question I couldn't find the answer for. Do Square and PayPal require confirmation? Should they be entered in the Payment Methods Requiring Confirmation setting in the admin or not?
Thanks so much!
Spoke too soon!
Apparently the issue didn't get fix and now I know why.
I modified the tpl_modules_opc_submit_block.php and added that block of code to prevent the checkout button from showing up if the order didn't reach the minimum amount $100 for free shipping. With the regular checkout it works, and it works with OPC as long as the amount is above $100. However in testing with lower amounts that's when I get the error and I have no clue how to make it work.
Code:<?php
// -----
// Part of the One-Page Checkout plugin, provided under GPL 2.0 license by lat9 ([email protected]).
// Copyright (C) 2013-2017, Vinos de Frutas Tropicales. All rights reserved.
//
// Check to see that at least one shipping-method and one payment-method is enabled; if not, don't render the submit-button.
//
if ($shipping_module_available && $payment_module_available) {
// -----
// Set up two form-submittal buttons, one for payment methods that require confirmation and one for those that don't.
// This page's header_php.php has created an array of payment modules that require confirmation, which is pulled into the
// page's jscript_main.php.
//
?>
<!-- bof disable checkout button from displaying 1 of 2 -->
<?php
if (!IS_ADMIN_FLAG) {
global $order;
if (($order->info['total'] < 100) && is_object ($freeoptions)) {
echo '<div style="border: 3px solid #777777; padding: 10px 0;"><p style="text-align: center;"><strong>Your order does not qualify for Free Shipping at this time.</strong></p>
<p style="text-align: center;"><strong>Please go back to the - <a href="index.php?main_page=shopping_cart">SHOPPING BAG</a> - to add more products or increase the quantity of products in your bag to meet the minimum order amount required to qualify
for free shipping,</strong><br /><strong>or select a different shipping option.</strong></p>';
} else {
?>
<!-- eof disable checkout button from displaying 1 of 2 -->
<!--bof submit block -->
<div id="checkoutOneSubmit" class="buttonRow">
<span id="opc-order-confirm"><?php echo zen_image_button(BUTTON_IMAGE_CHECKOUT_ONE_CONFIRM, BUTTON_CHECKOUT_ONE_CONFIRM_ALT, 'name="btn_submit" id="btn_submit"'); ?></span>
<span id="opc-order-review"><?php echo zen_image_button(BUTTON_IMAGE_CHECKOUT_ONE_REVIEW, BUTTON_CHECKOUT_ONE_REVIEW_ALT, 'name="btn_submit" id="btn_submit"'); ?></span>
<?php echo zen_draw_hidden_field('order_confirmed', '1', 'id="confirm-the-order"') . zen_draw_hidden_field ('current_order_total', '0', 'id="current-order-total"'); ?>
</div>
<!-- bof disable checkout button from displaying 2 of 2 -->
<?php } } ?>
<!-- eof disable checkout button from displaying 2 of 2 -->
<div class="clearBoth"></div>
<!--eof submit block -->
<?php
}
That's because the checkout process shouldn't be entered if the checkout can't be completed. You could add the code fragment as an extra "header", e.g. /includes/modules/pages/checkout_one/header_php_min_order.php, and redirect back to the shopping-cart page with a message.
I wasn't able to accomplish your suggestion (my knowledge of PHP is quite... how should I put it "primitive" :blush:) however I was able (sort of) to do what I needed without any errors (sort of) by moving the code around the tpl_modules_opc_submit_block.php page and looking at "hiding" the buttons instead preventing them from displaying, which surprisingly worked.
If an order that qualified for free shipping receives any discounts that lowers the total, the message is displayed on top of the buttons, preventing the customer from checking out. HOWEVER, if the customer decides to change the shipping option, the page doesn't refresh keeping the buttons hidden, not good.Code:<?php
// -----
// Part of the One-Page Checkout plugin, provided under GPL 2.0 license by lat9 ([email protected]).
// Copyright (C) 2013-2017, Vinos de Frutas Tropicales. All rights reserved.
//
// Check to see that at least one shipping-method and one payment-method is enabled; if not, don't render the submit-button.
//
if ($shipping_module_available && $payment_module_available) {
// -----
// Set up two form-submittal buttons, one for payment methods that require confirmation and one for those that don't.
// This page's header_php.php has created an array of payment modules that require confirmation, which is pulled into the
// page's jscript_main.php.
//
?>
<!-- bof disable checkout button from displaying 1 of 2 -->
<?php
if (!IS_ADMIN_FLAG) {
global $order;
if (($order->info['total'] < 100) && is_object ($freeoptions)) {
echo '<div style="border: 3px solid #777777; padding: 10px 0;"><p style="text-align: center;"><strong>Your order does not qualify for Free Shipping at this time.</strong></p>
<p style="text-align: center;"><strong>Please go back to the - <a href="index.php?main_page=shopping_cart">SHOPPING BAG</a> - to add more products or increase the quantity of products in your bag to meet the minimum order amount required to qualify
for free shipping,</strong><br /><strong>or select a different shipping option.</strong></p>';
echo'<span id="opc-order-confirm"></span>';
} else {
} }
?>
<!-- eof disable checkout button from displaying 1 of 2 -->
<!--bof submit block -->
<div id="checkoutOneSubmit" class="buttonRow">
<span id="opc-order-confirm"><?php echo zen_image_button(BUTTON_IMAGE_CHECKOUT_ONE_CONFIRM, BUTTON_CHECKOUT_ONE_CONFIRM_ALT, 'name="btn_submit" id="btn_submit"'); ?></span>
<span id="opc-order-review"><?php echo zen_image_button(BUTTON_IMAGE_CHECKOUT_ONE_REVIEW, BUTTON_CHECKOUT_ONE_REVIEW_ALT, 'name="btn_submit" id="btn_submit"'); ?></span>
<?php echo zen_draw_hidden_field('order_confirmed', '1', 'id="confirm-the-order"') . zen_draw_hidden_field ('current_order_total', '0', 'id="current-order-total"'); ?>
</div>
<div class="clearBoth"></div>
<!--eof submit block -->
<?php
}
Is there any way to make the page "refresh" if customer selects another shipping option?
Silly me didn't realize there was a "refresh" setting. :blush:
However the code I posted doesn't work the way I need it.
Regardless of what shipping option is selected if the order is less than $100 it won't allow the checkout buttons to appear unless selecting a shipping option that increases the total to $100 or above.
I need to modify this codeto make it work.Code:if (($order->info['total'] < 100) && is_object ($freeoptions)) {
@mvstudio, before I head down a code-generation path, would you post a screenshot of your store's settings for Modules->Shipping->Free Shipping Options?
From your description, it sounds like you want to offer Free Shipping if the order's total is greater than $100.00. If that's the case, you should be able to simply set that freeoptions shipping-module's Total >= value to 100.00.
That's exactly what I have it set up.
Attachment 18614
Is that the only shipping-module enabled?
The problem with freeoptions is that any discounts applied to the order during checkout won't override the freeoptions selection. So if a client adds $120 worth of products, then during checkout uses reward points, or coupons, etc and discounts the total to $40, the client still receives free shipping.
The code that I had which worked with the regular checkout took care of that in a simple way. However the code now isn't working the way it should.
The object freeoptions isn't getting called at all. So even when changing shipping option to fedex or usps after refreshing the page, if the order total is still bellow the minimum the message still gets displayed not allowing the checkout process to continue.
Code:<!-- bof disable checkout button from displaying 1 of 1 -->
<?php
if (!IS_ADMIN_FLAG) {
global $order, $db;
if (($order->info['total'] < MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) && is_object ($freeoptions)) {
echo '<div style="border: 3px solid #777777; padding: 10px 0;"><p style="text-align: center;"><strong>Your order does not qualify for Free Shipping at this time.</strong></p>
<p style="text-align: center;"><strong>Please go back to the - <a href="index.php?main_page=shopping_cart">SHOPPING BAG</a> - to add more products, increase the quantity of products in your bag to meet the minimum order amount required to qualify
for free shipping, or select a different shipping option.</strong></p>';
echo'<span id="opc-order-confirm"></span>';
} }
?>
<!-- eof disable checkout button from displaying 1 of 1 -->
Do you also have coupons that provide free shipping?