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

One-Page Checkout [Support Thread]

Views: 629,495

Results 1,301 to 1,320 of 3,078
16 Aug 2019, 4:30 PM
#1301
mvstudio avatar

mvstudio

Zen Follower

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

One-Page Checkout [Support Thread]

lat9:

Do you also have coupons that provide free shipping?

Not for free shipping. Discount coupons only for a portion of the sale or product ($5 off $30 kind of thing)

16 Aug 2019, 4:33 PM
#1302
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

In case you need it the order total modules installed are: Gift Certificates, Coupons, Group Discounts and Reward Points.

16 Aug 2019, 4:36 PM
#1303
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

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.

16 Aug 2019, 5:22 PM
#1304
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

lat9:

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

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

16 Aug 2019, 5:44 PM
#1305
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

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

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

to read

       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 ([B]$order->info['total'][/B] >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN && [B]$order->info['total'][/B] <= 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 ([B]$order->info['total'][/B] >= 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 ([B]$order->info['total'][/B] <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
              $this->ck_freeoptions_total = true;
            } else {
              $this->ck_freeoptions_total = false;
            }
            break;
          }
        }
16 Aug 2019, 6:09 PM
#1306
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

lat9:

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

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

> to read
> ```
       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 ([B]$order->info['total'][/B] >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN && [B]$order->info['total'][/B] <= 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 ([B]$order->info['total'][/B] >= 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 ([B]$order->info['total'][/B] <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
              $this->ck_freeoptions_total = true;
            } else {
              $this->ck_freeoptions_total = false;
            }
            break;
          }
        }

I tried this but it doesn't work. After the deductions freeoptions remains available and selected.

16 Aug 2019, 6:54 PM
#1307
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

I'm going to have to table this for a bit; that freeoptions shipping method is making my head hurt.

16 Aug 2019, 7:23 PM
#1308
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

lat9:

I'm going to have to table this for a bit; that freeoptions shipping method is making my head hurt.

That's why I gave up on trying to find a solution for the freeoptions shipping module and instead worked things around it. But my solution for some weird reason doesn't work with OPC and I don't know why. :blink:

Thanks for trying. I really appreciate it.

16 Aug 2019, 11:03 PM
#1309
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,772
Plugin Contributions:
20

Re: One-Page Checkout [Support Thread]

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 no longer available]

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

17 Aug 2019, 11:23 AM
#1310
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

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

17 Aug 2019, 2:46 PM
#1311
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,772
Plugin Contributions:
20

Re: One-Page Checkout [Support Thread]

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

19 Aug 2019, 5:36 AM
#1312
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

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.php?212549-Q-Is-it-possible-to-disable-a-coupon-code-based-on-shipping-method&p=1240770#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

<?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
}
19 Aug 2019, 9:19 PM
#1313
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

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?

20 Aug 2019, 11:25 AM
#1314
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

mvstudio:

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?
That's something in your template-overrides, the template files included in the plugin display the message-stack at the top of the page after the coupon has been applied.

21 Aug 2019, 2:31 PM
#1315
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

lat9:

That's something in your template-overrides, the template files included in the plugin display the message-stack at the top of the page after the coupon has been applied.

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?

21 Aug 2019, 4:10 PM
#1316
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

@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.
21 Aug 2019, 4:52 PM
#1317
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,765
Plugin Contributions:
9

Re: One-Page Checkout [Support Thread]

mvstudio:

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.Apparently you have set the flag that a customer has to accept the T & C.

Did you try it with the confirm box checked? Did you get the same result as when the box is not checked.

Inquiring minds want to know.

21 Aug 2019, 5:20 PM
#1318
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

lat9:

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

Thanks for the pointers :smile: I'll report back.

21 Aug 2019, 5:31 PM
#1319
mvstudio avatar

mvstudio

Zen Follower

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

Re: One-Page Checkout [Support Thread]

dbltoe:

Apparently you have set the flag that a customer has to accept the T & C.

Did you try it with the confirm box checked? Did you get the same result as when the box is not checked.

Inquiring minds want to know.

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.

21 Aug 2019, 6:39 PM
#1320
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,765
Plugin Contributions:
9

Re: One-Page Checkout [Support Thread]

mvstudio:

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.Yep, if the Admin >> Configuration >> Regulations are set to true, the system will not continue and throw the error.

Knowing that you get the same coupon result either way, can help with the troubleshooting.