Jump to content

Customer company field


pengo

Recommended Posts

Hello from New Zealand.

Prestashop is brilliant. We want to use 1.4 for a business to business web store, which requires that customers are identified primarily by their company name (first and last name are still required, but company name is primary). I've found the following relevant posts in this forum:

Make company mandatory in registration process
More customer information needed
How to add a new field to registration form
Adding new fields to new account
How to make company and additional information mandatory

My question is this. Can the /override capability of Prestashop 1.4 be used to achieve the display of company name in the back office Customers tab? We set up accounts for customers, so we're happy entering the information on the Addresses page ... we just want to be able to make that field visible and primary in the back office Customers list.

Thanks,

::Leigh
http://www.else.co.nz/

Link to comment
Share on other sites

Two files have to be edited to display the company name on the Customers tab in the back office. The details are in the last two posts in this thread:
[Tutorial] Ajouter un champ TVA intracommunautaire obligatoire

You can read this en anglais in this Google translation:
[Tutorial] Add a field mandatory VAT

Note that for my purposes (displaying the company name on the Customers tab in the back office) only the last two posts are relevant. Both require changes in admin/tabs/AdminCustomers.php. There are minor tweaks needed to get the second change displaying properly in 1.4, but both work well.

It's a shame this can't be done using the /override functionality ... or maybe it can, but I'm not sure how. Still, keeping a log of all customisations means that at least I know where the bodies are buried when the inevitable upgrade happens.

Link to comment
Share on other sites

  • 3 weeks later...

Nae problemo. In PrestaShop 1.4 there are three required changes in admin/tabs/AdminCustomers.php.

The most straightforward way to explain these is to post my edited file: you can compare it with the original to see what's changed. Each change point is preceded by the comment LH company name. If I can provide any further assistance don't hesitate to ask.

Best wishes,

::Leigh
http://www.else.co.nz/

AdminCustomers.php

Link to comment
Share on other sites

hi,
i would like to add an information on front-offfice in registration, i have already add on back-office by searching on this forum, but anything for the front-office. I use prestashop 1.4.25.
Can i have help?

Link to comment
Share on other sites

Hello Zeckis,

I don't know the answer to this question. I suggest you create a new thread for your request: no-one's likely to notice it tucked away at the bottom of a different topic.

If you go here and click the NEW TOPIC button on the top right you'll be on your way to a useful answer, I hope. Making the question as clear and detailed as you can will help.

Best wishes,

::Leigh
http://www/else.co.nz/

Link to comment
Share on other sites

  • 1 year later...

Hey there, I'm running prestashop 1.4.8.3 and I've tried the modification in AdminCustomers.php. Trouble is that it works for 1 refresh or so, and after that it breaks displaying an error regarding a wrong SQL query.

 

The only pseudo-work-around I've found was renaming the variable that holds the information like so:

 

$this->_select = '(SELECT d.company FROM '._DB_PREFIX_.'address d WHERE d.id_customer = a.id_customer LIMIT 1) as company_2';

 

Again this works for a short while and breaks. Anyone that could enlighten me as to why this is happening?

Link to comment
Share on other sites

You probobly need to look inte the company name field also on the address table, it's limited to 32 chars or something like that, and then also increase the value in classes/Address.php

 

So you thing the issue is because the company name is longer than 32 characters and it conflicts?

 

Later edit: Increased both the table to 128 chars and the formatting in Address.php and it's still failing to execute that SQL. Is there anywhere I can see what the actual error is?

Edited by carvefx (see edit history)
Link to comment
Share on other sites

Hello carvefx, thank you for the message. I found this reference manual for mySQL error log here. I hope this helps!

 

Thank you for this information, but prestashop is being hosted on a shared hosting server and I'm not sure if I can access the mySQL logs.

 

The biggest issue with this is that the error message is extremely vague - nothing specific - just that the SQL query is wrong.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...