Forums / All Other Contributions/Addons / Add Customers from Admin

Add Customers from Admin

Locked

Started by bigbadboy on 13 Apr 2008, 1:13 AM · Views: 1,836

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
13 Apr 2008, 1:13 AM
#1
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Add Customers from Admin

I've just installed this conrib and have a problem.

Installed, working fine except when I click 'insert' I get this error:
Fatal error: Call to undefined function zen_create_coupon_code() in /home/PATH/TO/ADMIN/add_customers.php on line 325

Line 325 is:
$coupon_code = zen_create_coupon_code();

Which is in:
if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
$coupon_code = zen_create_coupon_code();
$insert_query = $db->Execute("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
$insert_id = $db->Insert_ID();
$db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )");

This occurs whether I enter a code or not.

Also, if I make a mistake when entering details, an error displays (which is good) but when I correct the error and click 'insert again' it says that the email address already exists. I am then stuck on the same page but the customer has been created.

Any way to get this sorted?

I am using 1.3.8a and the error is with both versions whether I enter a voucher code or not.

13 Apr 2008, 1:42 AM
#2
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: Add Customers from Admin

An update on this.

I commented out the lines:
if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
$coupon_code = zen_create_coupon_code();
$insert_query = $db->Execute("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
$insert_id = $db->Insert_ID();
$db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )");

and the } on line 374

And it now seems to work fine.
The email is created and sent.

Obviously I need to adjust the email but it mentions a gift voucher. I have created a test coupon (which is the same as mentioned) but didn't include it when I signed up the new customer. Worryingly the URL for the gift voucher is a link to admin which is actually a 404.

Well .. at least it works now!

:smile: