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

One-Page Checkout [Support Thread]

Views: 633,116

Results 2,661 to 2,680 of 3,107
30 Aug 2023, 4:20 PM
#2661
lat9 avatar

lat9

Administrator

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

One-Page Checkout [Support Thread]

Same issue, different line. Change line 290 to

                   'state' => ($order->delivery['country']['id'] != '' ? zen_get_zone_code([B](int)[/B]$order->delivery['country']['id'], [B](int)[/B]$order->delivery['zone_id'], $order->delivery['state']) : zen_get_zone_code([B](int)[/B]$order->billing['country']['id'], [B](int)[/B]$order->billing['zone_id'], $order->billing['state'])),
30 Aug 2023, 5:29 PM
#2662
planetdesign avatar

planetdesign

New Zenner

Join Date:
Aug 2023
Location:
UK
Posts:
9
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

la9 - I am pleased to report that the second line of code changes you provided to alter line 290 of payment/paypal.php has RESOLVED the issue and the guest checkout is now working fine. Looks like adding the (int) code to both lines 275 and 290 will sort this issue quite easily in future releases.

Thank you so much for your indulgence in getting this working for me.. One of the downsides of Zen Cart (for me) was always the over long checkout process. Last time I used Zen it was the COWOA checkout, but this OPC guest checkout was the final obstacle to me returning to Zen full time. All sorted now - thank you.!!

30 Aug 2023, 6:16 PM
#2663
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

PlanetDesign:

la9 - I am pleased to report that the second line of code changes you provided to alter line 290 of payment/paypal.php has RESOLVED the issue and the guest checkout is now working fine. Looks like adding the (int) code to both lines 275 and 290 will sort this issue quite easily in future releases.

Thank you so much for your indulgence in getting this working for me.. One of the downsides of Zen Cart (for me) was always the over long checkout process. Last time I used Zen it was the COWOA checkout, but this OPC guest checkout was the final obstacle to me returning to Zen full time. All sorted now - thank you.!!
Glad to have you back, @PlanetDesign!

31 Aug 2023, 6:29 AM
#2664
borek avatar

borek

New Zenner

Join Date:
Jul 2007
Posts:
9
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Hi,
I am using Responsive Classic.
No additional modules used.

I have only tried to change some setting in the configuration of OPC.
May be the problem is on thhis settings:
Payment Methods Requiring Confirmation - I have changed only for payment method that I am using

From the name of the settinh I expect there must be only payment method tha I will to confirm.

thank you Dalibor

31 Aug 2023, 12:34 PM
#2665
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Borek:

Hi,
I am using Responsive Classic.
No additional modules used.

I have only tried to change some setting in the configuration of OPC.
May be the problem is on thhis settings:
Payment Methods Requiring Confirmation - I have changed only for payment method that I am using

From the name of the settinh I expect there must be only payment method tha I will to confirm.

thank you Dalibor
You can identify multiple payment methods that require the customer's confirmation prior to submitting the order, as identified in that setting's description:

***Identify (using a comma-separated list) the payment modules on your store that require confirmation.


Please note that some payment methods, e.g. the default eway_rapid,stripepay,gps, **require **confirmation due to the way that they handle the payments but you can identify any payment method (like moneyorder) as requiring customer-confirmation prior to placing the order. That adds another step to your site's checkout process.

1 Sep 2023, 8:24 PM
#2666
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
376
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

v2.4.6 of One-Page Checkout is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2095

This release contains changes associated with the following GitHub issues:

#370: Remove PHP user-errors logged, attempt to recover from any environmental issue instead.
#372: Correct checkout-loop by interpreting ## characters as spaces.
#374: Use window.location.replace to emulate page redirects.
#375: zc158a: Change in zen_get_zone_code parameters causes Fatal PHP error.
#376: Correct guest-checkout interaction with PPEC's Shortcut button.
#379: Correct PHP Warnings logged when Configuration :: Customer Details :: State is set to 'false'.
#380: Browser pre-fill of credit-cart or address information results in address sections activating when they shouldn't.
#381: Correct "Invalid form control, element not visible" console-logs; required for square_webPay users.
#382: Correct spelling of 'cursor' (was 'curser') in the checkout_one.css file.

Hi @lat9, my live site just updated to the 2.4.6 version and it worked smoothly. Thanks for your contribution!

6 Sep 2023, 12:10 AM
#2667
brian70809 avatar

brian70809

New Zenner

Join Date:
Jun 2011
Posts:
85
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Thanks for the report back that it's not OPC, @brian70809! Out of interest, what payment method and order-totals are "in play" for this order that takes a long time to record?

Payment Method is Invoice or Square WebPay... Invoice module is from our Plugins section.

Order-totals - this may be what is causing my delays?
ot_group_pricing
ot_local_sales_tax (I have no choice.. Louisiana is complicated)
ot_shipping
ot_subtotal
ot_tax
ot_total

6 Sep 2023, 1:35 AM
#2668
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

brian70809:

Payment Method is Invoice or Square WebPay... Invoice module is from our Plugins section.

Order-totals - this may be what is causing my delays?
ot_group_pricing
ot_local_sales_tax (I have no choice.. Louisiana is complicated)
ot_shipping
ot_subtotal
ot_tax
ot_total
If a similar delay occurs when you use either payment method, then the most likely suspect is the "Local Sales Tax" order-total. Taxes anymore are complicated wherever you're collecting them!

6 Sep 2023, 1:50 AM
#2669
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: One-Page Checkout [Support Thread]

lat9:

If a similar delay occurs when you use either payment method, then the most likely suspect is the "Local Sales Tax" order-total. Taxes anymore are complicated wherever you're collecting them!

i'm putting my money on square webPay. see this post.

i could be wrong.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

11 Sep 2023, 6:56 PM
#2670
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Thanks Brian70809, have you made any progress with this issue?

2 Oct 2023, 9:57 AM
#2671
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I need to get the gender of the guest account. I checked the source code and found that I can get the user's birthday address like ```php
$dob_value = $_SESSION['opc']->getGuestDateOfBirth();

I can't use this in another php file
 ```php
$gender = $this->guestCustomerInfo['gender'];

To get effective help, can anyone provide some tips?

2 Oct 2023, 10:25 AM
#2672
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

ikirin:

I need to get the gender of the guest account. I checked the source code and found that I can get the user's birthday address like ```php
$dob_value = $_SESSION['opc']->getGuestDateOfBirth();

> I can't use this in another php file
>  ```php
$gender = $this->guestCustomerInfo['gender'];

To get effective help, can anyone provide some tips?
Depending on which of the billing/shipping addresses' gender you are "looking for", you can use the following interfaces:

$billing_address = $_SESSION['opc']->getAddressValues('bill');
$billing_gender = $billing_address['gender'];

$shipping_address = $_SESSION['opc']->getAddressValues('ship');
$shipping_gender = $shipping_address['gender'];
3 Oct 2023, 1:28 AM
#2673
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Thank you bro, this parameter works:smile:

3 Oct 2023, 2:08 AM
#2674
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

ikirin:

Thank you bro, this parameter works:smile:
Thanks for the follow-up ... and it's sis!

6 Oct 2023, 2:18 AM
#2675
brian70809 avatar

brian70809

New Zenner

Join Date:
Jun 2011
Posts:
85
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I had some time to look at this timeout I get once in awhile.. I think it's a server side issue, but here is a copy of the error from the log.

2023/10/05 20:06:23 [error] 23835#0: *1048649 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xx.xx.xx.xx, server: gulfstatessupply.com, request: "POST /index.php?main_page=checkout_process HTTP/2.0", upstream: "fastcgi://unix:/var/www/vhosts/system/gulfstatessupply.com/php-fpm.sock", host: "gulfstatessupply.com", referrer: "https://gulfstatessupply.com/index.php?main_page=checkout_one_confirmation"

Does not matter if it's a payment module, COD, Invoice, etc.. I know how to make it so it doesn't error, but I don't know why the process is taking so long to get to the checkout final page. It doesn't happen all the time, but it happens enough to make me want to fix it.

Zen Cart 1.5.7a
17,000 items
UPS
Square
Othe payment options and Local Delivery Option.
I'm about to move to an AWS server on 1.5.8.. This weekend. I'll see if it persists.

Thanks for the great addon!

6 Oct 2023, 1:06 PM
#2676
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

brian70809:

I had some time to look at this timeout I get once in awhile.. I think it's a server side issue, but here is a copy of the error from the log.

Does not matter if it's a payment module, COD, Invoice, etc.. I know how to make it so it doesn't error, but I don't know why the process is taking so long to get to the checkout final page. It doesn't happen all the time, but it happens enough to make me want to fix it.

Zen Cart 1.5.7a
17,000 items
UPS
Square
Othe payment options and Local Delivery Option.
I'm about to move to an AWS server on 1.5.8.. This weekend. I'll see if it persists.

Thanks for the great addon!
Hmm, while that log is unintelligible to me, but Google found this SO posting that looks promising: https://stackoverflow.com/questions/18740635/nginx-upstream-timed-out-110-connection-timed-out-while-reading-response-hea

Unfortunately, there are a couple of proposed solutions in that posting and I don't 'speak' NGINX, so I'm hoping that someone who's conversant can chime in with the best "path to success".

18 Oct 2023, 1:38 AM
#2677
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I'm so sorry, I thought you were a man, :D

I have a small suggestion. On the contact us page, add a read-only judgment for the contactname option on the guest account. I am currently doing this, but I don’t know if there is any other better method.

includes/templates/template_default/templates/tpl_contact_us_default.php
<?php if (zen_in_guest_checkout()) { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'.' readonly="true"'); ?>
<?php } else { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'); ?>
<?php } ?>
18 Oct 2023, 10:54 AM
#2678
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

ikirin:

I'm so sorry, I thought you were a man, :D

I have a small suggestion. On the contact us page, add a read-only judgment for the contactname option on the guest account. I am currently doing this, but I don’t know if there is any other better method.

includes/templates/template_default/templates/tpl_contact_us_default.php

> 
> ```php
<?php if (zen_in_guest_checkout()) { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'.' readonly="true"'); ?>
<?php } else { ?>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'); ?>
<?php } ?>

No problems, I wouldn't have mentioned it if @dbltoe hadn't.

Noting that the contact_us page change is a Zen Cart core one. Why do you feel that it is important to make the 'contactname' field read-only during guest checkout?

24 Oct 2023, 5:10 PM
#2679
jpda avatar

jpda

Zen Follower

Join Date:
Jun 2014
Posts:
157
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

I can! It's a core-file issue; you'll need to edit /includes/classes/shipping.php's cheapest method:

function cheapest() {
if (!is_array($this->modules)) return false;
$rates = array();

  foreach($this->modules as $value) {
    $class = substr($value, 0, strrpos($value, '.'));
    if (isset($GLOBALS[$class]) && is_object($GLOBALS[$class]) && $GLOBALS[$class]->enabled) {
      $quotes = isset($GLOBALS[$class]->quotes) ? $GLOBALS[$class]->quotes : null;
      if (empty($quotes['methods'])) {
        continue;
      }
      $size = sizeof($quotes['methods']);
      for ($i=0; $i<$size; $i++) {
        if (isset($quotes['methods'][$i]['cost'])){
          $rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
                           'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
                           'cost' => $quotes['methods'][$i]['cost'],
                           'module' => $quotes['id']
          );
        }
      }
    }
  }

  $cheapest = false;
  $size = sizeof($rates);
  for ($i=0; $i<$size; $i++) {
    if (is_array($cheapest)) {
      // never quote storepickup as lowest - needs to be configured in shipping module
      if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
        $cheapest = $rates[$i];
      }
    } else {
      [B]if ($rates[$i]['module'] != 'storepickup') {[/B]
        $cheapest = $rates[$i];
      }
    }
  }
  $this->notify('NOTIFY_SHIPPING_MODULE_CALCULATE_CHEAPEST', $cheapest, $cheapest, $rates);
  return $cheapest;

}

> ... and change the highlighted line to read:
> ```
          if ([B]$size === 1 || [/B]$rates[$i]['module'] != 'storepickup') {

That change enables the storepickup to be selected as the cheapest ... if it's the only shipping method available.

Hi Cindy,

If the only shipping method is storepickup **AND **storepickup contains more than one pickup point, may be with different prices, then $size equals the number of pickup points (not 1).
Thus, $cheapest is false and shipping options are shown but none will be selected.

Tested in:
zc157d
OPC 2.4.6
Site has storepickup as the only shipping method but configured with 5 locations and different prices.
e.g.: Loc_A, 8.5045;Loc_B, 2.5045;Loc_C, 4.5045;Loc_D, 7.5045;Loc_E, 0.5045
To test, I changed shipping.php, round line 216

        } else {
          if ($size === 5 || $rates[$i]['module'] != 'storepickup') {
            $cheapest = $rates[$i];
          }

Thus, $size === 5.
The 5 locations are shown with bullets in the same order and the first bullet is selected (not cheapest!).
Payment options are shown as well.

Without my change in shipping.php, the shipping locations are shown in the same order, none populated and no Payments options are shown, need to refresh the screen to get the payment options (or set 'Payment-Block Action on Shipping Change' to 'Refresh' i.s.o 'Update').

Any suggestions?

Thanks,

@jpda

26 Oct 2023, 4:35 PM
#2680
jpda avatar

jpda

Zen Follower

Join Date:
Jun 2014
Posts:
157
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Zen cart GitHub issue opened: https://github.com/zencart/zencart/issues/4478

Hello Cindy,

I should have sent you this *before *my previous post on october, 25th.

I had changed shipping.php, but the only available shipping method storepickup was not selected as cheapest.
IMHO because storepickup has an option to register more than one pickup point with different prices.

Did some testing described in my post https://www.zen-cart.com/showthread.php?220781-One-Page-Checkout-Support-Thread&p=1397504#post1397504

Thanks,

@jpda