Not for free shipping. Discount coupons only for a portion of the sale or product ($5 off $30 kind of thing)
Printable View
In case you need it the order total modules installed are: Gift Certificates, Coupons, Group Discounts and Reward Points.
Since none of your coupons offer free shipping, I think that you can solve your issue by changing the sort-order (Modules->Order Total) of the ot_shipping module so that its processing occurs after the coupon, group discount and rewardpoints modules.
That way, the order's total will be reduced by those discount modules and the freeoptions method won't kick in since the order's total is now reduced by any of those deductions.
That method has never worked before I believe it's because freeoptions makes the calculation based on order sub-total and not order total, but I tried it again to see if it would work with OPC with various scenarios.
1) Placed ot_shipping with a value of 1000 which puts it below ot_total leaving all discounts above, and removed the modification from the tpl_modules_opc_submit_block.php file and it didn't work. freeoptions is still applied even though the cart is way below the minimum for free options. Which is exactly what I can't have.
Attachment 18615
2) I placed the modification back on the tpl_modules_opc_submit_block.php file. ot_shipping still below ot_total and it didn't work either. The message that's generated by the code I placed stays on regardless of the shipping method selected unless the shipping method selected increases the order total above the minimum of $100.
Attachment 18616
In scenario 2 above the only problem with the little piece of code I wrote is that it isn't taking into consideration that freeoptions must be selected for the message and the hiding of the buttons to kick in. If another shipping option is selected the message should not appear allowing the checkout process to continue, but that isn't happening and I have no idea how to do it.
You should set the sort-order for ot_shipping to be higher than any of the deduction-type totals, but lower than ot_tax and ot_total.
I see the problem you're describing with the freeoptions shipping method, as you indicated it's looking at the cart-based cost for its calculations rather than the order's current total.
For your needs, your quickest correction is to edit this section in /includes/modules/shipping/freeoptions.php
to readCode:if ($this->ck_freeoptions_total) {
switch (true) {
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='' and MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// free shipping total should not need adjusting
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if (($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
}
}
Code:if ($this->ck_freeoptions_total) {
switch (true) {
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='' and MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// free shipping total should not need adjusting
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if ($order->info['total'] >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN && $order->info['total'] <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
if ($order->info['total'] >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if ($order->info['total'] <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$this->ck_freeoptions_total = true;
} else {
$this->ck_freeoptions_total = false;
}
break;
}
}
I'm going to have to table this for a bit; that freeoptions shipping method is making my head hurt.
I have a weird problem and am hoping someone can point me in the right direction...
ZC 1.5.6, OPC 2.1.3, php 5.5.38
Using PayPal Express and Guest Checkout sometimes comes up with a blank shipping address. Keyword is sometimes and I can't figure out why - the only common factors are PayPal Express and Guest Checkout. It does not happen all the time, so we do have guest orders using PayPal Express and it's all good.
We tried disabling PayPal Guest account (in PayPal account settings), and have tried disabling the PayPal shortcut button on the login page - made no difference.
Attachment 18620
One thing I did notice (although possibly just a coincidence) is that there are 0 orders using PPE with Guest Checkout and different billing/shipping addresses. We do have PPE and different addresses, we do have PayPal Pro and different addresses, we do have PayPal Pro in Guest Checkout with different addresses, but not one PPE in Guest Checkout with different Shipping and Billing addresses. Maybe just a coincidence?
Any ideas? Where do I start? I have both PPE and OPC debug on, but didn't notice anything relevant. TIA
@balihr, besides the PPE/OPC trace-logs were there any debug-logs thrown an/around the time of the missing shipping-address(es)?
Depending on the site in question, i.e. how 'buggy' it is, you might consider installing Report All Errors and setting it for all non-duplicate-constant messages on the storefront. That way, if/when the issue occurs again, there would be additional breadcrumbs left to hone in on the issue's source.
BTW, which sub-version of zc156 is in use?
Thank you, Cindy.
No other logs were thrown that I would say are associated with checkout. We do get a few related to duplicate language constants, but I don't think that has anything to do with the issue described.
I've installed Report All Errors and will start watching it now, maybe that will take me somewhere. I'll report back when there's some data.
As for how "buggy" it is - I built that site so... uhm... okay, I'm ready for a huge log file... :D
It's ZC 1.5.6. Period. :smile: No sub-version, just 1.5.6
I did it!
Found a way around it and it works with OPC thanks to Ajeh and this code https://www.zen-cart.com/showthread....70#post1240770 from where I got the idea. Perhaps it isn't elegant but it accomplishes what I need.
This little piece of code prevents the checkout buttons from appearing if free shipping (from freeoptions) is used in conjunction with reward points and if the cart total gets below the minimum amount for free shipping to kick in. But it allows the selection of a different shipping option.
Adding the code in red to templates/tpl_modules_opc_submit_block.php
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 1 -->
<?php
if (!IS_ADMIN_FLAG) {
global $order, $db;
if (($order->info['total'] < MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) && (substr_count($_SESSION['shipping']['id'], 'freeoptions') !=0)) {
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 head 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 above.</strong></p>';
echo'<span id="opc-order-confirm"></span>';
}
}
?>
<!-- eof disable checkout button from displaying 1 of 1 -->
<!--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
}
In regards to the Coupon, Reward Points, and Gift Certificate. Every time the APPLY button is hit to update the data on the shopping bag, the only message generated is "Please confirm the terms and conditions below." without acknowledging either coupon code, reward points or GV code were accepted at all or generated some errors.
Would it be possible to generate the appropriate messagestacks for each of these? and if so how?
Thank you Lat9. I removed all the template overrides I made, which with the exception of tpl_modules_opc_submit_block.php only had cosmetic changes, and I ran some tests with both OPC on and off and this is what I found.
1) With OPC OFF: If I add a valid coupon, if I add an invalid coupon and if I remove a coupon all messages are produced. If I use reward points no message is produced.
2) With OPC ON. If I add a valid coupon, no message is produced. If I add an invalid coupon message is produced. If I remove coupon message is produced. If I use reward points no message is produced.
If I'm not mistaken reward points doesn't generate any messages at all (??). If the issue was my template overrides removing them would fix the issue, but it doesn't. What m I missing? How could I figure this out?
@mvstudio, using zc156c and OPC 2.1.3, adding a valid coupon results in a "Congratulations you have redeemed a discount coupon" message at the top of the one-page-checkout page's display.
A couple of ideas:
1. Install Report All Errors, setting to report all non-duplicate-constant errors on the storefront. See if any PHP notices are logged.
2. Install Superglobals, enabling that to display on the storefront for your IP address. Check the contents of the messageStack.
I didn't try that actually. I assumed the APPLY button wouldn't need the T&C box to be checked. A customer might not know that and do the same I did. In any case, I tried checking the T&C box and the message displayed is the message from define_checkout_one.php but no message about the coupon being applied.
I removed the the regulations, entered the coupon code, clicked APPLY and no coupon confirmation message either, so I'm guessing T&C box has no effect on this. I do need to have the regulations set to true though. I'll keep on working on the suggestions and see what I get.
Re-installed the plugin as it comes out of the box (well folder) before trying the suggestions and still the "Congratulations you have redeemed the Discount Coupon" won't display. :dontgetit
@lat9 I'm guessing this is what you where telling me to look for. I have no idea how to read that though :blush:
Attachment 18623
You got it, @mvstudio! That coupon-related message is 'targeted' (via that class parameter) to be displayed for a checkout group (which isn't one of the groups looked at by OPC). The base checkout_one-page template (tpl_checkout_one_default.php) will display the checkout_payment, checkout_shipping and redemptions groups by default.
If you make a template-override copy of that module, changing this section:
to readCode:$messages_to_check = array('checkout_shipping', 'checkout_payment', 'redemptions');
foreach ($messages_to_check as $page_check) {
if ($messageStack->size ($page_check) > 0) {
echo $messageStack->output ($page_check);
}
}
... I believe that you'll find that coupon/reward-points message now displays.Code:$messages_to_check = array('checkout_shipping', 'checkout_payment', 'redemptions', 'checkout');
foreach ($messages_to_check as $page_check) {
if ($messageStack->size ($page_check) > 0) {
echo $messageStack->output ($page_check);
}
}
FWIW, I've created a GitHub issue for OPC and will add that 'class' to its default display for the next release.
You're AWESOME!!!!! Thank you!!!
It does work beautifully for the coupons, but not for the reward points. Actually no message is generated at all for reward points not even on the regular ZC checkout.
But I can work with this. Since I have prevented coupons and reward points from being used together, I can reword the message for customers to remove the coupon if they want to use their rewards and viceversa.
Thank you so, so much!!! :hug:
No problems, @mvstudio; the resolution of your issue hinged on providing that screenshot!
I really really want to use OPC on my site, but having an issue with the square payment module and free shipping only. I looked through this thread and saw where someone else had a similar problem, but doesnt match mine... so here I go:
Dev site using:
PHP 7.1
Zen 1.5.6c (includes square code)
Mods so far are:
Slider on main page
Colorbox
Testimonials Mgr
News Mgr
Issue: Square shows up, but I get no input boxes
Hoping someone can help me figure out what is going on?
Attachment 18624
What template are you using, @stellarweb?
Do the input boxes show if you disable OPC and checkout using the "traditional" method?
Yes, authorize.net shows up fine, I checked that first thing. I have also tried different versions of php and that didn't help either. I wonder if there is a javascript conflict with some of the mods I have installed? Do you think it will help if I try disabling some of the mod js and see if that changes anything?
Attachment 18625
I was asking whether Square shows up OK in the 3-page checkout.
Saying that, have you copied /includes/modules/pages/checkout_payment/jscript_square.php to /includes/modules/pages/checkout_one?
I installed a one-page payment function and encountered a problem. I used PayPal to pay. After clicking submit, I didn't jump to the PayPal page. Instead, I went back to the default payment step and prompted the red word.
You have changed the items in your cart since shipping was last calculated, and costs may have changed. Please verify/re-select your shipping method.
I need to check which file has a problem with the code?
Urgent,Urgent,Urgent
You haven't given me much information with which to diagnose your issue.
What version of Zen Cart, version of OPC is being used?
What template is being used?
What shipping methods were offered?
Which type of PayPal (PayPal Payments Standard, PayPal Express Checkout or PayPal Payments Pro)?
What other plugins are installed on the store?
Followup to my previous post here...
Report All Errors revealed nothing, there was no mention of checkout pages at all. OPC debug logs show nothing relevant, everything looks just the same as all other orders.
I now think this is related to the modifications I had added to the checkout process. I tried removing it and everything worked fine for a week. Then I restored the modifications and problems are back.
Several orders have gone through without any Shipping Address.
Did I make any mistakes with the custom-added session variable? Here's what I've done:
tpl_modules_opc_payment_choices.php - line 23 (right after <legend>):
then, includes/modules/pages/checkout_one_confirmation/header.php - line 167 (right after $comments = $_SESSION['comments'];)Code:$po_val = isset($_SESSION['po_number']) ? $_SESSION['po_number'] : '';
if($check_flag_group) {
?>
<!--bof comments block -->
<div id="checkoutPurchaseOrder">
<fieldset class="shipping" id="purchaseOrder"><legend><?php echo MODULE_PAYMENT_PURCHASEORDER_TEXT_PURCHASEORDER_NUMBER; ?></legend><?php echo zen_draw_input_field('po_number', $po_val, 'id="purchaseorders-po-number"' . $onFocus . ' autocomplete="off"'); ?></fieldset>
</div>
<!--eof comments block -->
<?php } ?>
and finally includes/classes/observers/class.checkout_one_observer.php on line 573 (right after unset for ceon manual card):Code:unset($_SESSION['po_number']);
if(zen_not_null($_POST['po_number'])) {
$_SESSION['po_number'] = zen_clean_html($_POST['po_number']);
$po_number = $_SESSION['po_number'];
}
What am I missing? If I remove this code, everything works just fine. If this code is there, SOME orders come through without Shipping Address (database fields are left empty). :dontgetit :frusty:Code:if (isset($session_data['po_number'])) {
unset($session_data['po_number']);
}
Thanks!
@balihr, you've done all the right things from an OPC perspective (although I don't believe that you need that alteration to the OPC observer).
Your template change adds the data-gathering for that PO number and the change you made to the confirmation page's header records that value in the session prior to the session-hash value being created. That's why you don't need that OPC observer change as those 'unsets' deal with order-totals and payment- or shipping-modules that modify their session values during order creation.
What additional processing is being performed if a PO number is supplied for the order?
There is a step I think can be optimized, but I don't know how to modify it.
When the customer is not logged in, click checkout on the shopping cart page, and I want to jump directly to the registration page.
I am using the 1.55F version of zencart
One-Page Checkout version 2.1.2
I don't want customers to choose to log in or register when they check out.
Because I found that many customers shut down my website on this page.
They should prefer to see the registration information as they are new customers.
How can I modify the code to implement this idea?
It sounds like you should contact a developer ... see the Zen Cart Help Wanted area.
This seems to be required. If I remove the modification from the observer, I keep getting "Your order's details have changed. Please review the current values and re-submit." even when I change nothing. So, I log in, go to checkout, keep the cheapest pre-selected shipping option and only click PayPal and then the submit button, and I get that error message. The only thing that prevents that error message from showing up is the unset in the hashSession function.
po_number is an additional field in the orders table.
includes/classes/order.php
under function query($order_id)
under function cart()Code:$this->info = array(...
'ip_address' => $order->fields['ip_address'],
'po_number' => $order->fields['po_number']
);
There's also a one-liner in the email section so it adds the po_number to the order confirmation email (irrelevant).Code:$this->info = array(...
'comments' => (isset($_SESSION['comments']) ? $_SESSION['comments'] : ''),
'po_number' => (isset($_SESSION['po_number']) ? $_SESSION['po_number'] : ''),
'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR']
);
Actually, all 3 is correct, but primarily because of the last one you mentioned - no information in database. The delivery_XXXXX fields in the orders table are all empty, and what I also find very interesting is that delivery_address_format_id is set to 0 (expected value is 2 for US orders).
Also interesting - it only happens with PayPal Express. At first, I thought it was related to the Express shortcut button, but we eliminated that option when we disabled the shortcut button and the issue was still happening. So, the customer does enter OPC and uses PayPal Express when this happens. PayPal Pro doesn't seem to be affected. Also, it's only Guest Checkout when it happens, haven't seen it happen with a regular account checkout.
One thing I should point out - possibly very important - the po_number field doesn't even show up for these customers. You probably noticed the if($check_flag_group) - there's an additional query to check if the customer belongs to a group, and if true, the po_number field will be displayed. Otherwise, that field doesn't show and isn't part of the form at all.
@balihr, is it possible for you to turn on the PPE payment method's debug-logging in an attempt to hone in on the root cause of the issue(s) you're having? That way, if a future order comes back with that empty delivery address, you'd have information to send me.
After I open the one-page Checkout plugin, I modify the jump page modification in checkout_shipping and it doesn't work.
Attachment 18643
Can the plugin control the page that jumps?
I just want to click the checkout button on the shopping cart page, the customer will jump directly to the registration page if they are not logged in.
Close the one-page Checkout payment plug-in to modify the judgment of the above screenshot to achieve my idea, but after opening one-page Checkout plug-in, skip to the login page.
Can the plugin directly control the jump page? Which file code do I need to modify?
I'm preparing v2.1.4 of One-Page Checkout and will post back here once I've submitted the update for the Zen Cart moderators' review. There have been various reports over the past year of orders being received with empty shipping addresses for orders placed with PalPal Express Checkout/PPEC (paypalwpp) and I believe that this update will correct those issues.
The Scenario
A customer (either a guest or an account-holder that chooses to use a temporary shipping address) enters their address-related information, selects PPEC as their payment method and, upon order confirmation, is taken to the PayPal site. After logging in to PayPal, either their preferred PayPal address is different from that entered on the Zen Cart store or they choose a different shipping address from their PayPal address book and return to the store for order fulfillment.
This confuses OPC, causing part of its processing to believe that it should not use the temporary shipping address stored prior to the transition to PayPal. That, in turn, causes OPC's order-address update to register an empty shipping address.
The Correction
OPC's processing, for v2.1.4 and later, is now more integrated with the PPEC payment method and has tightened its temporary addresses' handling. Specifically, on return from PayPal, if a temporary shipping address is currently being used, OPC inspects the shipping-address returned. If it's different from that submitted to PayPal, the original shipping address is saved and the order's shipping address is updated with that returned by PayPal.
Additionally, OPC now checks to see if the order's value has changed upon return from PayPal, as a change in shipping address could result in a change in tax-rate. If such a change is detected, OPC will redirect the customer back to its data-entry page for an additional confirmation prior to order submittal to PayPal.
Finally, if the order's temporary shipping address was changed at PayPal, OPC will append a statement to the order's first status-history record identifying the as-entered address ... just to let the customer know.
The Workaround
There is, unfortunately, no easy workaround for this issue. The best 'workaround' is to update your store to One-Page Checkout v2.1.4 or later. Additional possibilities exist, but they depend on a store's configuration:
1. If the store uses only non-PPEC payment methods, then this issue does not apply (you should still plan to update to v2.1.4 for additional bugfixes).
2. If the store uses only PPEC for credit card payments, the only viable workaround is to disable OPC until the OPC v2.1.4 update.
3. If the store uses a combination of PPEC and other credit-card providers (including PayPal Payments Pro), disable PPEC until the OPC v2.1.4 update.
v2.1.4 has been submitted for Zen Cart moderator review; I'll post back when it's available for download.
This release contains changes associated with the following GitHub issues. Note that there is an additional core-file update required for store's running a version of Zen Cart prior to v1.5.6!
#208: Display messages stacked for checkout on the main date-entry page.
#209: zc157 future-proofing, use zen_get_countries_name to retrieve the name of a country rather than direct database retrieval.
#210: Guest checkout, redirect billing/shipping address change back to the main data-entry page.
#211: Correct empty shipping address sometimes recorded on orders placed via PayPal Express Checkout.
#212: Correct temporary-address tax-calculations; affects ot_loworder_fee and ot_cod_fee and possibly others.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095
With the latest release of v2.1.4, function_taxes.php is located under the zc156b folder. Should it not be under the zc155f folder?
Ok I see the Github instructions do say that. It was just that the Change History tab says
Quote:
/zc155f/includes/functions/functions_taxes.php (Added)
Note: Stores running a version of Zen Cart prior to v1.5.6 should copy this file to their store's /includes/functions sub-directory.
Is there a demo site or screenshots of what the One-Page Checkout looks like? We're upgrading to 1.5.6 and would rather not figure out how get the old COWOA plugin to work with 1.5.6... So I'd love to sell my client on using this One-Page Checkout, but I need to give them a feel of what the updated layout will look like. Thanks.
The demo site is located at https://vinosdefrutastropicalesDOTcom/demo. You can guest checkout some item to get a quick view.
Remember that, as in all things open source, you can make it "look" any way you want.
Additional documentation, over-and-above that in the readme, is also online at the OPC GitHub repository: https://github.com/lat9/one_page_checkout/.
Just click the links associated with "Storefront Considerations" and/or "Admin Considerations" and follow the included links for additional documentation and screenshots.
Perfect, thank you both. I had clicked on the Storefront Considerations page but didn't click further, didn't realize there were screenshots there. :) Cheers.
I've just submitted v2.1.5 of One-Page Checkout to the Zen Cart moderators for review and will post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#213: Use 'TEXT_OPTION_DIVIDER' when displaying the shopping-cart.
#214: Correct 'zen_get_tax_locations' override when guest's billing=shipping.
#215: Use 'zen_is_logged' in when checking customer login status on the checkout_one_confirmation page.
#216: Enable integration with Gateway Processing Services (gps) payment method.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095
Interesting "bug" with Guest Checkout - when using Chrome autofill, you just enter your email address and Chrome fills everything else, allowing Billing Address to become visible at the same time as Contact Information. If you click the "Save" button for the billing address, billing address gets saved, but contact information doesn't and is reset to blank. Extremely confusing.
My workaround was to disable the billing "save" button if the contact "save" is visible by modifying the saveBilling() function:
includes/modules/pages/checkout_one/jquery.checkout_one.js
This is a bull in a china shop type of solution, and definitely still confusing because it clears the billing details after saving contact details, but it's better than nothing - at least there was a warning indicating you need to save contact details first...Code:if (jQuery('#checkoutOneGuestInfo .opc-buttons').is(":visible")) {
alert('Please save your Contact Information first. Thank you!');
jQuery('#checkoutOneGuestInfo .opc-buttons #opc-guest-save .cssButton').css({ border: "2px solid red" });
jQuery("body,html").animate(
{
scrollTop: $("#checkoutOneGuestInfo .opc-buttons #opc-guest-save .cssButton").offset().top
},
800 //speed
);
} else {
saveAddressValues('bill', '#checkoutOneBillto');
}
Would there happen to be a Cindy-style (beautiful) solution? :smile:
@balihr, try this. Edit your copy of /includes/classes/OnePageCheckout.php, finding the formatAddressElement method and apply the following changes:
Don't forget the space between $field_required and $autocomplete!Code:public function formatAddressElement($which, $field_name, $field_value, $field_text, $db_table, $db_fieldname, $min_length, $placeholder)
{
$this->inputPreCheck($which);
$field_id = str_replace('_', '-', $field_name) . "-$which";
$field_name .= "[$which]";
$field_len = zen_set_field_length($db_table, $db_fieldname, '40');
$field_required = (((int)$min_length) > 0) ? ' required' : '';
$autocomplete = ($this->guestIsActive && empty($this->customerInfoOK)) ? 'autocomplete="off"' : '';
return
'<label class="inputLabel" for="' . $field_id . '">' . $field_text . '</label>' . PHP_EOL .
zen_draw_input_field($field_name, $field_value, "$field_len id=\"$field_id\" placeholder=\"$placeholder\" $field_required $autocomplete") . PHP_EOL .
'<br class="clearBoth" />';
}
Thank you!
Close, but... This disables autofill on the billing address, forcing the customer to type it, which is quite bad for those who are used to using autofill. It does work on Contact Information, you save it but then all other billing fields need to be populated manually.
BTW, autocomplete="off" is ignored by Chrome (see SO) so I put autocomplete="new-password"
If you manually fill in the form and jump inputs using Tab key, you can get to billing address and type in your name and remove the overlay.
I think the perfect scenario would be to keep the overlay active until Contact Information is saved. Is that possible?
Looks like my coffee just kicked in. :D
What do you think of this as a solution, do you see any downsides?
includes/modules/pages/checkout_one/jquery.checkout_one.js
It seems to work, but I'd prefer getting confirmation that it won't cause problems in certain situations that I can't think of at the moment.Code:function changeBillingFields(event)
{
if (jQuery('#checkoutOneGuestInfo .opc-buttons').length) {
if(jQuery('#checkoutOneGuestInfo .opc-buttons').is(":hidden")) {
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneBillto .opc-buttons').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneBillto').addClass('opc-view');
}
} else {
jQuery(this).addClass('opc-changed');
jQuery('#checkoutOneBillto .opc-buttons').show();
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#checkoutOneBillto').addClass('opc-view');
}
}
Arggh, Chrome is the new IE!:( It's not the overlay, per se, since it's still there. The issue is that the address-related inputs are present on the page, even though they're visually obscured.
I'll need for my coffee to kick in to review!
ihave this Module installed called zx point of sell, i installed your current version on zen v1.56c and php 7.2, when i login in i get a redirection problem
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
this is code in login header
Code:// BOF ZenExpert - Barcode cart 1/1
else if(isset($_SESSION['POStoken'])) {
zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', $request_type));
}
// EOF ZenExpert - Barcode cart 1/1
There's a fairly long-standing change request (https://github.com/lat9/one_page_checkout/issues/163) for OPC, requesting that the guest-checkout "Customer Information" and "Billing Address" blocks be combined.
I believe that that change is going to be the best customer-experience solution for this autocomplete issue.
Brilliant! Just brilliant! TYVM! :bow:
I am currently running 155e
I have had installed a custom checkout that only my admin accesses. It uses a combination of barcode cart for the product POS, and I am using one-page checkout. I want the ability to choose the product in the POS page (barcode cart), and on the one-page checkout change the price being charged for the product, so that it still removes the product from the inventory, but records a giveaway (or a sample) in the total sale.
I installed the "edit orders-4.4.3" module in the hopes that would work. It does do what I want done, but only in the admin, after an order is processed.
I'd like to edit the order on the fly.
Any suggestions?
edited for clarity.
I appreciate the quick response.
The barcode cart module is used as my POS to display all of the products in both my internal backoffice and my online webstores for sales that occur in my physical store as well as my web installation.
It's simply a one page listing of all of my products. It redirects to one page checkout rather than the standard checkout process.
The goal is that at checkout, I want to be able to edit the price of the products, so that the final total adjusts before checkout.
Here is my current checkout display: image... https://peppermaster.com/images/checkout.png
on this page. where it shows the Shopping Cart Contents, I would like to be able to edit the price of the product, so that the total updates before we hit the Confirm Order button to close the sale.
It doesn't even have to be as technical as edit orders. (this is the display of the admin for edit orders). I just want to be able to choose one of the products and change the price we are charging for it, so that it gets deleted from inventory for the price I tell it at the checkout. Such as Edit Orders does, but before I sell, not after.
https://peppermaster.com/images/admin-edit-orders.png (btw, I love this module).
I hope that makes sense?
I was afraid of that. I looked at both mods, and although, it can be done. It is over my head.
Can I hire you to do the edit?
I've just submitted v2.2.0 of One-Page Checkout for the moderators' review and will post back here when it's available for download.
This release contains changes for the following GitHub issues:
#163: Combine guest information/billing-address blocks
#217: Correct PHP notice on no-longer-enabled payment methods.
#218: Remove 'myDEBUG-' prefix from OPC debug/trace logs' names.
My, oh my! That was fast ... v2.2.0 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095
Hello everyone.
I'm in need of some light to solve the problem I'm having, which was solved, but do to a human error, got screwed up.
So I'm getting this message "Sorry, but our expedited checkout process cannot be used. Click here to use our alternate checkout process" after by accident the files in the templates/CUSTOM-TEMPLATE/jscript got erased :no:
Putting the files back as I "thought" they were actually created the problem. I know there was a solution for this, but for the life of me I cannot locate it anymore.
I was able to - sort of - pinpoint the issue to one particular file jscript_jquery-1.9.1.min.js which is the file in charge of the functionality for zx_slideshow.4
Does anyone have any idea how to fix this problem so both OPC and zx_slideshow work as intended? I'm desperate.
Thanks so much!
ZX Slideshow comes with jscript_jquery-1.7.1.min.js and not 1.9.1.
I'd guess your problem is caused by loading multiple instances of jQuery on the same page. You can check source and see the sequence .js files are loaded - make sure you don't load the jquery file again after the other js files.
A fix for ZX Slideshow was described here but this might break other functionality on your site so make sure you test it thoroughly.
Thanks for the reply. I was able find some of the files that were deleted by error on one of the backups, uploaded them again and all is working as it should. Zx-slideshow is a bit outdated. I've had it working with 1.9.1 for quite a while now without any issues, and it works even better with the latest version. I've updated the jquery file for the latest version which is jscript_jquery-1.12.4.min.js which is also the version needed for zen-colorbox. Both work smoothly and no need for redundant jquerys. All the functionality on the website is working as it should.
@Lat9 one question.
Is it possible to have the rewards box, gift certificate box and discount box update the shopping cart contents without having to click the APPLY button just like the shipping methods do? The reason I'm asking is because the way it works right now, it throws an error message "Please confirm the terms and conditions below" every time I test either of those boxes because of the page refresh. I'm assuming customers want to see the total updated before placing the order and might get thrown off by the error messages.
includes/modules/pages/checkout_one_confirmation/header_php.php line 129 is
Do you think the call to zen_clean_html is absolutely required? I'm asking because I don't think the standard checkout does this operation.Code:$_SESSION['comments'] = (zen_not_null ($_POST['comments'])) ? zen_clean_html ($_POST['comments']) : '';
In the standard checkout, a comment entry like:
line1
line2
line3
has the line breaks preserved, but in OPC, because of the zen_clean_html operation, they are all put on one line.
Fantastic! Thank you Cindy!
@swguy, I've chosen to correct the issue a bit differently, changing that line to read:
When using zen_output_string_protected, I found that simple double-quotes (") were being converted to "'s ... which I didn't like. I mean, what if the customer wanted to leave a simple comment like I'd like a margin of 2".?Code:$_SESSION['comments'] = (!empty($_POST['comments'])) ? htmlspecialchars($_POST['comments'], ENT_NOQUOTES, CHARSET, true) : '';
The update is being tracked via this GitHub issue: https://github.com/lat9/one_page_checkout/issues/219
Are you sure that provides sufficient protection?
Version of Zencart: Latest
Template: fluorspar
No other plugins added
I am getting a very strange message in my admin area, "The One-Page Checkout plugin has been disabled. The file "/homepages/20/{d*****}/htdocs/****/certuk/includes/templates/fluorspar/jscript/jscript_framework.php" is required for the plugin's proper operation."
Not strange, that's OPC's way of letting you know that it's not going to allow itself to be enabled if it's not going to work! OPC relies on the AJAX interface provided by the jscript_framework.php module to do its thing.
Assuming that the 'Latest' version is zc156c, you can copy the file /includes/templates/responsive_classic/jscript/jscript_framework.php to /includes/templates/fluorspar/jscript/jscript_framework.php to allow OPC to be enabled.
Please note that simply enabling OPC on that template doesn't mean that it's going to work. I have no familiarity with that template, but if it's not providing the jscript_framework.php that's been around since zc154 ...
Thank worked. Thanks
What's added in the latest version, I am looking forward to a version close to my needs.
See the plugin's download page (https://www.zen-cart.com/downloads.php?do=file&id=2095). I'm pretty good about itemizing the changes there for each release.
Me again... :(
Zen Cart 1.5.6 (no trailing letter), OPC 2.2.0
OPC debug is set to full
Debug logs are intermittent and not every order gets the logs. Orders placed with PayPal Pro never get the opc debug log.
Some paypaldp orders are duplicated with error code 10536. Problem is - the order goes through, shows up in admin and customer's card gets charged.
Attachment 18696
In this case, order is placed 3 times. I have 8 logs related to the order - 4x paypaldp_PayPal_Action-XXXXXX.log and 4x PayPal_CURL_XXXXXX.log
One other thing I noticed - when a duplicate order goes through, if you check order details in the admin, it always shows a Transaction ID and Parent Transaction ID, while all "normal" orders have Parent Transaction ID empty.
Attachment 18697
Help? :please:
A couple of configuration-related questions:
- What template is being used? Does it modify the tpl_ajax_checkout_confirmation.php template?
- Is the paypaldp payment-method included in the OPC's "Payment methods requiring confirmation" list?
- What version of jQuery is being loaded for the site?
- What version of PHP is in use?
- Is the OPC's configuration setting "Debug: Customer List" set to a non-blank value?
Oh, missed the reply. Sorry.
Custom template.
tpl_ajax_checkout_confirmation.php is identical to the one included in OPC zip file.
No, only the default ones are listed (eway_rapid,stripepay,gps).Quote:
[*]Is the paypaldp payment-method included in the OPC's "Payment methods requiring confirmation" list?
jQuery 1.9.1Quote:
[*]What version of jQuery is being loaded for the site?
php 5.5.38 (I know, I know...)Quote:
[*]What version of PHP is in use?
No, it's blank.Quote:
[*]Is the OPC's configuration setting "Debug: Customer List" set to a non-blank value?
@balihr, nothing seems too amiss, although that jQuery version is quite old (almost as old as the PHP version!) and should really be updated to at least 3.4.0 if not 3.4.1. I can't explain the 'non-generation of OPC logs' during the paypaldp (PayPal Payments Pro) processing (the "Customer List" setting was the only possibility that I could come up with).
Can you reproduce the situation "on demand" or is this a case where "it happens when it happens"? Perhaps turning on the paypaldp's full logging might help, but I'm running out of ideas.
Yeah, jQuery and php... I know... But, there's some older jQuery code in use and I'm not 100% sure if the latest jQuery would break something so I'm leaving it be.
OPC debug is what's confusing me most - not one single paypaldp order has the opc debug log... weird...
And, no, it's not on demand - it happens with one order, then the next 50 go through just fine, then it happens again, then the next 100 are fine... Sometimes it's guest checkout, sometimes it's a returning customer, sometimes it's a new customer. No common factor other than paypaldp.
paypaldp full logging (to file) is already enabled...
I'll give it some more time and wait for it to happen a few more times, maybe more logs reveal something. Will post back when/if I have more info. Thank you, Mrs. C. :smile:
@Lat9 which responsive template in your opinion works the best with OPC? I'm checking my website and OPC doesn't work as it should nor it looks too good. Before I make changes to the responsive_classic template (and getting a huge headache) I wanted to know if there was a responsive template that would work better and effortlessly with OPC.
Thank you!