I've created a new document type called "Product Page". The document type contains the TeaCommerce product picker so a user can select one or more products for the page.
I have also modified the Product document so that a product can have up to 3 main images and 3 thumbnails. The thumbnails will action "click events" to open up a lightbox gallery.
When I try to list the products on the page, I am getting nothing back. I can retrieve the product node ID but thats about it. Also I am not able to get the current Currency - that returns nothing.
Please could someone throw me a rope as I've spent a day on this and I'm at an absolute loss! There is probably a better way to go about have a product image gallery than modifying the base Product document so any advice on that would be appreciated.
Are you using the starter kit? If yes - which version? Could you try and give screenshot of your document type, and your template or xslt that need to output your product info
But I'm not sure how it will work with the variants, as in the starter kit it use a productImage variable:
<!-- The product image is fetched from either the product or the first variant --> <xsl:variable name="productImageId" select="teacommerce:GetProperty($variant, 'productImage')" /> <xsl:variable name="productImage"> <xsl:if test="$productImageId != ''"> <xsl:value-of select="umbraco.library:GetMedia($productImageId, 0)/umbracoFile" /> </xsl:if> </xsl:variable>
@Anders. I'm using the TeaCommerce 1.4.1.1 BETA version which I installed (ie. I did not install TeaCommerce into an existing Umbraco installation) I do have an option under packages called "Install Starter Kit" but this gives me an error if I click on it.
Screen shots included of the alterations to the "Product" document type and the new document "Product Page". The "Product Page" doc type includes the "Product picker" control and it is the products in this picker that I wish to list on the page.
Screen shots are included below and here is a snippet of my XML (which is currently only retriving the nodeId of the product using the variable $product. The currency and any product properties dont return anything - basically all I can get is the Id of the product node itself.
@Bjarne: Thanks for taking the time to post that code. I think I'm going to need something much more fine tuned (ie. a bit more of a manual process for the user)
Basically I would need them to upload an Image and corresponding thumb for each gallery image. I'm sure this will be ok once I can work out how to get the properties of a product sorted out.
You $currentPage/pageproductlist i think return you a list of id's or an id - you will have to use the GetXmlByNodeId from the umbraco library to get the xml for the product node
The currentCurrency I think you should try and make a copy-of instead of a value-of just to see it there is any data - as there should be that
Ok - I'm a couple of steps forward and have gotten my product to show but am getting an error when I try and add an item to the cart.
The error is as follows: I'm not sure how to find out which property is not being sent correctly.
MESSAGE:
Exception has been thrown by the target of an invocation.
STACKTRACE:
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at TeaCommerce.Presentation.TeaCommerceBase.RequestModule.invokeMethod(restExtension myExtension, Object[] paras)
INNEREXCEPTION:
System.InvalidOperationException: Nullable object must have a value.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at TeaCommerce.Base.FormAddOrderLine(Dictionary`2 fieldKeyValues)
at TeaCommerce.Base.ParseAction(IDictionary`2 vars)
at TeaCommerce.Base.SubmitForm()
Are you adding using the javascript API or server side API? Have you tried to mimic the html mark up of the starter kit to see how that works? Do you have a form element in your template? Is it a asp:form with runat server og just a normal html form that is wrapped about the add to cart button?
I've checked and my rendered html doesnt look any different to the starter kit and I've also checked the variable values which all seem to be correctly in place.
I've reverted back to the boiler plate code for listing the products so its a regular form wrapped around the cart button.
I think I'm going to have to restore the original starter kit and start the whole project again :( - that is unless you know of anyway I can get more detail on this error to actually find out which data the nullable exception is referring to?
Listing products and multiple images
Hi,
I've got myself into a bit of a pickle.
I've created a new document type called "Product Page".
The document type contains the TeaCommerce product picker so a user can select one or more products for the page.
I have also modified the Product document so that a product can have up to 3 main images and 3 thumbnails. The thumbnails will action "click events" to open up a lightbox gallery.
When I try to list the products on the page, I am getting nothing back. I can retrieve the product node ID but thats about it. Also I am not able to get the current Currency - that returns nothing.
Please could someone throw me a rope as I've spent a day on this and I'm at an absolute loss!
There is probably a better way to go about have a product image gallery than modifying the base Product document so any advice on that would be appreciated.
Thanks.
Hi Greyhound
Are you using the starter kit? If yes - which version? Could you try and give screenshot of your document type, and your template or xslt that need to output your product info
Kind regards
Anders
Hi..
I've have just list multiple images using the DAMP 2.0 package and the image cropper datatype.
You can see an example here: http://sub.ak-security.dk/da/shop/category-a/product-a3.aspx where I have combined this with Cloud Zoom
But I'm not sure how it will work with the variants, as in the starter kit it use a productImage variable:
Bjarne
Thanks for the replies.
@Anders. I'm using the TeaCommerce 1.4.1.1 BETA version which I installed (ie. I did not install TeaCommerce into an existing Umbraco installation)
I do have an option under packages called "Install Starter Kit" but this gives me an error if I click on it.
Screen shots included of the alterations to the "Product" document type and the new document "Product Page".
The "Product Page" doc type includes the "Product picker" control and it is the products in this picker that I wish to list on the page.
Screen shots are included below and here is a snippet of my XML (which is currently only retriving the nodeId of the product using the variable $product.
The currency and any product properties dont return anything - basically all I can get is the Id of the product node itself.
<xsl:variable name="currentCurrency" select="teacommerce:GetCurrentCurrency()"/>
<xsl:template match="/">
<xsl:variable name="product" select="$currentPage/pageproductlist"/>
<xsl:value-of select="$product"/>
<hr />
<xsl:value-of select="$product/productTitle"/>
<hr />
<xsl:value-of select="$currentCurrency"/>
xsl:template>
@Bjarne: Thanks for taking the time to post that code. I think I'm going to need something much more fine tuned (ie. a bit more of a manual process for the user)
Basically I would need them to upload an Image and corresponding thumb for each gallery image. I'm sure this will be ok once I can work out how to get the properties of a product sorted out.
Hi Greyhound
You $currentPage/pageproductlist i think return you a list of id's or an id - you will have to use the GetXmlByNodeId from the umbraco library to get the xml for the product node
The currentCurrency I think you should try and make a copy-of instead of a value-of just to see it there is any data - as there should be that
Hi,
Ok - I'm a couple of steps forward and have gotten my product to show but am getting an error when I try and add an item to the cart.
The error is as follows: I'm not sure how to find out which property is not being sent correctly.
Hi Greyhound
Are you adding using the javascript API or server side API? Have you tried to mimic the html mark up of the starter kit to see how that works? Do you have a form element in your template? Is it a asp:form with runat server og just a normal html form that is wrapped about the add to cart button?
Kind regards
Anders
Hi,
I've checked and my rendered html doesnt look any different to the starter kit and I've also checked the variable values which all seem to be correctly in place.
I've reverted back to the boiler plate code for listing the products so its a regular form wrapped around the cart button.
I think I'm going to have to restore the original starter kit and start the whole project again :( - that is unless you know of anyway I can get more detail on this error to actually find out which data the nullable exception is referring to?
Do you have a link to your html so I can see what might cause the problem?
Hi Anders,
I was almost about to give up having started from scratch again this morning. I know have it working thank you.
I've ended searching through the multinode picker to list my products on the page. This was giving me a javascript error and when I added in the :
<div class="productToUpdate" productId="{$productNodeId}" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Product">
line at the top of the form it started working.
Ahh super you got it solved!
Could you mark your own answer as the solution so others can easily find it - would be very helpful
Kind regards
Anders
is working on a reply...