Hi, I'm using TC vers. 2.1.3 and umbraco 6.1.3. My problem is, that in the checkout - cart/view-order-line-overview.cshtml, my Subtotal,Vat and Total price won't update when I change the quantity on the orderline.
And this cart/step-cart-content.cshtml is also not updating I've got not script error.
The minicart is updateing and orderline is updating.
I have a webshop running with Tea Commerce v. 2.1.3 and Umbraco 6.1.6 without problem on updating the cart..
It was developed in a previous version and I have upgraded it some times.. in v. 2.2.0 I had to change some of the methods as some have been removed HasCurrentOrder and HasCurrentFinalizedOrder..
I've checked the code and the only place where it's a bit different is this below. I'm not using - and + to update quantity. I'm using an update to click.
I think it might be something in javascript where it fails.. have you tried to use the debugger in ecommerce.js to see what happens when you e.g. increase the quantity.. here I have a product with price 2.895,00 DKK and after click "+"-button the javascript subtotal with VAT in javascript is 5.790,00 DKK.
Next you can stop the debugger after around lin 134: var cart = jQuery('#cart'); so if you set the marker in line 136 the cart shouldn't be undefined..
Also make sure updateCart function is called here:
TC.bind('afterCartUpdated', function (data, jQForm) {
//Set elements in updating mode
resetUpdatingElements(jQForm, function () {
if(data.order != null){
updateMiniCart(data.order);
updateCart(data.order, true);
}
});
});
and here:
TC.bind('afterAddOrUpdateOrderLine', function (orderLine, data, jQForm) {
var updatingElement = jQForm.closest('.updating');
if (updatingElement.hasClass('item')) {
if (orderLine.quantity <= 0) {
var deleteElement = jQuery('#orderLine' + orderLine.id);
deleteElement.remove();
} else {
updateCartOrderLine(orderLine);
}
updateCart(data.order);
} ...
and here:
TC.bind('afterRemoveOrderLine', function (orderLine, data, jQForm) {
var updatingElement = jQForm.closest('.updating');
if (updatingElement.hasClass('item')) {
//We are updating an order line in the cart
var deleteElement = jQuery('#orderLine' + orderLine.id + ', #orderLine' + orderLine.copiedFromOrderLineId);
deleteElement.remove();
updateCart(data.order);
}
});
Cart won't update Subtotal, Vat and Total price
Hi,
I'm using TC vers. 2.1.3 and umbraco 6.1.3.
My problem is, that in the checkout - cart/view-order-line-overview.cshtml, my Subtotal,Vat and Total price won't update when I change the quantity on the orderline.
And this cart/step-cart-content.cshtml is also not updating
I've got not script error.
The minicart is updateing and orderline is updating.
I can't seem to find where it goes wrong.
Best regards
Palle
Hi Palle
I have a webshop running with Tea Commerce v. 2.1.3 and Umbraco 6.1.6 without problem on updating the cart..
It was developed in a previous version and I have upgraded it some times.. in v. 2.2.0 I had to change some of the methods as some have been removed HasCurrentOrder and HasCurrentFinalizedOrder..
How does your code looks like in these files?
/Bjarne
Hi Bjarne.
I'm not sure where to look for this.
could it be somwting with class and div?
Palle
I think it should be in cart/view-order-line-overview.cshtml
Try to compare with this file I have to see if you have something different?
/Bjarne
ecommerce.js has the following ids, so make sure they exists in your code..
/Bjarne
I've checked the code and the only place where it's a bit different is this below.
I'm not using - and + to update quantity. I'm using an update to click.
I have the ids in the code.
<form action="/base/TC/FormPost.aspx" method="post" class="ajaxForm">
<input name="storeId" type="hidden" value="@storeId" />
<input name="AddOrUpdateOrderLine" type="hidden" value="orderLineId : orderLineId, quantity : quantity, overwriteQuantity : overwriteQuantity" />
<input name="overwriteQuantity" type="hidden" value="true" />
<input name="orderLineId" type="hidden" value="@orderLine.Id" />
<input type="number" name="quantity" class="quantity middle-child overview" value="@orderLine.Quantity.ToString( "0.####" )" />
<input type="image" src="./images/update.png" alt="Opdater" />
</form>
<form action="/base/TC/FormPost.aspx" method="post" class="ajaxForm">
<input name="RemoveOrderLine" type="hidden" value="orderLineId : orderLineId" />
<input name="storeId" type="hidden" value="@storeId" />
<input name="orderLineId" type="hidden" value="@orderLine.Id" />
<input type="image" src="/catalog/view/theme/journal/images/remove.png" class="delete" />
</form>
Palle
It's only updated when I refresh the page
I think it might be something in javascript where it fails.. have you tried to use the debugger in ecommerce.js to see what happens when you e.g. increase the quantity.. here I have a product with price 2.895,00 DKK and after click "+"-button the javascript subtotal with VAT in javascript is 5.790,00 DKK.
Well it seems that the script doens't do anything, when I click on the update image.
Is it because the script can't find the id?
Palle
First make sure the script is included in the template have called after jQuery:
Next you can stop the debugger after around lin 134: var cart = jQuery('#cart'); so if you set the marker in line 136 the cart shouldn't be undefined..
Also make sure updateCart function is called here:
and here:
and here:
As I can tell, all the scripts is called: Can you see anything:
This is my developer url: http://geilsk.attcloud.dk/ ;
Yes, it seems that you are missing the wrapper with id="cart" e.g. a div container..
For that reason these variables will become undefined:
jQuery('#cart'); doesn't return an element.. and the variable cart therefore doesn't contain the element from DOM.
You just need to add e.g. <div id="cart"> inside you <div id="content">, which wraps the cart content..
That should do it..
Hi Bjarne.
That did the trick.
Thanks for your help.
/Palle
I'm glad I could help :) ..
/Bjarne
is working on a reply...