Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Fabio Milheiro 74 posts 136 karma points
    Nov 13, 2012 @ 16:57
    Fabio Milheiro
    0

    How to instantiate PurchaseOrderRenderer?

    There used to be previously a static method called Create():

    http://www.ucommerce.dk/docs/html/M_UCommerce_Xslt_Rendering_PurchaseOrderRenderer_Create.htm

    But it appears to have been removed from uCommerce v3.

    There's a constructor in this class, but what should use in there?

  • Fabio Milheiro 74 posts 136 karma points
    Nov 14, 2012 @ 14:30
    Fabio Milheiro
    0

    The answer to the question is the following:

    var renderer = new PurchaseOrderRenderer(

                                    new OrderLineRenderer(new OrderPropertyRenderer(), new DiscountRenderer()),

                                    new CustomerRenderer(new AddressRenderer()),

                                    new AddressRenderer(),

                                    new ShipmentRenderer(new AddressRenderer()),

                                    new PaymentRenderer(),

                                    new OrderPropertyRenderer(),

                                    new DiscountRenderer());

     

    Found out the implementation of the IXmlRenderers types by searching in this file: \umbraco\ucommerce\Configuration\XmlRenderings.config.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 19, 2012 @ 11:06
    Søren Spelling Lund
    0

    Hi Fabio,

    Thanks for being awesome and posting the reply in the forum.

    A simpler way to instantiate it is the following:

    var purchaseOrderRenderer = ObjectFactory.Instance.Resolve<IXmlRenderer<PurhcaseOrder>>();

    The change was made to make the XML rendering layer fully pluggable. With uCommerce 3 you can swap out any XML renderer and generate the exact XML you want.

    Hope this helps.

  • Fabio Milheiro 74 posts 136 karma points
    Nov 19, 2012 @ 13:00
    Fabio Milheiro
    0

    Thanks for getting back to us with a simpler and more modern way of instantiating that!

    Cheers for that!

    Fabio

Please Sign in or register to post replies

Write your reply to:

Draft