Jump to content

CraigA

Members
  • Posts

    42
  • Joined

  • Last visited

Posts posted by CraigA

  1. I know this has been asked before, but hopefully there is some kind of solution.

     

    I just had a customer put his credit card information in to a ticket. I want to remove the number so that I can't be held liable in the very slim chance that my Blesta instance/web server gets hacked.

     

    Any ideas?

  2. $coupon = $GET['code'];

    $id = $api->put("Coupons", "add", array('code' => $coupon, 'company_id' => "1", 'max_qty' => "1", 'end_date' => "2013-11-17 03:59:59",'recurring' => "0", 'limit_recurring' => "0", 'packages' => array('0' => "10"), 'currency' => "USD", 'amount' => "100.0000"))->response();

     

    returns "Internal error: Failed to retrieve the default value"

     

    can you point me in the right direction Tyson?

  3. Sounds good.  I'm going to write a utility to iterate through this CSV and import it all the codes then.  If I could get some confirmation on which tables need to be updated that would really help.

    Basically these Wag Jag coupon codes are going to give a 100% discount and will expire November 16th.  I created a special package just for the Wag Jag customers, which got assigned package id "10"

    Looking at the DB I came up with this:
    table: coupons
    fields: id, code, company_id, used_qty, max_qty, start_date, end_date, status, type, recurring, limit_recurring
    table: coupon_amounts
    fields: coupon_id, currency, amount, type
    table: coupon_packages
    fields: coupon_id, package_id

    %fcid% = first coupon code available

    Pseudo code:

    for $i = %fcid% to 1500+%fcid%
       table coupons
            id = $i, code = from csv, company_id = my company id, used_qty = 0, max_qty = 1, start_date = 2013-10-08 00:00:00, end_date = 2013-11-17 00:00:00, status = active, type = exclusive, recurring = 0, limit_recurring = 0
       table coupon_amounts
               coupon_id = $i, currency = my currency, amount = 100.0000, type = percent
       table coupon_packages
               coupon_id = $i, package_id = 10
    loop

    other than these three tables, are there any other tables I would have to update with the utility for a successful import?

  4. Hello all,

      I just upgraded from 3.0.1 to 3.0.4.

     

    I edited the app/controller/client_main.pdt to include custom field data as I have in all previous version, however, the info just isn't showing up anymore in the my info section of the main login for the client.  (echoing the variable shows nothing).

     

     

    app/controller/client_main.pdt

                   $myinfo_settings = array(
    			'invoice' => array(
    				'enabled' => ("true" == $client->settings['client_set_invoice']),
    				'description' => Language::_("ClientMain.myinfo.setting_invoices", true, $invoice_method_language)
    			),
    			'autodebit' => array(
    				'enabled' => true,
    				'description' => $this->getAutodebitDescription()
    			),
    			'customfield' => $field_values[0]->value
    		);

    app/view/client/default/client_main_myinfo.pdt

    $customfield = $this->Html->_($myinfo_settings['customfield'], true);
    echo "Custom field: <b>" . $customfield . "</b><br />";

     

    Any ideas why this isn't working on the new version?

  5. Hello all,

      I'm trying to write something based on the API SDK

     

    $api = new BlestaApi($url, $user, $key);
    $response = $api->get("users", "getByUsername", array('username' => $_GET["username"]));
    $valid = $api->get("users","validatePasswordEquals", array('password' => $_GET["password"], 'user_id' => $response->response()->id));
    
    //setCustomField( integer $field_id, integer $client_id, string $value )
    //getCustomField( integer $field_id, integer $company_id = null )
    $cf = $api->get("Clients","getCustomField", array('field_id' => 5));
    
    print_r($response->response());
    print_r($valid->response());
    print_r($cf->response());
    print_r($response->errors());

    I'm pretty sure someone is going to tell me my logic is wrong here.  Basically what I was going to do here is something along the lines of:
    if $valid->response() = 1
        setCustomField(blah blah blah)
     

    The issue I'm having is although both the client_id and user_id exist in the 'clients' database table, I'm not sure how to equate the user_id to the client_id so that I can use the 'setCustomField' call.

     

    Any help/suggestions/reprimand for not doing this the correct way/pointers on how to do it the correct way?

     

    Thanks,

    Craig

  6. I need confirmation from another on this.

     

    Steps to recreate:

    1) Create a new client via registration form.

    2) Delete that client via admin portal

    3) Create a new client via registration form

    4) See if there is duplicate user data in the "Clients" page on the admin portal. 

     

    I had this earlier this week and had to delete a row manually from the 'contacts' database table.

     

    Regards,

    CraigA

    www.usaccess.ca

  7. Hello Gents,

      I believe I've found a bug with the couponing system.

     

    Steps to recreate are as follows:

     

    1) Create a coupon exclusive to a specific package

    2) Try and apply that coupon to any package

     

    The exclusivity does not stick.  A coupon can be applied to any package.

     

    Regards,

    CraigA

  8. I think Cody's fix from the other thread should be

     

    update /app/models/clients.php (line 89):

    $this->setCustomField($field->name, $client_id, isset($vars['custom']) && array_key_exists($field->name, $vars['custom']) ? $vars['custom'][$field->name] : null);

    to

    $this->setCustomField($field->id, $client_id, isset($vars['custom']) && array_key_exists($field->id, $vars['custom']) ? $vars['custom'][$field->id] : null);

     

    I can confirm this has resolved my issue.

     

    Thanks for the great support guys!

  9. Sounds like a bug with how the order form passes custom field values for validation. I believe custom fields are validated one at a time, so even if all of them are erroneous, only the first error would show.

     

     

    This could be true.  Just wanted to note that mine shouldn't be erroring at all.  It works fine when editing "My Info" once the account is already created. 

  10. That does not work in either scenario (when the client is created manually and then updates their info, or trying to check out as a new customer)

     

    The two regex's I posted work when a client is already created and updates their information.  It just generates and invalid message during checkout with new clients.

×
×
  • Create New...