Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

gift certificate tweak Rate Topic   - - - - -

 
  • WebTek
  • Member
  • Authorized Reseller
  • Join Date: 10-Oct 07
  • 109 posts

Posted 19 July 2013 - 09:57 PM #1

Can anyone give me a quick how-to to add the order date stamp of a gift certificate on the gift certificate template?

Gift Certificate template is found: mail>addons>gift_certificates>templates>default.tpl, but I'm not sure how to make the date it was ordered show on the template. What I'm actually trying to to is make it say that it expires 1 year from the date ordered by showing the expire date, but thought that might be asking too much, ha.

In admin when viewing the gift certificate order, there is a date stamp showing there.

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 19 July 2013 - 11:08 PM #2

You need to add the date timestamp in the gift certificate template:-

{$gift.timestamp|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}

Hire StellarBytes for CS-Cart Design & Development Services

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 816 posts

Posted 20 July 2013 - 02:29 AM #3

Just a heads up, in the US, there are state laws that vary from state to state regarding the legality of placing an expiration date on a "Gift Certificates".

CS-Cart Ultimate ver 4.9.3 SP1


 
  • WebTek
  • Member
  • Authorized Reseller
  • Join Date: 10-Oct 07
  • 109 posts

Posted 20 July 2013 - 08:12 PM #4

Great, that worked... except that is today's date stamp. I was hoping to be able to read in the date it was ordered though... and better yet add 365 days to it to arrive at my expire date.

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 20 July 2013 - 10:04 PM #5

Then:-

{$l.timestamp|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}

Those are the two timestamps as shown in the admin for gift certificates.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • 1210891
  • Advanced Member
  • Trial users
  • Join Date: 14-Mar 16
  • 75 posts

Posted 13 April 2016 - 04:14 AM #6

guys, i've tried this and i got my current time

i want to show gift expiration date which is 6 months from it's purchase date, is this possible?

 

Thanks



 
  • CS-Cart team
  • CS-Cart support team
  • Moderators
  • Join Date: 04-Apr 11
  • 3809 posts

Posted 13 April 2016 - 05:35 AM #7

guys, i've tried this and i got my current time

i want to show gift expiration date which is 6 months from it's purchase date, is this possible?

 

Thanks

 

By default gift certificates do not have expiration date so some custom modifications are required.


Sincerely yours, CS-Cart Support Team

 

User guide       |  Developer documentation  |  Core API documentation


 
  • 1210891
  • Advanced Member
  • Trial users
  • Join Date: 14-Mar 16
  • 75 posts

Posted 13 April 2016 - 05:39 AM #8

By default gift certificates do not have expiration date so some custom modifications are required.

 

well i just want to show expiration date, and i will disable it manually



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19782 posts

Posted 13 April 2016 - 06:51 AM #9

well i just want to show expiration date, and i will disable it manually

 

How the expiration date should be calculated? Try something similar to

{$expiration_date = $gift_cert_data.timestamp + (60 * $smarty.const.SECONDS_IN_DAY)}
{$expiration_date|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • 1210891
  • Advanced Member
  • Trial users
  • Join Date: 14-Mar 16
  • 75 posts

Posted 14 April 2016 - 02:59 AM #10

How the expiration date should be calculated? Try something similar to

{$expiration_date = $gift_cert_data.timestamp + (60 * $smarty.const.SECONDS_IN_DAY)}
{$expiration_date|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}

(!) Not tested

 

Hi eComLabs,

thanks for your answer, i've tried your code, but somehow my $gift_cert_data.timestamp value is empty

but after i check on my gift certificate menu on admin panel, it have value and not empty

is there any solution for this?

 

Thanks



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19782 posts

Posted 14 April 2016 - 07:28 AM #11

What CS-Cart version do you use? Try to add the following code to see the whole content of the $gift_cert_data array:

{$gift_cert_data|fn_print_r}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • 1210891
  • Advanced Member
  • Trial users
  • Join Date: 14-Mar 16
  • 75 posts

Posted 15 April 2016 - 01:39 AM #12

 

What CS-Cart version do you use? Try to add the following code to see the whole content of the $gift_cert_data array:

{$gift_cert_data|fn_print_r}

 

i use cs cart version 4.24 for multi store

this is what my array contents:

Array
(
[recipient] => 
[sender] => 
[amount] => 
[message] => 
[send_via] =>
[email] => 
[template] => 
[company_id] => 
[http_location] => 
[subtotal] => 
[display_subtotal] => 
[tax_value] => 
[gift_cert_id] => 
[gift_cert_code] => 
)

 

it don't have timestamp field there



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19782 posts

Posted 15 April 2016 - 07:18 AM #13

Try the following code:

{$_data = $gift_cert_data.gift_cert_id|fn_get_gift_certificate_info:'B'}
{$expiration_date = $_data.timestamp + (60 * $smarty.const.SECONDS_IN_DAY)}
{$expiration_date|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • 1210891
  • Advanced Member
  • Trial users
  • Join Date: 14-Mar 16
  • 75 posts

Posted 18 April 2016 - 02:03 AM #14

 

Try the following code:

{$_data = $gift_cert_data.gift_cert_id|fn_get_gift_certificate_info:'B'}
{$expiration_date = $_data.timestamp + (60 * $smarty.const.SECONDS_IN_DAY)}
{$expiration_date|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}

Thanks, it works !!



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19782 posts

Posted 18 April 2016 - 08:18 AM #15

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jordenaleman
  • Member
  • Authorized Reseller
  • Join Date: 05-Nov 11
  • 27 posts

Posted 29 October 2019 - 04:23 PM #16

How Can I add this in the twig template?

 

thanks Jorden


Jorden
Eyesi Webshops
www.eyesiwebwinkels.com

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19782 posts

Posted 30 October 2019 - 06:02 AM #17

Unfortunately, you cannot use this code in the Twig template. It is required to extend array with available variables for templates to use this data


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jordenaleman
  • Member
  • Authorized Reseller
  • Join Date: 05-Nov 11
  • 27 posts

Posted 30 October 2019 - 08:30 AM #18

any idea how to get this done?

 

Jorden


Jorden
Eyesi Webshops
www.eyesiwebwinkels.com

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19782 posts

Posted 30 October 2019 - 12:37 PM #19

any idea how to get this done?

 

Jorden

 

Please take a look

 

https://docs.cs-cart.../documents.html


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.