Zen Cart Logo
Forums / All Other Contributions/Addons / Your Store Gift Cards (plastic, etc) - not working yet?

Your Store Gift Cards (plastic, etc) - not working yet?

Views: 8,549

Results 41 to 42 of 42
7 Oct 2018, 2:39 AM
#41
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Your Store Gift Cards (plastic, etc) - not working yet?

kwright:

Greetings,
Hopefully folks are still watching this thread!

Successfully installed on 1.5.4 (localhost) using default settings. After running some test orders, I don't see the gift card numbers, masked or unmasked, on the checkout page or admin order invoice as described in the giftcard_README.txt.

4. Allows for masking of numbers on checkout pages and invoices
5. Allows for displaying any number of digits (not just 4) in masks

Does anyone know if this part is working?

Thanks :D

OK, answering my own question!

Yes, it's broke. If you use spaces between the card numbers as mention under the gift card section on the payment page (Hyphens or spaces optional), it breaks the card number masking code and nothing will displayed.

Here's the fix:

FIND IN includes/modules/order_total/ot_giftcard.php

$pattern = '/^([0-9,a-z,A-Z- ]+)([0-9,a-z,A-Z-]{'.$this->mask_reveal.'})$/';

REPLACE WITH (add a space after the second Z-)

$pattern = '/^([0-9,a-z,A-Z- ]+)([0-9,a-z,A-Z- ]{'.$this->mask_reveal.'})$/';

Here's another tip. By default, the code will mask the first digits. If you would rather mask the last digits (our gift cards have cvv numbers as the last digits), make the following code changes.

FIND IN includes/modules/order_total/ot_giftcard.php

$newformat = preg_replace('([0-9,a-z,A-Z])', $this->mask_char, $matches[1]).$matches[2];

REPLACE WITH

$newformat = $matches[1].preg_replace('([0-9,a-z,A-Z])', $this->mask_char, $matches[2]);

That's all for now! :D

10 Apr 2019, 9:36 PM
#42
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

Re: Your Store Gift Cards (plastic, etc) - not working yet?

Thanks for the update.