Attributes not saving in mshop_order_base_product_attr

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!
kdim95
Advanced
Posts: 200
Joined: 26 Aug 2022, 12:17

Attributes not saving in mshop_order_base_product_attr

Post by kdim95 » 11 Apr 2023, 15:00

Laravel framework version: 9.52.4
Aimeos Laravel version: ~2022.10
PHP Version: 8.2.4
Environment: Linux

Hello,

I have some attributes saved in a product:

When ordering a product, shouldn't the values from the product's "Attributes" section be stored in mshop_order_base_product_attr, because they don't get saved for me.

I tried adding the same attributes in the "Hidden attributes" section, that worked, but I want to use only the first attribute section and have the attributes visible for the product in the frontend.

My goal right now is to retrieve the "Properties" and "Attributes" of the products ( $orderProduct ) in:
/templates/admin/jqadm/order/item.php
So that I can get property items like the product weight and custom attributes I've created.

It's not excluded that in the future I may need to retrieve the "Variant attributes" as well, so it would be useful to know how to do that, too.

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

Re: Attributes not saving in mshop_order_base_product_attr

Post by aimeos » 13 Apr 2023, 13:08

kdim95 wrote: 11 Apr 2023, 15:00 When ordering a product, shouldn't the values from the product's "Attributes" section be stored in mshop_order_base_product_attr, because they don't get saved for me.
Regular attributes are not stored in the ordered product because they are only used for filtering and for informational purpuse but don't have any effect in the ordered product.
kdim95 wrote: 11 Apr 2023, 15:00 I tried adding the same attributes in the "Hidden attributes" section, that worked, but I want to use only the first attribute section and have the attributes visible for the product in the frontend.
Hidden attributes are stored in the ordered product automatically so they can be passed to e.g. the ERP system.
kdim95 wrote: 11 Apr 2023, 15:00 My goal right now is to retrieve the "Properties" and "Attributes" of the products ( $orderProduct ) in:
/templates/admin/jqadm/order/item.php
So that I can get property items like the product weight and custom attributes I've created.
Custom attributes in the sense of attributes where customers can enter own values for are also stored in the ordered product.

If you need standard attributes and properties of the original product, you have to create a decorator that fetches the original product including the attributes and properties so they are available in the template.

If you only need certain properties like weight (which can be also used for shipping calculation), you can use the PropertyAdd basket plugin to add them automatically to the ordered product:
https://aimeos.org/docs/latest/manual/p ... ropertyadd
kdim95 wrote: 11 Apr 2023, 15:00 It's not excluded that in the future I may need to retrieve the "Variant attributes" as well, so it would be useful to know how to do that, too.
The chosen variant attributes are stored in the ordered product as well :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply