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.

  • Murray Roke 503 posts 966 karma points c-trib
    Dec 15, 2014 @ 23:25
    Murray Roke
    0

    OnNew Product event?

    Is something like Product.OnNew += SetDefaultValues() possible with uCommerce?
    specifically 2.0 ?

    I guess it's clear what I need to do is set default values when a product is created, specifically the category (I need to select 2 levels of category, not just the parent level)

    Cheers.
    Murray.

  • Jesper Nielsen 141 posts 498 karma points
    Dec 18, 2014 @ 11:24
    Jesper Nielsen
    0

    Hello Murray,

    From uCommerce 3 and later, one option is to hook into the SaveProduct pipeline.

    Then based upon the data, set the appropriate values.

    For uCommerce 2 and earlier: Sorry! No luck. :-S

    Kind regards,

    Jesper

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Dec 18, 2014 @ 15:08
    Nickolaj Lundgreen
    1

    Hi Murray

    Im haven't tried this myself, but this was how people solved the problem before the SaveProduct-pipelines was introduced: http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/32656-uCommerce-hooking-into-Product-Save-event

  • Morten Skjoldager 440 posts 1499 karma points
    Dec 22, 2014 @ 09:43
    Morten Skjoldager
    0

    Murray, together with the link Nickolaj suggests,

    this article describes how to achieve more specifically:

    http://docs.ucommerce.net/ucommerce/v6/extending-ucommerce/override-default-behavior-in-the-api.html

    You need to register your own version of EditProductPresenter. The default registration is this one:

           <component id="EditProductPresenter"
                       service="UCommerce.Presentation.Presenters.Catalog.EditProductPresenter, UCommerce.Presentation"
                       type="UCommerce.Presentation.Presenters.Catalog.EditProductPresenter, UCommerce.Presentation"
                      >
                <parameters>
                    <saveProductPipeline>${SaveProduct}</saveProductPipeline>
                    <deleteProductPipeline>${DeleteProduct}</deleteProductPipeline>
                </parameters>
            </component>

    You then need to create a class that derrives from: UCommerce.Presentation.Presenters.Catalog.EditProductPresenter

    Hope this helps :) 

  • Murray Roke 503 posts 966 karma points c-trib
    Feb 17, 2015 @ 03:45
    Murray Roke
    0

    A colleague has looked at this and has a question:

    I tried this as per the comments/links above and can't get past this exception:

    "No component for supporting the service UCommerce.Presentation.Presenters.Catalog.EditProductPresenter was found"

    any ideas? thanks

    (I've cross posted the question from: http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/32656-uCommerce-hooking-into-Product-Save-event )

Please Sign in or register to post replies

Write your reply to:

Draft