When you get this error - is it different browsers you test in or the same browser it happens in? So if you make an order and get to the confirmation page you have "Land = 1" and if you run it again in same browser with a new order you get "Land = Danmark"?
I had tested it in Chrome.. but I have also tested around 10 orders now in Safari, Firefox and IE and it seems to be the same.. I have also tried sending more orders after each other, but didn't make a difference..
I noticed I had that error before some while ago, but after some time I get Land = Denmark .. also when I created more than one orders.. and I had others to creating orders too, when I get Land = Denmark.. where they also get Land = Denmark.
Works great here. You can always try and use Firebug and type TeaCommerce.getOrder() and see what the country id and country name is. That should give you an idea if something is wrong.
<xsl:output method="html" omit-xml-declaration="yes"/> <!-- WHAT IS THIS FILE? The second cart step where the personal information of the customer is entered. -->
<xsl:template match="CartStep"> <!-- VARIABLES START --> <!-- The Order --> <xsl:variable name="order" select="teacommerce:GetOrderXml()" /> <!-- All countries --> <xsl:variable name="countries" select="teacommerce:GetCountries()" /> <!-- The current country --> <xsl:variable name="currentCountry" select="teacommerce:GetCurrentCountry()" /> <!-- The next step is found dynamically --> <xsl:variable name="nextStep" select="following-sibling::CartStep[1]" /> <!-- The previous step is found dynamically --> <xsl:variable name="prevStep" select="preceding-sibling::CartStep[1]" /> <!-- The total quantity --> <xsl:variable name="totalQuantity"> <xsl:choose> <xsl:when test="$order/@id != ''"> <xsl:value-of select="$order/@totalQuantity" /> </xsl:when> <xsl:otherwise> <xsl:text>0</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="stepId" select="@id" /> <!-- The current steps position in the cart step process is calculated --> <xsl:variable name="cartStepPosition"> <xsl:for-each select="ancestor-or-self::Lang//CartStep"> <xsl:if test="@id = $stepId"> <xsl:value-of select="position()" /> </xsl:if> </xsl:for-each> </xsl:variable> <!-- The steps class is dynamically created --> <xsl:variable name="cartClass"> <xsl:value-of select="concat('stepProgress', $cartStepPosition)" /> <xsl:value-of select="concat(' items', $totalQuantity)" /> </xsl:variable>
How does it get the order into the xslt.. from the xml? It is the same problem I have in both the confirmation e-mail and the backend, where I right now receive the id instead of the country name.. perhaps there is a problem with this, which get the first attribute in the country node in the xml, which is the id. Perhaps there is a way to make sure it use the name attribute?
The order xml is passed as a param in our Tea Commerce code and send to the xslt. The country is a property at the order - so there must be an error in some javascript somewhere because thats how the country property is added to the order.
Then I get the country name instead.. in Chrome which I use as standard browser I deleted the cache and cookies to see the change.. probably because it saves the country information..
I will try to see if I can fix this, so I both get the country name and the scripts update when I change variant and currency. It's a puzzle..
Can I use dictionary items to change the country names? and then use the dictionary item name in Tea Commerce section, where country names are specified?
Okay, I moved the script into the updatePageUI function instead..
function updatePageUI() { /* All xslt's that can be invoked in this way have information in a div with the class "invokeXSLT". For every one of them we update the UI. */ jQuery('div.invokeXSLT:not(div#products div.product div.invokeXSLT)').each(function () { var invokeXSLT = jQuery(this), parent = invokeXSLT.parent(), productid = parent.attr('productid') || _nodeId; htmlFromServer = TeaCommerce.invokeXSLT(invokeXSLT.text(), productid, { umbracoLanguageId: _languageId, async: false }); parent.before(htmlFromServer).remove(); $('.cloud-zoom, .cloud-zoom-gallery').CloudZoom(); $("#product .cloud-zoom").fancybox({ 'centerOnScroll' : true, 'transitionIn' : 'elastic', 'transitionOut' : 'none', 'speedIn' : 600, 'speedOut' : 200, 'overlayShow' : true, 'overlayColor' : '#000', 'cyclic' : true, 'easingIn' : 'easeInOutExpo', 'hideOnContentClick' : false }); $('#carousel ul').carouFredSel({ prev: '#prev', next: '#next', pagination: "#pager", auto: false, pauseOnHover: true, items : { visible: 4, }, scroll : { items: 1, duration: 1000, } }); // Update Uniform script $(function(){ $("#page select, #page input:text, #page textarea, #page input:checkbox, #page input:radio, #page input:file").uniform(); }); });
}
and it should be inside the jQuery "invoke" function there.. it seems to work now and update cloud zoom, carousel and fancybox.. and now I also get the country name in confirmation e-mail and in Tea Commerce.
Order confirmation e-mail with country id
Hi..
I have experienced that the order confirmation mail sometimes writes the country id I think instead of the country name.
This is what the xslt for the e-mail template have:
But it's not always it does this... sometimes I get "Denmark" as it should..
Do you know why this happens?
Bjarne
Hi Bjarne
When you get this error - is it different browsers you test in or the same browser it happens in? So if you make an order and get to the confirmation page you have "Land = 1" and if you run it again in same browser with a new order you get "Land = Danmark"?
Kind regards
Anders
I had tested it in Chrome.. but I have also tested around 10 orders now in Safari, Firefox and IE and it seems to be the same..
I have also tried sending more orders after each other, but didn't make a difference..
I noticed I had that error before some while ago, but after some time I get Land = Denmark .. also when I created more than one orders.. and I had others to creating orders too, when I get Land = Denmark.. where they also get Land = Denmark.
If you try creating an order here: http://sub.ak-security.dk/da/shop.aspx and use "Betal ved afhentning" I think you also will get Land = 1 right now..
Bjarne
Works great here. You can always try and use Firebug and type TeaCommerce.getOrder() and see what the country id and country name is. That should give you an idea if something is wrong.
Kind regards
Anders
It sounds weird that it works for you :)
I had just some others to test it that hadn't tried it before.. and they also get Land = 1 ..
Okay, I'll try that.. where should I type TeaCommerce.getOrder() in Firebug?
Bjarne
In the console of course :)
Thanks.. I noticed there was an small arrow in bottom right corner in the console tab to expand the command editor... and to evaluate..
It gives me: "Id":1,"Name":"Denmark"
I had some others to test the checkout.. they also get the id instead of the country name in the confirmation e-mail..
But I also see the id instead of the country name on the orders/carts in Tea Commerce section..
When I previously noticed the same problem, I think it also was displaying id instead of country name in Tea Commerce section.
Try and make an xsl:copy-of in your xslt to see what data you have for the order
Should I use <xsl:copy-of select="." /> in cart step 2?
It gives me:
No it should be a copy of the tea commerce order of course :)
So I should use <xsl:copy-of select="$order" /> ... where <xsl:variable name="order" select="teacommerce:GetOrderXml()" /> ? :)
It gives me something like:
there you have the country with id="1" and name="Denmark". So maybe something in your xslt isnt correct.
I think it sometimes has worked and in step 2 I have only styled the elements..
The full xslt for step 2 is below..
How does it get the order into the xslt.. from the xml? It is the same problem I have in both the confirmation e-mail and the backend, where I right now receive the id instead of the country name.. perhaps there is a problem with this, which get the first attribute in the country node in the xml, which is the id. Perhaps there is a way to make sure it use the name attribute?
Bjarne
The order xml is passed as a param in our Tea Commerce code and send to the xslt. The country is a property at the order - so there must be an error in some javascript somewhere because thats how the country property is added to the order.
Kind regards
Anders
Hi Anders
Thanks for suggest it might be a javascript error/conflict..
I was getting this error when I change the country dropdown:
So in teaCommerce_Advanced.js file I comment out this:
Then I get the country name instead.. in Chrome which I use as standard browser I deleted the cache and cookies to see the change.. probably because it saves the country information..
I will try to see if I can fix this, so I both get the country name and the scripts update when I change variant and currency. It's a puzzle..
Can I use dictionary items to change the country names? and then use the dictionary item name in Tea Commerce section, where country names are specified?
Bjarne
Okay, I moved the script into the updatePageUI function instead..
and it should be inside the jQuery "invoke" function there.. it seems to work now and update cloud zoom, carousel and fancybox.. and now I also get the country name in confirmation e-mail and in Tea Commerce.
If you want to, you're welcome to test it here: http://sub.ak-security.dk/da/shop.aspx
Bjarne
is working on a reply...