what is the difference between a user and a customer table?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
aimeos
Administrator
Posts: 7914
Joined: 01 Jan 1970, 00:00

Re: what is the difference between a user and a customer table?

Post by aimeos » 30 Nov 2020, 15:15

Ahmad wrote: 29 Nov 2020, 15:14 --- when I change this properties in checkout/address, they don't save in database but other properties change successfully, the element name tag in this page is ca_billing_2[order.base.address.state_id] and ca_billing_2[order.base.address.city_id]
You must name the form input name "state_id" and "city_id" (without the order.base.address prefix) to be added to the item by that code:
https://github.com/aimeos/aimeos-core/b ... #L344-L349
Ahmad wrote: 29 Nov 2020, 15:14 --- I change my customer code from email to telephone as username with $searchConfig in my Customer Manager

Code: Select all

        'customer.code' => array(
            'label' => 'Customer username',
            'code' => 'customer.code',
            'internalcode' => 'lvu."telephone"',
            'type' => 'string',
            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR
        ),
but I don't know what can I do for this in Decorator?
It's not necessary.
Ahmad wrote: 29 Nov 2020, 15:14 --- when I var_dump address in checkout/summary I get MyOrderAddressItem with state_id and city_id without order.base.address. in bdata, is this ok?
Yes, the "order.base.address." prefix is only for non-custom properties.
Ahmad wrote: 29 Nov 2020, 15:14 --- as you say need to extend copyFrom method in my order address item, can I remove my custom Order Address Item and Order Address Manager and replace those with Order Address Decorator like as what I do with customer?
No, decorators can only add functionality to managers, not to items.
But we are working on a patch that automatically transfers custom properties and I will inform you tomorrow if it's done.
Ahmad wrote: 29 Nov 2020, 15:14 --- And I have another problem in checkout/address and that is when for example I change firstname and submit form and redirect back with validation error like as required validation for another field the firstname fill with default value while it should fill with changed value to don't have to type again, what can I do for this?
It works well in the official demo so I guess it has to do with some of your changes.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
aimeos
Administrator
Posts: 7914
Joined: 01 Jan 1970, 00:00

Re: what is the difference between a user and a customer table?

Post by aimeos » 01 Dec 2020, 14:29

aimeos wrote: 30 Nov 2020, 15:15
Ahmad wrote: 29 Nov 2020, 15:14 --- as you say need to extend copyFrom method in my order address item, can I remove my custom Order Address Item and Order Address Manager and replace those with Order Address Decorator like as what I do with customer?
No, decorators can only add functionality to managers, not to items.
But we are working on a patch that automatically transfers custom properties and I will inform you tomorrow if it's done.
The change is ready in aimeos/aimeos-core:2020.10.x-dev
Then, you don't need to extend the order base address manager/item any more for copying custom address properties to the order address item.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

Re: what is the difference between a user and a customer table?

Post by Ahmad » 26 Dec 2020, 12:10

@aimeos
I change copyFrom in my order address item and it works for me, but I need my custom fields in basket because I use them fro calculate delivery service price, but when I get $basket->getAddresses() in my delivery service calcPrice method, this fields are null, how can I get this fields from user or last order address in basket. for more info for you you should be know that when user login and add product in basket and click checkout they redirect to order checkout page, in this scenario in calcPrice I can not access state_id and city_id but if user backward and change address in basket process and go to checkout again this fields has been filled.

please give me a way to retrieve this fields in basket when user don't change address and before that this fields saved in user table and mshop_order_base_address table.

User avatar
aimeos
Administrator
Posts: 7914
Joined: 01 Jan 1970, 00:00

Re: what is the difference between a user and a customer table?

Post by aimeos » 29 Dec 2020, 08:49

You can try to disable the Autofill basket plugin so the user must go through the whole checkout including the address page. With the Autofill plugin enabled and after the user logs in, the last address is automatically added to the basket which may not contain the information yet.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

Re: what is the difference between a user and a customer table?

Post by Ahmad » 29 Dec 2020, 09:02

aimeos wrote: 29 Dec 2020, 08:49 You can try to disable the Autofill basket plugin so the user must go through the whole checkout including the address page. With the Autofill plugin enabled and after the user logs in, the last address is automatically added to the basket which may not contain the information yet.
ok, but you don't understand my problem, I want to Autofill plugin was enable and when user logs in the last address automatically added to the basket with my custom fields state_id and city_id which they saved into the users table and mshop_order_base_address table and their address.

User avatar
aimeos
Administrator
Posts: 7914
Joined: 01 Jan 1970, 00:00

Re: what is the difference between a user and a customer table?

Post by aimeos » 29 Dec 2020, 09:13

Are the state_id and city_id columns already filled in the user and/or user_address table when the user logs in?
Also make sure the Autofill plugin is not configured to use the address from the last order which may not contain this information. Check the "autofill.orderaddress" configuration of the Autofill plugin in the plugin panel.

More information about the settings is available here:
https://aimeos.org/docs/latest/manual/plugins/#autofill
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply