oc-mall-plugin icon indicating copy to clipboard operation
oc-mall-plugin copied to clipboard

Create customer from backend

Open PubliAlex opened this issue 3 years ago • 6 comments

Hello,

When you create a new user using the backend, it's not related to the Customer model used by mall.

As a result, each time Mall try to retrieve the customer model, it display an error, for example the "my account" page :

Argument 1 passed to OFFLINE\Mall\Models\Order::byCustomer() must be an instance of OFFLINE\Mall\Models\Customer, null given, called in /httpdocs/plugins/offline/mall/components/OrdersList.php on line 69

I can understand that the creation of a new user does not systematically create a new customer, can be useful on specific cases, but, at least, we should have an option on the user form to create the corresponding mall customer

Best regards,

PubliAlex avatar Jul 13 '21 08:07 PubliAlex

If you know how to develop, it is quite easy to code. Listening to the create event on the model RainLab.User then create a new customer and attach it to the user. Should be working. But the customer model will miss the addresses which could be an issue later on.

chrisvidal avatar Jul 19 '21 02:07 chrisvidal

@chrisvidal thank you, even if I don't like that, I think I will use the default signup component from mall. I don't really understand why a customer model was created instead of extending the user model (probably a good reason), but I don't have time to investigate at the moment

PubliAlex avatar Jul 20 '21 15:07 PubliAlex

@PubliAlex I had a similar issue with a client who wanted to import a bunch of customers, by company and associate them with customer groups to give them specific discounts.

I already build a Mall Extensions plugin available on the marketplace, I might add in the short term this feature: Bulk import user/customer in MALL.

chrisvidal avatar Jul 21 '21 02:07 chrisvidal

Hi @SamBrishes , do you maybe have an idea if the fix for this will be published on the short term?

chocolata avatar May 02 '24 13:05 chocolata

Hi @chocolata,

Well, I'll try to add / fix this in v3.2.2, which should hopefully be released next week.

Sincerely,
Sam.

SamBrishes avatar May 02 '24 14:05 SamBrishes

Thank you so much!

chocolata avatar May 02 '24 18:05 chocolata