oc-mall-plugin
oc-mall-plugin copied to clipboard
Create customer from backend
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,
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 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 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.
Hi @SamBrishes , do you maybe have an idea if the fix for this will be published on the short term?
Hi @chocolata,
Well, I'll try to add / fix this in v3.2.2, which should hopefully be released next week.
Sincerely,
Sam.
Thank you so much!