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.

  • Morgan K. 16 posts 57 karma points
    Feb 12, 2013 @ 18:41
    Morgan K.
    0

    Display individual campaign items using razor

    I'm building a uCommerce site, and I want to display the bulk discounts for a product on it's product page.  I have the campaign items working to provide the discount when the required quantity of that product is added to the cart.  However, I'm having trouble finding documentation on how to display the content thats in the "Ad" tab of my campaign item.

    I've found some forum posts on using xslt, but I'm relatively new and am using razor. If anyone can point me in the right direction, I'd greatly appreciate it!

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Feb 12, 2013 @ 18:50
    Nickolaj Lundgreen
    0

    Hi Morgan

     

    The campaingitems properties works just like the product and category counterpart.

    So to get a multilingual property:

    campaignItem.GetProperty(propertyAlias, CultureInfo.CurrentCulture.Name).GetValue();
  • Morgan K. 16 posts 57 karma points
    Feb 12, 2013 @ 19:12
    Morgan K.
    0

    How would I define campaignItem?  And if I'm trying to get a property named "DiscountAdvertise", as I created a text string with that name underneath the "Default Campaign Item" child of "Definitions", would I be calling it like this?

    @campaignItem.GetProperty("DiscountAdvertise").GetValue()

    Thank you for the quick response, by the way..

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Feb 12, 2013 @ 20:43
    Nickolaj Lundgreen
    100

    I would grap it from:

    ObjectFactory.Instance.Resolve<ITargetingService>().GetTargetedCampaignItems().Where(x=> x.Enabled);

    And make a FirstOrDefault with some parameters (DefinitionType etc.) to fetch the campaign you are looking for

  • Morgan K. 16 posts 57 karma points
    Feb 12, 2013 @ 22:46
    Morgan K.
    0

    I've got it displaying bulk order discounts available on the product page!  I just need to figure out how to get the bulk order discounts displaying/advertised on the pages of the products that I gave the bulk order discounts to.

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Feb 12, 2013 @ 23:03
    Nickolaj Lundgreen
    0

    In order to do that you need to pick the right CampaignItem from TargetedCampaignItems, and use the first code sample i posted

Please Sign in or register to post replies

Write your reply to:

Draft