Zen Cart Logo
Forums / All Other Contributions/Addons / One-Page Checkout [Support Thread]

One-Page Checkout [Support Thread]

Views: 629,461

Results 1,281 to 1,300 of 3,078
12 Aug 2019, 12:56 PM
#1281
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,280
Plugin Contributions:
37

One-Page Checkout [Support Thread]

jiji2018:

Hello, can you tell me which page you modified which code?
I never found it

No I cannot because I don't know where in your template you have checkout buttons.

12 Aug 2019, 2:31 PM
#1282
jiji2018 avatar

jiji2018

Zen Follower

Join Date:
Apr 2018
Posts:
121
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

mprough:

No I cannot because I don't know where in your template you have checkout buttons.

Checkout button on the shopping cart page
As shown in the screenshot below
Attachment 18607

12 Aug 2019, 2:35 PM
#1283
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,280
Plugin Contributions:
37

Re: One-Page Checkout [Support Thread]

jiji2018:

Checkout button on the shopping cart page
As shown in the screenshot below
Attachment 18607

That edit, depending on your template is in includes/templates/your-template/templates/tpl_shopping_cart_default.php

12 Aug 2019, 3:16 PM
#1284
jiji2018 avatar

jiji2018

Zen Follower

Join Date:
Apr 2018
Posts:
121
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

mprough:

That edit, depending on your template is in includes/templates/your-template/templates/tpl_shopping_cart_default.php

This link should be judged by existence, where is the real link modified?
Attachment 18608

14 Aug 2019, 7:57 PM
#1285
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

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??

15 Aug 2019, 11:31 AM
#1286
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

@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.

15 Aug 2019, 4:17 PM
#1287
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

lat9:

@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!

15 Aug 2019, 5:02 PM
#1288
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

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.

<?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
}
15 Aug 2019, 5:25 PM
#1289
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

mvstudio:

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!
The payment methods that use an AJAX form of checkout (e.g. square and paypaldp) don't specifically require confirmation; it depends on how you want your store configured.

15 Aug 2019, 5:28 PM
#1290
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

mvstudio:

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.

<?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.
15 Aug 2019, 6:40 PM
#1291
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

lat9:

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 don't know how to even do that, but I'll give it a try. Thanks for the suggestion!

15 Aug 2019, 7:40 PM
#1292
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

mvstudio:

I don't know how to even do that, but I'll give it a try. Thanks for the suggestion!
I'm about to shut down for the day; send me a PM (so I don't forget) and I'll update this thread to contain the changes needed.

15 Aug 2019, 7:49 PM
#1293
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

lat9:

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.

<?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
}

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.

Is there any way to make the page "refresh" if customer selects another shipping option?

15 Aug 2019, 9:48 PM
#1294
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

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 code ```
if (($order->info['total'] < 100) && is_object ($freeoptions)) {

16 Aug 2019, 11:33 AM
#1295
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

@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.

16 Aug 2019, 1:03 PM
#1296
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

lat9:

@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

16 Aug 2019, 1:08 PM
#1297
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Is that the only shipping-module enabled?

16 Aug 2019, 1:16 PM
#1298
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

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.

<!-- 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 -->
16 Aug 2019, 1:18 PM
#1299
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

lat9:

Is that the only shipping-module enabled?

Freeoptions, USPS and Fedexwebservices are the only shipping modules enabled.

16 Aug 2019, 4:08 PM
#1300
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: One-Page Checkout [Support Thread]

Do you also have coupons that provide free shipping?