ssossossosso

Forums

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

This topic contains 6 replies, has 3 voices, and was last updated by Artem Liubeznyi Artem Liubeznyi 1 year, 3 months ago.

  • Creator
    Topic
  • #15257

    Kadir Yücel
    Participant

    How can I access addresses or order items of entity “Magento Order” in email templates? Realtions “oneToMany” are not accessible.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #15258
    Artem Liubeznyi
    Artem Liubeznyi
    Oro Core

    Hi Kadir,

    We currently do not support one-to-many relations because there is no way to specify the exact order you want to include into the template.

    One possible solution is to base your template on the Magento Order entity. You will be able to use its address and access customer details via relations too.

    Will this solve your use case?

    #15260

    Kadir Yücel
    Participant

    Thank you Artem for you quick response.

    I can access the customer entity but this not the same like billing and shipping addresses saved in order (table orocrm_magento_order_address). Furthermore I want to list the purchased items for information or invoice purpose.

    Are there any tricks to do that?

    #15261

    Kadir Yücel
    Participant

    What about extending this config with “oneToMany”

    #15263
    Artem Liubeznyi
    Artem Liubeznyi
    Oro Core

    I am not sure about the results of such expansion; most likely, the variable will return only the first address in the collection, but there will be no way to distinguish billing and shipping addresses, nor guarantee that a specific address type will be returned.

    Looks like we need to extend our template capabilities to properly handle one-to-many relations. I will add this feature to our backlog, thank you very much for the heads up. I’ll keep you posted about the implementation progress, too (no idea on the timeline yet though).

    #21117

    roldan
    Participant

    Hi, is thereany news about this feature?

    i’ve created an email template associated to “Order” entity but i get:

    Calling “getlineitems” method on a “OroB2B\Bundle\OrderBundle\Entity\Order” object is not allowed

    How can i access this method in the template? I see that “lineItems” are not displaying in the “Entity variables” tab.

    Here says that “All fields that available in email templates stored in EntityConfigBundle, and can be configured in UI”

    https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/EmailBundle/Resources/doc/email_templates.md

    and it’s true, the property “lineItems” is shown on “Entity management” but not in the template.
    How can i access OneToMany or ManyToMany properties on email templates?

    Thanks in advance!

    #21533
    Artem Liubeznyi
    Artem Liubeznyi
    Oro Core

    No news so far; we have the feature in our backlog but don’t have an implementation timeline yet. Please follow our updates.

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

You must be logged in to reply to this topic.