Gift Certificate Problems / Configuration

I have attached a copy of the gift certificate that I generated with the cart. However, you will notice that the code is not visible in the email. Why is that and how can I fix this. If I preview it through the admin it works great.

samplegift.jpg

I actually tested this as well and it does not show the code for me as well. If I do a preview in the admin screen it shows fine. Anyone have any ideas?

Anyone else have this problem or an answer to this problem?

problem here to

I put a bug in the bug tracker for this issue. Here

Check the bugtracker as a working solution has been provided. I have already made the code change and now it works as it should.

Thanks this is now fixed.

hi I had a look at the bug tracker as i have the missing code,.

What am I supposed to do with it?





Thanks in advance

In order to fix this - replace this code in the “addons/gift_certificates/include/admin/gift_certificates.php” file:



if ($mode == 'do_update') {
if(!empty($gift_cert_data) && !empty($gift_cert_id)){

if (isset($gift_cert_data['gift_cert_code'])) {
unset($gift_cert_data['gift_cert_code']);
}
if (!isset($gift_cert_data['products'])) {
$gift_cert_data['products'] = array();
}

//Change certfificate status
fn_change_gift_certificate_status($gift_cert_id, $gift_cert_data['status'], $certificate_status, (isset($notify_user) ? $notify_user : ''));

//if difference then add line in log
$debit_info = db_get_row("SELECT debit AS amount, debit_products AS products FROM $db_tables[gift_certificates_log] WHERE gift_cert_id='$gift_cert_id' ORDER BY timestamp DESC");

if(empty($debit_info)){
$debit_info = db_get_row("SELECT amount, products FROM $db_tables[gift_certificates] WHERE gift_cert_id='$gift_cert_id'");
}

$is_diff = (($gift_cert_data['amount'] - $debit_info['amount'] != 0) || (md5(serialize($gift_cert_data['products'])) != md5($debit_info['products']))) ? 'Y' : 'N';
if ($is_diff == 'Y'){
$_info = array(
'amount' => $gift_cert_data['amount'],
'products' => serialize($gift_cert_data['products'])
);
fn_add_gift_certificate_log_record($gift_cert_id, $debit_info, $_info);
}

//Update certificate data
$_data = fn_check_table_fields($gift_cert_data, $db_tables['gift_certificates']);
$_data = fn_array_merge($_data, array('products' => (!empty($_data['products']) ? @serialize($_data['products']) : '')));
db_update_by_array($db_tables['gift_certificates'], $_data, "gift_cert_id='$gift_cert_id'");


if (!defined('GIFT_CERTIFICATE_EMAIL_SENT') && !empty($notify_user) && $gift_cert_data['email'] && $gift_cert_data['send_via'] == 'E') {
$templates = fn_get_gift_certificate_templates();




with this one



if ($mode == 'do_update') {
if(!empty($gift_cert_data) && !empty($gift_cert_id)){

if (!isset($gift_cert_data['products'])) {
$gift_cert_data['products'] = array();
}

//Change certfificate status
fn_change_gift_certificate_status($gift_cert_id, $gift_cert_data['status'], $certificate_status, (isset($notify_user) ? $notify_user : ''));

//if difference then add line in log
$debit_info = db_get_row("SELECT debit AS amount, debit_products AS products FROM $db_tables[gift_certificates_log] WHERE gift_cert_id='$gift_cert_id' ORDER BY timestamp DESC");

if(empty($debit_info)){
$debit_info = db_get_row("SELECT amount, products FROM $db_tables[gift_certificates] WHERE gift_cert_id='$gift_cert_id'");
}

$is_diff = (($gift_cert_data['amount'] - $debit_info['amount'] != 0) || (md5(serialize($gift_cert_data['products'])) != md5($debit_info['products']))) ? 'Y' : 'N';
if ($is_diff == 'Y'){
$_info = array(
'amount' => $gift_cert_data['amount'],
'products' => serialize($gift_cert_data['products'])
);
fn_add_gift_certificate_log_record($gift_cert_id, $debit_info, $_info);
}

//Update certificate data
$_data = fn_check_table_fields($gift_cert_data, $db_tables['gift_certificates']);
$_data = fn_array_merge($_data, array('products' => (!empty($_data['products']) ? @serialize($_data['products']) : '')));
db_update_by_array($db_tables['gift_certificates'], $_data, "gift_cert_id='$gift_cert_id'");


if (!defined('GIFT_CERTIFICATE_EMAIL_SENT') && !empty($notify_user) && $notify_user == 'Y' && $gift_cert_data['email'] && $gift_cert_data['send_via'] == 'E') {
$templates = fn_get_gift_certificate_templates();

Brilliant thankyou, worked!!

I guess this becomes easier after a while ( I hope so)

This fixes the problem for monetary gift certificates but not when we add Free Products to the gift certificate, they don’t appear…

[quote name=‘gugga7’]This fixes the problem for monetary gift certificates but not when we add Free Products to the gift certificate, they don’t appear…[/QUOTE]

Is this bug and gugga7’s fixed yet in 1.3.5 SP4?



Thank you.