Thanks for testing the .NET part and all it corner cases :) We will try and look into it. Could you try and write the specific cases that you tested and what you think is wrong with the output or data?
You're having problems because the Starter Kit assumes the orderlines are NOT unique. You will have to change a few details in you teacommerce_advanced.js file. Mind you that I could not test the code below, but it should work... in theory :)
Plus/minus functionality will be changed to this:
/* UPDATE ORDERLINE QUANTITY */
jQuery('.minus, .plus').live('click', function () {
var button = jQuery(this),
orderlineEle = button.closest('.orderLine'),
orderlineid = orderlineEle.attr('orderlineid'),
productId = orderlineEle.attr('nodeid'),
changeQuantity = 1;
//Plus and minus will increase or decrease the quantity by oneif (button.hasClass('minus')) {
changeQuantity = -1;
}
//Using addOrderLine we count the orderline quantity up or down
TeaCommerce.addUniqueOrderLine(productId, orderlineid, changeQuantity, true, function (data) {
//When the server answers we update the specific orderlineif (data.OrderLinesUpdated[0]) {
updateOrderLineInUI(orderlineEle, data.OrderLinesUpdated[0]);
}
});
returnfalse;
});
Removing the unique orderline will need to look something like this:
/* REMOVE ORDERLINE */
jQuery('.remove').live('click', function () {
var button = jQuery(this),
orderlineEle = button.closest('.orderLine'),
orderlineid = orderlineEle.attr('orderlineid'),
productId = orderlineEle.attr('nodeid');
//We use removeOrderLine to remove the orderline on the server
TeaCommerce.removeUniqueOrderLine(orderlineid, true, function () {
//When the server answers we update the orderline in the UI
removeOrderLineFromUI(orderlineEle);
});
});
Yes, it works OK with the new script for anything added with CreateUniqueOrderLine although doesn't now work of course with anything added with CreateOrderLine such as Product A1 on the homepage from the starter kit but I guess you can't have it both ways. ;)
In general though there seems to be a refreshing problem with the cart-content page from the multilanguage starter kit. Add Product A1 from the homepage for example, then go to the cart-content page, click delete or reduce the quantity and the all the totals will be updated to 0 but the item will still be displayed in the list until you refresh the page.
This doesn't really pose much of a problem for me as I will probably be creating my own control to render the cart contents, but at least I know that I'm using CreateUniqueOrderLine correctly rather than thinking I was creating a problem I'd have ot deal with later.
That's good. Most of it anyways. I'm sure it's a minor javascript thing going wrong in the cart.
You can actually have both unique and non unique orderlines in the cart at the same time. They will just need updating in different ways. I will soon be updating the Starter Kit and Multilanguage Kit to support both methods. Then I will see if there's anything that could be done easier or better.
Am I using CreateUniqueOrderLine correctly?
I was playing with CreateUniqueOrderLine in V1.4.1 beta and got some funny results when viewing the cart content with cartStep01.xslt.
If I call the code below a couple of times:
The product is displayed twice as expected but I noticed that the VAT amounts were not being updated correctly.
I also found that changing the quantities or trying to delete an orderline caused things to go even more wrong.
Hi Matt
Thanks for testing the .NET part and all it corner cases :) We will try and look into it. Could you try and write the specific cases that you tested and what you think is wrong with the output or data?
Thanks mate
I'm having trouble with my 'Event' product which inherits from the standard 'Product' doc type.
If I navigate to my 'Event' product page and add it to the basket using the following code in my .Net control
all appears fine when I display the cart contents.
I navigate back to the 'Event' product page and repeat the process
all still seems fine (although when I did this on Friday the cart totals seemed a little messed up.
I clicked 'Delete' on the 2nd item but this had no effect.
I then tried reducing the quantity to 0 of the 1st orderline and although this did update all the totals, it continued to show two items.
I then refreshed the page to find that 3 items were now being displayed, one of them with a negative quantity.
So the question is, am I doing something wrong when calling CreateUniqueOrderLine or is there a bug?
Regards,
Matt
Hi Matt
Thanks for info - we will look into it
Hi Matt,
You're having problems because the Starter Kit assumes the orderlines are NOT unique. You will have to change a few details in you teacommerce_advanced.js file. Mind you that I could not test the code below, but it should work... in theory :)
Plus/minus functionality will be changed to this:
Removing the unique orderline will need to look something like this:
That should do the trick.
/Rune
Hi Matt
Did you manage to get it working?
Hi Anders & Rune,
Yes, it works OK with the new script for anything added with CreateUniqueOrderLine although doesn't now work of course with anything added with CreateOrderLine such as Product A1 on the homepage from the starter kit but I guess you can't have it both ways. ;)
In general though there seems to be a refreshing problem with the cart-content page from the multilanguage starter kit.
Add Product A1 from the homepage for example, then go to the cart-content page, click delete or reduce the quantity and the all the totals will be updated to 0 but the item will still be displayed in the list until you refresh the page.
This doesn't really pose much of a problem for me as I will probably be creating my own control to render the cart contents, but at least I know that I'm using CreateUniqueOrderLine correctly rather than thinking I was creating a problem I'd have ot deal with later.
Regards,
Matt
That's good. Most of it anyways. I'm sure it's a minor javascript thing going wrong in the cart.
You can actually have both unique and non unique orderlines in the cart at the same time. They will just need updating in different ways. I will soon be updating the Starter Kit and Multilanguage Kit to support both methods. Then I will see if there's anything that could be done easier or better.
/Rune
Thanks Rune.
is working on a reply...