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?
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.
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.
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.
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?
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 AsProduct opProduct = CatalogLibrary.GetProduct(oLine.Sku) oBasket.AddProduct(SiteContext.Current.CatalogContext.CurrentCatalog.PriceGroup, opProduct, 1)
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
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.
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.
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?
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.
Alrighty. Here's an example of pulling out a value from the product structure in the Product[XSLT].xslt macro:
Thanks so much!! As easy as that too!
Thanks. :)
Perfect. Glad we got it sorted :)
How can you get the product definition by razor ?
Hi Klaus
You can get the product definition object with this:
Is that what you are looking for?
Well it sure helped me in the right direction thanks Nickolaj
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?
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):
And this is how you do it for multilingual properties:
Ofc. you can replace the culturename if you dont want the current culture :)
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
Hi Scot G
I think you are missing a ".Value", after product["ResourceType"]
That did it, Nickolaj.
Thanks, my own rookie mistake. I was making .Value() a method(and causing an error) rather than just .Value.
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 :
is working on a reply...