Gift card

Phoca Cart - complex e-commerce extension
klimajan
Phoca Member
Phoca Member
Posts: 17
Joined: 12 Dec 2023, 16:09

Gift card

Post by klimajan »

Hey guys, I am having a hard time setting up gift card - and yes I know about the youtube video tutorial but that doesnt help here. I am a bit lost atm... :(

So what I need:

- gift card as a product with 3 options: 1000, 3000, 5000,-
- I do NOT want a customer to fill up any fields - I simply want the person that bought it to receive gift card with the amount and coupon code but I do not want them to fill any fields (eg.: I dont want them to have the ability to send the gift card to the person they wanna give it to - I want customer to manage - either print it or whatever)
- I also wanna change the design of pdf card sent to customer email (no problem with php, JS or anything and I know phoca cart now a bit already - just need to point in the right direction)

So it should be easier than regular gift card but I have 2 issues:

1) First issue is my last answer here: https://www.phoca.cz/forum/viewtopic.ph ... 24#p182724 basically I can see error: Field 'valid_from' doesn't have a default value
2) I can't get past the step where in publishing options of a product I select gift card type (Typ dárkového poukazu) - every time I enter the expiration date I get: Call to a member function format() on false

Can you please help me a bit? My phoca is the last stable 4.0.11. I also have a dev website where I can test it. :|

Tags:
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 405
Joined: 07 Nov 2018, 14:55

Re: Gift card

Post by Nidzo »

klimajan
Phoca Member
Phoca Member
Posts: 17
Joined: 12 Dec 2023, 16:09

Re: Gift card

Post by klimajan »

Thank you but that doesnt really answer this... First - I saw Jan in second post says to check for obsolete columns but doesnt really say what to do - should I remove the columns or what? The structure looks ok. Iam on latest v4 and do not want beta this is an ecommerce in production I can't use beta here. I have a copy of it as a test environment.

Also - it doesnt solve the fact that I cant actually SAVE the valid_to value in phoca cart admin as it fails as I said in my first post.
klimajan
Phoca Member
Phoca Member
Posts: 17
Joined: 12 Dec 2023, 16:09

Re: Gift card

Post by klimajan »

But yes the coupons are not stored when I finish the order but I still have no idea what to do.
klimajan
Phoca Member
Phoca Member
Posts: 17
Joined: 12 Dec 2023, 16:09

Re: Gift card

Post by klimajan »

So I solved the first error by adjusting valid_from and valid_to fields default value to current_timestamp - no idea if this is OK but it seems to work.

But that still doesnt cahnge the fact that I cant save the gift card product when I add the Gift Type and select some expiry date....
klimajan
Phoca Member
Phoca Member
Posts: 17
Joined: 12 Dec 2023, 16:09

Re: Gift card

Post by klimajan »

What a hell! So I am on a right track - if it helps anyone - based on this:

https://forum.joomla.org/viewtopic.php?t=989703

The error Call to a member function format() on false - I noticed I had it in multiple places across Phoca Cart admin - it has nothing to do with Phoca its actually some bug in Joomla language system :-D When I change the admin lang to en_US it all works but my default cs_CZ doesnt... Will update here when I know more.
klimajan
Phoca Member
Phoca Member
Posts: 17
Joined: 12 Dec 2023, 16:09

Re: Gift card

Post by klimajan »

Got it. So - there is a bug in Joomla cs-CZ language pack. In Administrator->language->cs-CZ->joomla.ini search for this:

Code: Select all

DATE_FORMAT_CALENDAR_DATE="%d.%m.%Y"
and when I changed it to this (which corresponds with Phoca gift coupon publishing option for expiration date) it works fine. No more Call to a member function format() on false:

Code: Select all

DATE_FORMAT_CALENDAR_DATE="%Y-%m-%d"
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 405
Joined: 07 Nov 2018, 14:55

Re: Gift card

Post by Nidzo »

Great to hear that. Thank you. Your summary reports could be helpful for someone in future.
Post Reply