ssossossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

Forums Forums OroCommerce How to add product attribute programmatically

This topic contains 13 replies, has 3 voices, and was last updated by  mmiasnikov 4 months, 2 weeks ago.

  • Creator
    Topic
  • #32487

    Dima Makaruk
    Participant

    How to add product attribute programmatically in a Migration and assign it to an Attribute Family and Group?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Author
    Replies
  • #32489

    msulima
    Moderator

    Hello, Dima Makaruk.

    Adding new data attribute requires schema update. So, it may take long time.

    At first, you should add extended field to entity. Let it be enum field.

    Next code in fact makes attribute from enum field.

    Also, please, see example of adding attribute here: LoadDefaultAttributesData
    Example, of creation family and group: LoadProductDefaultAttributeFamilyData

    #32490

    Dima Makaruk
    Participant

    Hi msulima,

    thank you for the info.

    I have already added one enum field in Entity Management , after that i’m getting an error:

    Looks like a problem in filter.

    The field config looks as follows:

    #32491

    msulima
    Moderator

    Which migration did you use?

    #32492

    Dima Makaruk
    Participant

    I’ve added the field in backend in Entity management

    #32493

    msulima
    Moderator

    Hm, maybe it is an issue. But still please try code from links that I poster above.
    And, please steps to reproduce issue with enum field.

    #32494

    Dima Makaruk
    Participant

    In System > Entities > Entity manager i’ve found the Product entity in grid and added a multiselect field with 2 options. After that the column for the field was added in the oro_product table and the config was created for the field. The table for enum values also exists.

    Now it is also not possible to edit this field in the Entity manager:

    #32495

    msulima
    Moderator

    Please, give me version of your application. I’ll try to reproduce that bug.
    Also please tell, did you click Update schema button?

    #32496

    Dima Makaruk
    Participant
    #32497

    msulima
    Moderator

    Oh, this version currently not supported anymore. Please, update version of your application.

    #32498

    Dima Makaruk
    Participant

    Hi

    I’ve tried to update to 1.3

    https://github.com/orocrm/commerce-crm-enterprise.git was not found.

    #32499

    Dima Makaruk
    Participant

    In the master branch of the application this dependency “oro/commerce-crm-ee”: “1.3.*” is not there any more and i could install all the dependencies.

    How is it possible to install the 1.3 version of the app ?

    #32500

    Dima Makaruk
    Participant

    Which stable version of the application ‘orocommerce-enterprise-application’ should i use for the update ?

    #32501

    mmiasnikov
    Moderator

    Hi, Dima.

    As an Enterprise edition user, you should direct you questions to dedicated Enterprise support site and team: http://support.orocommerce.com.

    Sincerely

Viewing 13 replies - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.