<a href="address.aspx" class="button right pad">Checkout</a> <input type="submit" value="Update Cart" class="button right pad"></input> </form> </div> </section> </xsl:template>
<xsl:template name="updateBasketTemplate"> <xsl:if test="CommerceLibrary:HasBasket()"> <xsl:for-each select="CommerceLibrary:GetBasket()/purchaseOrder/lineItems/lineItem"> <!-- Update highest index first in case we're deleting thus shrinking the list --> <xsl:sort select="@index" data-type="number" order="descending"/>
<!-- Find the name of the posted quantity change --> <xsl:variable name="postedQuantity" select="umbraco.library:RequestForm(concat('quantityInput_', @index))"/> <xsl:variable name="result" select="CommerceLibrary:UpdateLineItem(@index, $postedQuantity)"></xsl:variable> </xsl:for-each> <xsl:variable name="pipelineResult" select="CommerceLibrary:ExecuteBasketPipeline()"></xsl:variable> </xsl:if> </xsl:template>
There was an issue with uCommerce version 2.0.2.0 which caused uCommerce to not pick up the new shipping method when a different one was assigned to the basket. Could you try updating to 2.0.5.0 and see if your issue might be related to it?
When you upgrade uCommerce will leave the database in the state it's currently in, but it will reset any configuration changes you've made to the uCommerce sections in web.config, pipelines, and configs in /configuration. Backups will be left behind though so you can safely replace those once the installation is done.
I have just upgraded my uCommerce but the shipping fee issue is still not fixed! Instead after the upgrade, as I was doing some testing, I just stumbled to another error.
In my store summary, When I want to generate reports! I get this error:
Server Error in '/' Application.
Could not find a setter for property 'VariantSku' in class 'UCommerce.EntitiesV2.Queries.Transactions.ProductSalesSummary'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: NHibernate.PropertyNotFoundException: Could not find a setter for property 'VariantSku' in class 'UCommerce.EntitiesV2.Queries.Transactions.ProductSalesSummary'
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
Server Error in '/' Application.
The value "System.Object[]" is not of type "UCommerce.EntitiesV2.StoreSalesSummary" and cannot be used in this generic collection. Parameter name: value
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: The value "System.Object[]" is not of type "UCommerce.EntitiesV2.StoreSalesSummary" and cannot be used in this generic collection. Parameter name: value
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: The value "System.Object[]" is not of type "UCommerce.EntitiesV2.StoreSalesSummary" and cannot be used in this generic collection.
Parameter name: value]
System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) +122
System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) +150
NHibernate.Util.ArrayHelper.AddAll(IList to, IList from) +1011
NHibernate.Impl.SessionImpl.ListCustomQuery(ICustomQuery customQuery, QueryParameters queryParameters, IList results) +271
NHibernate.Impl.SessionImpl.List(NativeSQLQuerySpecification spec, QueryParameters queryParameters, IList results) +232
NHibernate.Impl.SessionImpl.List(NativeSQLQuerySpecification spec, QueryParameters queryParameters) +214
NHibernate.Impl.SqlQueryImpl.List() +226
UCommerce.EntitiesV2.Queries.Transactions.StoreSalesSummaryQuery.Execute(ISession session) +416
UCommerce.EntitiesV2.Repository`1.Select(ICannedQuery`1 query) +106
UCommerce.Web.UI.Umbraco.UCommerce.Analytics.SalesTotals.ReportButton_Click(Object sender, EventArgs e) +306
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +141
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +149
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +39
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +37
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +87
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4188
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
How strange. That particular error was fixed in version 2.0.2.0. Are you sure that the update went as expected? Try installing and take a look at the log and see if any errors were produced.
Typically upgrades fail due to permissions issues with writes to particular folders.
Hi Soren, I had to unistall al the uCommerce version and reinstall it again. The Issue the reporting has been fixed. But the Shipping fe is still not been sorted out.
I am using the default shipping method. All I did is,I updated it.I modified it and gave it my own name,changed the shipping area to ZAR(South Africa) and gave it a ZAR pricing group!!
I'm going to have to take a peek at the site myself to get to the bottom of this. Could you zip up the site and database and send it to me via e-mail at ssl AT ucommerce DOT dk? Thanks a bunch.
Shipping Fee not displaying.
Hi I have a problem with me shipping fee not dispalying on the site. I am suing this XSLT code to get this information:
<xsl:value-of select="CommerceLibrary:FormatCurrency($cart/purchaseOrder/@shippingTotal)"/>
I have defined my Shipping fee in the backoffice and gave it access to my store front but it doesnt show
And because of this, then ucommerce calculate incorrect values.
Enabled
Currency
Price Group
Price
ZAR
ZAR
DKK
DKK
EUR
EUR
GBP
GBP
USD
USD
Do you execute the basket pipeline after the new shipping method is selected? Could you post the order XML so I can take a peek at it? Thanks.
Hi Soren,
Please check below is my XSLT to get my Cart
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:CommerceLibrary="urn:CommerceLibrary"
exclude-result-prefixes="msxml umbraco.library CommerceLibrary">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<script type="text/javascript">
<![CDATA[
$(document).ready(function() {
$('.toggleDiscount').click(function() {
var toggleId = $(this).attr('toggleid');
toggleDiscount(toggleId);
});
});
function toggleDiscount(id)
{
$('#'+id).slideToggle('normal');
}
]]>
</script>
<!-- Check if there's any post back -->
<xsl:variable name="isPostback" select="umbraco.library:RequestForm('quantityInput_0')"/>
<!-- Get Shipment Methods-->
<xsl:variable name="ShipmentMethod" select="CommerceLibrary:GetShippingMethods('Shipment')/shippingMethods/shippingMethod" />
<xsl:if test="string-length(umbraco.library:RequestForm('voucherCode'))">
<xsl:call-template name="addVoucherTemplate"></xsl:call-template>
</xsl:if>
<xsl:if test="string-length($isPostback)">
<xsl:call-template name="updateBasketTemplate"></xsl:call-template>
</xsl:if>
<xsl:choose>
<xsl:when test="CommerceLibrary:HasBasket()">
<xsl:call-template name="basketTemplate"></xsl:call-template>
</xsl:when>
<xsl:otherwise>
Your basket is empty.
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="basketTemplate">
<section id="content" class="generic-page clearfix">
<div class="inner content-area">
<h1>
Your Cart
</h1>
<form method="post">
<xsl:variable name="cart" select="CommerceLibrary:GetBasket()"/>
<table id="cart" cellspacing="0" class="cart">
<tr>
<th colspan="2">Product & Description</th>
<th>Item Price</th>
<th>VAT</th>
<th>Quantity</th>
<th>Total</th>
</tr>
<xsl:for-each select="$cart/purchaseOrder/lineItems/lineItem">
<tr class="product-row">
<td colspan="2">
<span class="desc">
<xsl:value-of select="@sku"/>
</span>
</td>
<td>
<xsl:choose>
<xsl:when test="@unitDiscount != 0">
<span style="text-decoration:line-through">
R <xsl:value-of select="CommerceLibrary:FormatCurrency(@price)"/>
</span>
R <xsl:value-of select="CommerceLibrary:FormatCurrency(@price - @unitDiscount)"/>
</xsl:when>
<xsl:otherwise>
R <xsl:value-of select="CommerceLibrary:FormatCurrency(@price)"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
R <xsl:value-of select="CommerceLibrary:FormatCurrency(@vat)"/>
</td>
<td>
<input type="text" class="quantityInput">
<xsl:attribute name="value">
<xsl:value-of select="@quantity"/>
</xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select="concat('quantityInput_', @index)"/>
</xsl:attribute>
</input>
</td>
<td>
R <xsl:value-of select="CommerceLibrary:FormatCurrency(@total)"/>
</td>
</tr>
</xsl:for-each>
<tr>
<td colspan="3" class="total"> </td>
<td colspan="2" class="total">Subtotal:</td>
<td colspan="1" class="total">
R <xsl:value-of select="CommerceLibrary:FormatCurrency($cart/purchaseOrder/@subTotal)"/>
</td>
</tr>
<tr>
<td colspan="3"> </td>
<td colspan="2" class="vat">VAT Total:</td>
<td colspan="1" class="vat">
R <xsl:value-of select="CommerceLibrary:FormatCurrency($cart/purchaseOrder/@vat)"/>
</td>
</tr>
<tr>
<td colspan="3"> </td>
<td colspan="2" class="vat">Shipping Fee:</td>
<td colspan="1" class="vat">
R <xsl:value-of select="CommerceLibrary:FormatCurrency($cart/purchaseOrder/@shippingTotal)"/>
</td>
</tr>
<tr>
<td colspan="3"> </td>
<td colspan="2" class="vat">
<strong>Total Incuding VAT:</strong>
</td>
<td colspan="1" class="vat">
<strong>
R <xsl:value-of select="CommerceLibrary:FormatCurrency($cart/purchaseOrder/@orderTotal)"/>
</strong>
</td>
</tr>
</table>
<a href="address.aspx" class="button right pad">Checkout</a>
<input type="submit" value="Update Cart" class="button right pad"></input>
</form>
</div>
</section>
</xsl:template>
<xsl:template name="updateBasketTemplate">
<xsl:if test="CommerceLibrary:HasBasket()">
<xsl:for-each select="CommerceLibrary:GetBasket()/purchaseOrder/lineItems/lineItem">
<!-- Update highest index first in case we're deleting thus shrinking the list -->
<xsl:sort select="@index" data-type="number" order="descending"/>
<!-- Find the name of the posted quantity change -->
<xsl:variable name="postedQuantity" select="umbraco.library:RequestForm(concat('quantityInput_', @index))"/>
<xsl:variable name="result" select="CommerceLibrary:UpdateLineItem(@index, $postedQuantity)"></xsl:variable>
</xsl:for-each>
<xsl:variable name="pipelineResult" select="CommerceLibrary:ExecuteBasketPipeline()"></xsl:variable>
</xsl:if>
</xsl:template>
<xsl:template name="addVoucherTemplate">
<xsl:variable name="voucherAdded" select="CommerceLibrary:AddVoucher(umbraco.library:RequestForm('voucherCode'))"/>
</xsl:template>
</xsl:stylesheet>
There was an issue with uCommerce version 2.0.2.0 which caused uCommerce to not pick up the new shipping method when a different one was assigned to the basket. Could you try updating to 2.0.5.0 and see if your issue might be related to it?
Hi Soren,
How do I upgrade? Is there a way I can just install new DLLs only? If I re-install the new version will it not overwrite my customisations?
When you upgrade uCommerce will leave the database in the state it's currently in, but it will reset any configuration changes you've made to the uCommerce sections in web.config, pipelines, and configs in /configuration. Backups will be left behind though so you can safely replace those once the installation is done.
You can check out Checklist for Updating uCommerce for lots and lots of details on what happens.
The recommended way to upgrade is to run the installer.
Hi Soren,
I have just upgraded my uCommerce but the shipping fee issue is still not fixed! Instead after the upgrade, as I was doing some testing, I just stumbled to another error.
In my store summary, When I want to generate reports! I get this error:
Server Error in '/' Application.
Could not find a setter for property 'VariantSku' in class 'UCommerce.EntitiesV2.Queries.Transactions.ProductSalesSummary'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: NHibernate.PropertyNotFoundException: Could not find a setter for property 'VariantSku' in class 'UCommerce.EntitiesV2.Queries.Transactions.ProductSalesSummary'
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
Server Error in '/' Application.
The value "System.Object[]" is not of type "UCommerce.EntitiesV2.StoreSalesSummary" and cannot be used in this generic collection.
Parameter name: value
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: The value "System.Object[]" is not of type "UCommerce.EntitiesV2.StoreSalesSummary" and cannot be used in this generic collection.
Parameter name: value
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
How strange. That particular error was fixed in version 2.0.2.0. Are you sure that the update went as expected? Try installing and take a look at the log and see if any errors were produced.
Typically upgrades fail due to permissions issues with writes to particular folders.
Hi Soren, I had to unistall al the uCommerce version and reinstall it again. The Issue the reporting has been fixed. But the Shipping fe is still not been sorted out.
I forgot to ask: Are you using a custom shipping method service for calculating shipping price or the default one?
I am using the default shipping method. All I did is,I updated it.I modified it and gave it my own name,changed the shipping area to ZAR(South Africa) and gave it a ZAR pricing group!!
I'm going to have to take a peek at the site myself to get to the bottom of this. Could you zip up the site and database and send it to me via e-mail at ssl AT ucommerce DOT dk? Thanks a bunch.
I will zip up the project and send it to you.
is working on a reply...