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.

  • kerrie 27 posts 67 karma points
    Sep 29, 2011 @ 18:02
    kerrie
    0

    Custom Product Definitions

    I need to add some additonal information to my product for example ingredients, faq's.  So I have created some product definitions with a data type longText so the user can add the additional data in product admin, checked render in editor and display on website and unchecked variant property as it isnt a variant, great.

    What I am struggling with is amending the product[xslt] so that it pulls through these product definitions.  Any ideas?

    Thanks

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 30, 2011 @ 10:32
    Søren Spelling Lund
    0

    Sounds like you've done everything right.

    Did you edit a product and add some data to it? The product XML will have a new XML attribute with the same name as the one you chose for your new property in uCommerce. It will only show up if it actually contains data.

  • kerrie 27 posts 67 karma points
    Sep 30, 2011 @ 12:18
    kerrie
    0

    Thanks for the reply.

    Yes I have added the data, but just doesnt show up.  I have read the product[XSLT] and I cant see where it is getting this data.  (Although I am no expert).  From what I can see it only seems to pick it up if you change the definition to a product variant, but I dont want it as a product variant, I just want additional info to show with my product.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 30, 2011 @ 15:38
    Søren Spelling Lund
    0

    It should show up under the common tab for the product.

    The article Catalog Foundation Explained: Product Definitions explains in more detail where to find the fields when editing a product.

    Also is is a multilingual field?

  • kerrie 27 posts 67 karma points
    Sep 30, 2011 @ 15:56
    kerrie
    0

    It's showing up fine in the admin, I can see it under the common tab, but what I am having a problem with is showing this data in the front end of the website using the ucommerce shop on the product detail page, just not sure how to get these definitions through using the xslt.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Oct 03, 2011 @ 17:33
    Søren Spelling Lund
    0

    Alrighty. Here's an example of pulling out a value from the product structure in the Product[XSLT].xslt macro:

    <xsl:value-of select="$product/product/@myCustomField" disable-output-escaping="yes" />
    
  • kerrie 27 posts 67 karma points
    Oct 04, 2011 @ 15:17
    kerrie
    0

    Thanks so much!! As easy as that too! 

    Thanks. :)

  • Søren Spelling Lund 1797 posts 2786 karma points
    Oct 04, 2011 @ 20:55
    Søren Spelling Lund
    0

    Perfect. Glad we got it sorted :)

  • Klaus Pedersen 15 posts 71 karma points
    Jan 28, 2013 @ 10:40
    Klaus Pedersen
    0

    How can you get the product definition by razor ?

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Jan 28, 2013 @ 10:45
    Nickolaj Lundgreen
    0

    Hi Klaus

    You can get the product definition object with this:

    product.ProductDefinition

    Is that what you are looking for?

  • Klaus Pedersen 15 posts 71 karma points
    Jan 28, 2013 @ 11:04
    Klaus Pedersen
    0

    Well it sure helped me in the right direction thanks Nickolaj

  • Klaus Pedersen 15 posts 71 karma points
    Jan 28, 2013 @ 12:29
    Klaus Pedersen
    0

    However when call the method GetMediaFields() it lists all the fields correct when i foreach the name is equal to the name in umbraco backend. However how do i extract the value from it?

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Jan 28, 2013 @ 12:45
    Nickolaj Lundgreen
    0

    Just to be clear.

     

    You are trying to get the property from the product right? (the information you store on the product)

     

    In that case this is how you do it (for non multilingual properties):

    product[propertyAlias].Value;

    And this is how you do it for multilingual properties:

    product.GetProperty(propertyAlias, CultureInfo.CurrentCulture.Name).GetValue();

    Ofc. you can replace the culturename if you dont want the current culture :)

  • Scot G 4 posts 24 karma points
    Dec 06, 2013 @ 19:27
    Scot G
    0

    I'm having trouble getting a custom product definition to render in a receipt email.

    Here's the .cshtml snippet:

    Product product = Product.All().Where(x => x.Sku == @orderLine.Sku).Single();

    var resType = product["ResourceType"];

    <div> resType = @resType </div>

    And here's what's being rendered:

    resType = UCommerce.EntitiesV2.ProductProperty

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Dec 06, 2013 @ 21:31
    Nickolaj Lundgreen
    0

    Hi Scot G

     

    I think you are missing a ".Value",  after product["ResourceType"]

     

     

  • Scot G 4 posts 24 karma points
    Dec 09, 2013 @ 18:00
    Scot G
    0

    That did it, Nickolaj.

    Thanks, my own rookie mistake. I was making .Value() a method(and causing an error) rather than just .Value.

  • The One Technologies Developer 6 posts 56 karma points
    Mar 21, 2015 @ 11:41
    The One Technologies Developer
    0

    hi to all , i want to pass products description on worldpay from ucommerce and TransactionLibrary.GetBasket().PurchaseOrder does not provide the any product description field. so how to add this filed in PurchaseOrder class Of ucommerce.EntityV2.PurchaseOrder or any other way to pass products description to worldpay using ucommerce.

     

    Code :

      Dim opProduct As Product
    opProduct = CatalogLibrary.GetProduct(oLine.Sku)
      oBasket.AddProduct(SiteContext.Current.CatalogContext.CurrentCatalog.PriceGroup, opProduct, 1)

     

     

Please Sign in or register to post replies

Write your reply to:

Draft