Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Location
    London
    Posts
    599
    Plugin Contributions
    0

    Default 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.
    Last edited by bigbadboy; 13 Apr 2008 at 02:16 AM.

  2. #2
    Join Date
    Apr 2008
    Location
    London
    Posts
    599
    Plugin Contributions
    0

    Default 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!


 

 

Similar Threads

  1. All customers fields in ADMIN > CUSTOMERS are empty and I can't delete them!
    By plgaudreau in forum Managing Customers and Orders
    Replies: 1
    Last Post: 26 Feb 2008, 02:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •