adding a new column issue

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
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

adding a new column issue

Post by ahmed31916 » 29 Aug 2022, 20:52

Hello Aimeos,

There are two confusing things.
- The first one: when I add a new column to a table, it does not appear in the collection of that table.
For example, when adding a new column in the customers table, it does not appear in the collection manager for this table.

Code: Select all

^ Aimeos\MShop\Customer\Item\Address\Standard {#478 ▼
  -available: true
  -modified: false
  -prefix: "customer.address."
  #bdata: array:28 [▼
    "customer.address.id" => 15
    "customer.address.parentid" => 38
    "customer.address.company" => ""
    "customer.address.vatid" => ""
    "customer.address.salutation" => ""
    "customer.address.title" => ""
    "customer.address.firstname" => "Test"
    "customer.address.lastname" => ""
    "customer.address.address1" => "11"
    "customer.address.address2" => ""
    "customer.address.address3" => ""
    "customer.address.postal" => "111"
    "customer.address.city" => "AM"
    "customer.address.state" => ""
    "customer.address.countryid" => "PS"
    "customer.address.languageid" => null
    "customer.address.telephone" => "123456789"
    "customer.address.email" => "aa@aa.aa"
    "customer.address.telefax" => ""
    "customer.address.website" => ""
    "customer.address.longitude" => 0.0
    "customer.address.latitude" => 0.0
    "customer.address.position" => 0
    "customer.address.mtime" => "2022-08-29 20:30:54"
    "customer.address.editor" => "Alex FJ"
    "customer.address.ctime" => "2022-08-29 20:30:54"
    "customer.address.siteid" => "1."
    "customer.address.birthday" => null
  ]
- The second thing is when I have a collection of several fields and I want to add an additional field to it.
For example: In the order collection, I want to add the rating field of the product, what should I do?

Code: Select all

^ Aimeos\MShop\Order\Item\Base\Product\Standard {#855 ▼
  -available: true
  -modified: true
  -prefix: "order.base.product."
  #bdata: array:34 [▼
    "order.base.product.id" => 6
    "order.base.product.baseid" => 5
    "order.base.product.siteid" => "1.61."
    "order.base.product.orderproductid" => null
    "order.base.product.productid" => "305"
    "order.base.product.prodcode" => "114099"
    "order.base.product.description" => ""
    "order.base.product.stocktype" => "default"
    "order.base.product.type" => "default"
    "order.base.product.name" => "Test Product"
    "order.base.product.mediaurl" => "aimeos/1.61.d/preview/d/2/d2ccdaa4_Image.webp"
    "order.base.product.timeframe" => ""
    "order.base.product.quantity" => 3.0
    "order.base.product.currencyid" => "USD"
    "order.base.product.price" => "100.00"
    "order.base.product.costs" => "0.00"
    "order.base.product.rebate" => "0.00"
    "order.base.product.taxvalue" => "0.0000"
    "order.base.product.taxrates" => array:1 [▶]
    "order.base.product.taxflag" => 1
    "order.base.product.flags" => 0
    "order.base.product.statusdelivery" => 4
    "order.base.product.position" => 0
    "order.base.product.mtime" => "2022-08-29 18:54:43"
    "order.base.product.editor" => "Alex JA"
    "order.base.product.ctime" => "2022-08-29 18:54:43"
    "order.base.product.target" => ""
    "order.base.product.orderaddressid" => null
    "order.base.product.vendor" => "Test vendor1"
    "order.base.product.qtyopen" => 3.0
    "order.base.product.notes" => ""
    "order.base.product.statuspayment" => 5
    "order.base.product.parentproductid" => ""
    ".product" => null
  ]

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

Re: adding a new column issue

Post by aimeos » 31 Aug 2022, 07:02

The answer to both questions is creating a decorator for the customer manager which cares about the new column:
https://aimeos.org/docs/latest/models/e ... /#easy-way
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply