Gift Voucher problems

Phoca Cart - complex e-commerce extension
lpatrick
Phoca Enthusiast
Phoca Enthusiast
Posts: 94
Joined: 13 Feb 2024, 17:00

Re: Gift Voucher problems

Post by lpatrick »

Ah yes thanks but I needed that for selling the images in my project.
A larger image resolution comes at an extra cost.

So it seems it's a general setting and that means we can't do vouchers in our shop or people need to ignore that.

Seems this gift voucher functionality stretches the original Attribute functionality a little ...

With regard to your testing, did you try Cash on Delivery?
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 387
Joined: 07 Nov 2018, 14:55

Re: Gift Voucher problems

Post by Nidzo »

Problem is that main function of gift voucher system does not work. Receiver should receive email with voucher and code but that is not the case. In YouTube tutorial it works well but in latest Betas does not work.

Yes, I tried with Cash on delivery too. No luck.

I don't know is it related but this pops up after first order on fresh installation. After updating database structure problem with voucher persists.
Image

EDIT: The first Beta version that gives error is Beta21. Versions prior gives another one

Image
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Gift Voucher problems

Post by Jan »

Hi, the system needs to store the information about newly ordered coupon in database, and then it can send it per email. If the info is not stored in database, then it will be not sent per email. And this error: "Field 'valid_to' doesn't have a default value" can prevent from storing the coupon into the database.

So the main problem to solve here is to check the structure of the database, so the "valid_to" error does not occur. :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 387
Joined: 07 Nov 2018, 14:55

Re: Gift Voucher problems

Post by Nidzo »

What is the version of Phoca Cart used in this tutorial? And why gift voucher does not work on latest betas?
https://www.youtube.com/watch?v=mmk8br2OhAs
lpatrick
Phoca Enthusiast
Phoca Enthusiast
Posts: 94
Joined: 13 Feb 2024, 17:00

Re: Gift Voucher problems

Post by lpatrick »

I think that tutorial was for version 3.5.7 (see the video at the start).

It did work for me in those new betas of 5, Nidzo.

Maybe you can look in the browser console the moment you place the order. There could be information about what DB input query goes wrong.

Do you want screenshots of my tests?
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 387
Joined: 07 Nov 2018, 14:55

Re: Gift Voucher problems

Post by Nidzo »

Yes please. I would be grateful!
lpatrick
Phoca Enthusiast
Phoca Enthusiast
Posts: 94
Joined: 13 Feb 2024, 17:00

Re: Gift Voucher problems

Post by lpatrick »

So I created a replica of my previous gift card so I'd be sure not to forget what I did exactly.

Here are all the images. The names of the files explain it all.

I'm (kind of) lazy so I did only voucher two values and two publishing options and I didn't even bother creating/selecting small images.

https://imgur.com/a/qE6Z9iS

(Be sure it loads all images, I needed to click to show the final 2)
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 387
Joined: 07 Nov 2018, 14:55

Re: Gift Voucher problems

Post by Nidzo »

Thank you lpatrick for your effort. I did exactly like you before and tried again but problem persist. :x
What should be default value?
"Field 'valid_to' doesn't have a default value"

I searched "valid_to" string in Phoca Cart files. These are results :
Search "valid_to" (89 hits in 26 files of 1287 searched) in administrator\components\com_phocacart
Search "valid_to" (5 hits in 2 files of 313 searched) in components\com_phocacart

Code bellow is directly related to Gift Voucher:

Code: Select all

\components\com_phocacart\layouts\attribute_options_gift.php (1 hit)
	Line 260: $d2['valid_to'] = HTMLHelper::date($defaultDate, Text::_('DATE_FORMAT_LC3'));
	
  \components\com_phocacart\layouts\gift_voucher.php (4 hits)
	Line 179: 	if ($d['valid_to'] != '') {
	Line 180: 		echo '<div'.$s['ph-gift-voucher-date-to'].' class="'.$c['ph-gift-voucher-date-to'].'">'.Text::_('COM_PHOCACART_VALID_TILL').': <span class="phAOGiftDate">'.$d['valid_to'].'</span></div>'. "\n";
	Line 284: 		if ($d['valid_to'] != '') {
	Line 285: 			echo '<div'.$s['ph-gift-voucher-date-to'].' class="'.$c['ph-gift-voucher-date-to'].'">'.Text::_('COM_PHOCACART_VALID_TILL').': <span class="phAOGiftDate">'.$d['valid_to'].'</span></div>'. "\n";
Also I think I found mistype in string VALLID where there are 2 L letters:

Code: Select all

 administrator\components\com_phocacart\views\phocacartcoupons\view.html.php (1 hit)
	Line  96: 			'a.valid_to' 		=> Text::_($this->t['l'] . '_[b]VALLID[/b]_TO'),
  administrator\components\com_phocacart\views\phocacartdiscounts\view.html.php (1 hit)
	Line 89: 			'a.valid_to' 		=> Text::_($this->t['l'] . '_[b]VALLID[/b]_TO'),
lpatrick
Phoca Enthusiast
Phoca Enthusiast
Posts: 94
Joined: 13 Feb 2024, 17:00

Re: Gift Voucher problems

Post by lpatrick »

The 'Valid to' should come from the Gift Expiration Date you set (and in your initial post you say you set it to 09 June 2024).

Image

Did you type in the date or did you use the date selection gadget?
What did you set as Timezone for your admin user?

What do you see in the order confirmation overview? What date is set there and what is the Gift type number (0?)?

Image
lpatrick
Phoca Enthusiast
Phoca Enthusiast
Posts: 94
Joined: 13 Feb 2024, 17:00

Re: Gift Voucher problems

Post by lpatrick »

Nidzo wrote: 16 Apr 2024, 21:20 Also I think I found mistype in string VALLID where there are 2 L letters:

Code: Select all

 administrator\components\com_phocacart\views\phocacartcoupons\view.html.php (1 hit)
	Line  96: 			'a.valid_to' 		=> Text::_($this->t['l'] . '_[b]VALLID[/b]_TO'),
  administrator\components\com_phocacart\views\phocacartdiscounts\view.html.php (1 hit)
	Line 89: 			'a.valid_to' 		=> Text::_($this->t['l'] . '_[b]VALLID[/b]_TO'),
Yes I think those are wrong but as far as I can see, they would only be related to sorting and not to the problem you're having.
Post Reply