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

One-Page Checkout [Support Thread]

Views: 629,413

Results 941 to 960 of 3,078
18 Sep 2018, 5:51 PM
#941
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

One-Page Checkout [Support Thread]

Thanks for the snappy reply, I know your swamped!
I use Square

18 Sep 2018, 6:01 PM
#942
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

You might try looking at /includes/classes/cc_validation.php.

18 Sep 2018, 6:05 PM
#943
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Thank you and I’ll report back on my findings.

18 Sep 2018, 6:19 PM
#944
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

I don't see the immediate fix.

<?php
/**
 * cc_validation Class.
 *
 * @package classes
 * @copyright Copyright 2003-2016 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: Author: DrByte  Mon Jul 27 18:24:22 2015 -0400 Modified in v1.5.5 $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
/**
 * cc_validation Class.
 * Class to validate credit card numbers etc
 *
 * @package classes
 */
class cc_validation extends base {
  var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year;

  function validate($number, $expiry_m, $expiry_y, $start_m = null, $start_y = null) {
    $this->cc_number = preg_replace('/[^0-9]/', '', $number);
    // NOTE: We check Solo before Maestro, and Maestro/Switch *before* we check Visa/Mastercard, so we don't have to rule-out numerous types from V/MC matching rules.
    if (preg_match('/^(6334[5-9][0-9]|6767[0-9]{2})[0-9]{10}([0-9]{2,3}?)?$/', $this->cc_number) && CC_ENABLED_SOLO=='1') {
      $this->cc_type = "Solo"; // is also a Maestro product
    } else if (preg_match('/^(49369[8-9]|490303|6333[0-4][0-9]|6759[0-9]{2}|5[0678][0-9]{4}|6[0-9][02-9][02-9][0-9]{2})[0-9]{6,13}?$/', $this->cc_number) && CC_ENABLED_MAESTRO=='1') {
      $this->cc_type = "Maestro";
    } else if (preg_match('/^(49030[2-9]|49033[5-9]|4905[0-9]{2}|49110[1-2]|49117[4-9]|49918[0-2]|4936[0-9]{2}|564182|6333[0-4][0-9])[0-9]{10}([0-9]{2,3}?)?$/', $this->cc_number) && CC_ENABLED_MAESTRO=='1') {
      $this->cc_type = "Maestro"; // SWITCH is now Maestro
    } elseif (preg_match('/^4[0-9]{12}([0-9]{3})?$/', $this->cc_number) && CC_ENABLED_VISA=='1') {
      $this->cc_type = 'Visa';
    } elseif (preg_match('/^5[1-5][0-9]{14}$/', $this->cc_number) && CC_ENABLED_MC=='1') {
      $this->cc_type = 'MasterCard';
    } elseif (preg_match('/^3[47][0-9]{13}$/', $this->cc_number) && CC_ENABLED_AMEX=='1') {
      $this->cc_type = 'American Express';
    } elseif (preg_match('/^3(0[0-5]|[68][0-9])[0-9]{11}$/', $this->cc_number) && CC_ENABLED_DINERS_CLUB=='1') {
      $this->cc_type = 'Diners Club';
    } elseif (preg_match('/^(6011[0-9]{12}|622[1-9][0-9]{12}|64[4-9][0-9]{13}|65[0-9]{14})$/', $this->cc_number) && CC_ENABLED_DISCOVER=='1') {
      $this->cc_type = 'Discover';
    } elseif (preg_match('/^(35(28|29|[3-8][0-9])[0-9]{12}|2131[0-9]{11}|1800[0-9]{11})$/', $this->cc_number) && CC_ENABLED_JCB=='1') {
      $this->cc_type = "JCB";
    } elseif (preg_match('/^5610[0-9]{12}$/', $this->cc_number) && CC_ENABLED_AUSTRALIAN_BANKCARD=='1') {
      $this->cc_type = 'Australian BankCard'; // NOTE: is now obsolete
    } else {
      return -1;
    }

    if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) {
      $this->cc_expiry_month = $expiry_m;
    } else {
      return -2;
    }

    $current_year = date('Y');
    if (strlen($expiry_y) == 2) $expiry_y = intval(substr($current_year, 0, 2) . $expiry_y);
    if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) {
      $this->cc_expiry_year = $expiry_y;
    } else {
      return -3;
    }

    if ($expiry_y == $current_year) {
      if ($expiry_m < date('n')) {
        return -4;
      }
    }

    // check the issue month & year but only for Switch/Solo cards
    if (($start_m || $start_y) && in_array($this->cc_type, array('Switch', 'Solo'))) {
      if (!(is_numeric($start_m) && ($start_m > 0) && ($start_m < 13))) {
        return -2;
      }

      if (strlen($start_y) == 2) {
        if ($start_y > 80) {
          $start_y = intval('19' . $start_y);
        } else {
          $start_y = intval('20' . $start_y);
        }
      }

      if (!is_numeric($start_y) || ($start_y > $current_year)) {
        return -3;
      }
      if (!($start_y >= ($current_year - 10))) {
        return -3;
      }
    }
    return $this->is_valid();
  }

  function is_valid() {
    $cardNumber = strrev($this->cc_number);
    $numSum = 0;

    for ($i=0; $i<strlen($cardNumber); $i++) {
      $currentNum = substr($cardNumber, $i, 1);

      // Double every second digit
      if ($i % 2 == 1) {
        $currentNum *= 2;
      }

      // Add digits of 2-digit numbers together
      if ($currentNum > 9) {
        $firstNum = $currentNum % 10;
        $secondNum = ($currentNum - $firstNum) / 10;
        $currentNum = $firstNum + $secondNum;
      }

      $numSum += $currentNum;
    }

    // If the total has no remainder it's OK
    return ($numSum % 10 == 0);
  }
}
18 Sep 2018, 7:07 PM
#945
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

On further inspection (aren't demo sites wonderful?), it appears that the text is being added by the Square payment method's jQuery (see /includes/modules/pages/checkout_one/jscript_square.php). The values displayed appear to be coming back from an AJAX call to Square.

You might try posting in that payment-method's support-thread for more details.

18 Sep 2018, 7:15 PM
#946
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Thank you for your time Cindy,
Yes, when I inspected with firefox I found the following 3 files that make a call for this text.
Ex: sq-card-brand which when you type in two number is appears with the text visa.

I will submit a thread in the square module.

Mark

19 Sep 2018, 11:43 PM
#947
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

v1.5.5f ... NOT URGENT

Hi Cindy, I hope you are well. I've searched the thread and cannot find a reference to this - guests using credit card are not showing up in admin/customers/customers whereas those who use PayPal are showing. In configuration/one page checkout I have 'enable account registration' set to true .... and in admin/modules/payment/PayPal Express have Express Checkout: Automatic Account Creation set to Yes (which explains why PayPal users are being registered).

I noticed this when using admin/tools/send email when I was sending 'select' emails and many 'orders' entries did not show up in 'customers'. So many guests will not be included for email marketing.

I'm not sure if I have missed something somewhere?

cheers,
Mike

20 Sep 2018, 7:51 AM
#948
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: One-Page Checkout [Support Thread]

That's the way this module currently functions. If you need to see the guests as customers you might need to use a different one. And OPC doesn't have a checkbox to opt in to email marketing or a newsletter for guests. It might seem spammy to send marketing emails to customers that didn't ask to be emailed and if they report the spam it can have negative consequences for your domain.

20 Sep 2018, 11:42 AM
#949
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

shags38:

v1.5.5f ... NOT URGENT

Hi Cindy, I hope you are well. I've searched the thread and cannot find a reference to this - guests using credit card are not showing up in admin/customers/customers whereas those who use PayPal are showing. In configuration/one page checkout I have 'enable account registration' set to true .... and in admin/modules/payment/PayPal Express have Express Checkout: Automatic Account Creation set to Yes (which explains why PayPal users are being registered).

I noticed this when using admin/tools/send email when I was sending 'select' emails and many 'orders' entries did not show up in 'customers'. So many guests will not be included for email marketing.

I'm not sure if I have missed something somewhere?

cheers,
Mike

lankeeyankee:

That's the way this module currently functions. If you need to see the guests as customers you might need to use a different one. And OPC doesn't have a checkbox to opt in to email marketing or a newsletter for guests. It might seem spammy to send marketing emails to customers that didn't ask to be emailed and if they report the spam it can have negative consequences for your domain.
Mike, as @lankeeyankee indicated, that's OPC working-as-designed. If a customer placed an order as a guest, they've implicitly opted-out of any email marketing from the site.

Upon order completion, a guest is given the opportunity to create an account, but if they didn't ...

20 Sep 2018, 10:08 PM
#950
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

@lankeeyankee and Cindy - thank you both for your responses .... all is good. Just as a matter of clarification, in configuration settings what does enabling 'enable account registration' actually do? ... or is that answered in your last line Cindy? ... 'Upon order completion, a guest is given the opportunity to create an account'

cheers,
Mike

21 Sep 2018, 1:12 PM
#951
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

The OPC's Registered Accounts (which that configuration setting enables) enables your store's customers to create a slimmed-down account (no ship-to/bill-to addresses are recorded in the customer's account).

Unlike a guest-checkout, this customer has a *unique *customer-account with minimal data-gathering (good for GDPR). A customer with a registered account can do anything that one with a "normal" account can, except that they need to enter their address information each time they place an order.

24 Sep 2018, 11:51 PM
#952
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

OPC 1.1.0 (yes, I know it's old but I didn't see any reference in version changes that would have addressed this particular issue)
ZC 1.5.4

When checking out using store credit funds and store credit funds exceed order total, a payment type is required even though the balance due is $0. Resulting in endless loop (from customer comment)

Use Store Credit funds minus one cent and selecting payment type completes order as expected.

25 Sep 2018, 11:41 AM
#953
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

Could you provide a link to the Store Credits module that you're using, Rick?

25 Sep 2018, 1:39 PM
#954
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

AFAIK, it is the store credit that is built in ???

I may have 'changed' the words 'gift certificate' to 'store credit'. Need to get through first coffee of the day and I'll check.

TNX Cindy

25 Sep 2018, 1:56 PM
#955
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

lat9:

Could you provide a link to the Store Credits module that you're using, Rick?

Built in GV code with text labels renamed to Store Credit

Since we have a 100% manual admin intervention rate for built in Gift Certificates, we changed the labels. Zero customers have been able to follow the instructions for GV redemption via automated system.

25 Sep 2018, 2:06 PM
#956
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: One-Page Checkout [Support Thread]

Was that GIT issue #85?

that I missed?

25 Sep 2018, 3:28 PM
#957
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

RixStix:

Was that GIT issue #85?

that I missed?
Most likely. That change was incorporated into OPC v1.2.0 and later.

26 Sep 2018, 2:13 PM
#958
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]

Updating a site that also uses snap affiliates. Wanted to make sure I merged correctly since admin/orders changes coincide.

Merged version for notifiers:```

<?php//-bof-one_page_checkout-lat9-Additional notifiers to enable additional order status-icons. *** 1 of 2 *** $extra_legends = ''; $zco_notifier->notify('NOTIFY_ADMIN_ORDERS_MENU_LEGEND', array(), $extra_legends); ?>
      <tr>
        <td class="smallText"><?php echo TEXT_LEGEND . ' ' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', TEXT_BILLING_SHIPPING_MISMATCH, 10, 10) . ' ' . TEXT_BILLING_SHIPPING_MISMATCH . $extra_legends . snap_affiliates_image();  //-snap_affiliates-lat9  *** 5 of 6 *** ?>
      </tr>
<?php //-eof-one_page_checkout-lat9-Additional notifiers to enable additional order status-icons. *** 1 of 2 *** ?>
26 Sep 2018, 2:37 PM
#959
lat9 avatar

lat9

Administrator

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

Re: One-Page Checkout [Support Thread]

That looks right, @dbltoe. Note that the ?> is not exactly commented-out, since it takes precedence over the in-line comment added by SNAP.

26 Sep 2018, 2:48 PM
#960
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]

THANX:hug:

Wanted to make sure the trifocals were seeing it correctly.:cool: