Unknown column credit_limit

Merchant
Fra United States
Medlem siden

Hey Tim!
I'm having the issue with this module as well.
Every time I'm trying to assign a credit limit I'm getting error code:

Fatal error: 1054 - Unknown column 'credit_limit' in 'field list' update lc_customers set code = '', status = '1', email = '', tax_id = '123', company = 'Test LLC', firstname = '', lastname = '', address1 = '123 York Ave', address2 = '', postcode = '10013', city = 'New York', country_code = 'US', zone_code = 'NY', phone = '', different_shipping_address = '0', shipping_company = '', shipping_firstname = '', shipping_lastname = '', shipping_address1 = '', shipping_address2 = '', shipping_postcode = '', shipping_city = '', shipping_country_code = '', shipping_zone_code = '', shipping_phone = '', notes = '', credit_limit = 0, password_reset_token = '', date_blocked_until = NULL, date_expire_sessions = NULL, date_updated = '2024-12-26 19:43:44' where id = 3 limit 1; in ~/includes/library/lib_database.inc.php (Line 199)

Additionally credit limit isn't showing in the customer's profile, instead I'm getting another error code:
Warning: Undefined property: stdClass::$credit_limit in ~/vmods/.cache/pages-edit_account.inc.php (Line 167)

tim
Founder
Fra Sweden
Medlem siden
tim

Your error tells us the database table column credit_limit is missing. Did you do the readme instruction?

 2. Run the following SQL query in your favourite database manager, i.e. phpMyAdmin.
    If your table prefix is not "lc_" you need to adjust the query below so that it uses your table prefix.

     ALTER TABLE `lc_customers`
     ADD COLUMN `credit_limit` FLOAT(11,4) NOT NULL DEFAULT 0 AFTER `shipping_phone`;
Merchant
Fra United States
Medlem siden

Hey Tim!

Thanks for the fast response.
Gotta be 100% honest – I completely disregarded Readme.md. (Jokes on me).

So I did activate both jobs & payment modules
I went into phpMyAdmin and added 'credit_limit' column under 'lc_customers'.

FLOAT(11,4) NOT NULL DEFAULT 0 AFTER `shipping_phone`;

I don't know what it means, honestly and where to insert it. My 'credit_column' looks like this. See screenshot attached.

Thank you in advance!

Most of the errors are gone, can see credit limit available in the cart and in the account.

tim
Founder
Fra Sweden
Medlem siden
tim

Try removing your added column and run the ready made query under the SQL tab instead:

ALTER TABLE `lc_customers` ADD COLUMN `credit_limit` FLOAT(11,4) NOT NULL DEFAULT 0 AFTER `shipping_phone`;

Merchant
Fra United States
Medlem siden

Done. Succcess. Thank you very much.
I also saw that you've updated the module.
Based on what I read from changelog it basically saves time and automates most of the installation.
Did I get that right, so there is no need for me to update the module right now?

tim
Founder
Fra Sweden
Medlem siden
tim

Yes, you are absolutely correct. :)

I started automating the README installation part in my add-ons since 2.6.x and they will slowly all be transitioned one by one.

Merchant
Fra United States
Medlem siden

Smart, so that dummies like me can get things working faster.
Thanks once again!

tim
Founder
Fra Sweden
Medlem siden
tim

Less hassle, fewer support cases, less fiddling.
Win win for everyone :)

In a future version you will be able find, buy, and install add-ons with a click straight from the backend.

Du
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.