Page 1 of 1

[solved] CartMS updateQTY help needed, update doesn't work very neatly.

Posted: Tue Jan 27, 2009 10:07 am
by dikruo
I have a question about updating the quantity when viewing the shopping-cart inside CartMadeSimple.

This is the original code:

Code: Select all

<__script__ language="JavaScript">
function UpdateQty(item)
{	product_id = item.name;
	newQty = item.options[item.selectedIndex].text;
	<!-- I know, the following is not very neatly done, but it works. Sorry :-) // -->
	document.location.href = 'index.php?mact=CartMadeSimple,cntnt01,cart,0&cntnt01product_id='+product_id+'&cntnt01qty='+newQty+'&cntnt01perfaction=update_product';         }
</__script>


When I change the quantity of an item, the updat works fine, everything (total price and such) gets updated perfectly, only thing is that my entire CartMS module gets replaced from it's original page to the homepage.
here you can add products
here you can see the shoppingbasket
and here you can see the shoppingbasket beïng updated inside the HOMEpage

I would very very much like to get the update to be performed inside the current page.
I've tried to alter

Code: Select all

document.location.href
into things like

Code: Select all

this.location.href

Code: Select all

window.location.href
and such. Doesn't work.

If anyone has a solution, please let me know!

Thanx in advance,
Matthijs

Re: CartMS updateQTY help needed, update doesn't work very neatly.

Posted: Mon Feb 09, 2009 5:51 am
by Duketown
dikruo,

I can also see that the updates are done nicely, but how do I (or the customer) know that I'm redirected to the home page. Layout is similar, contents is what I expect it to be.
In other words, I don't see a problem.

Duketown

Re: CartMS updateQTY help needed, update doesn't work very neatly.

Posted: Mon Feb 09, 2009 8:54 am
by dikruo
Hi Duketown,

Now you will see it. I had replaced the homepage template with the template of the other pages. That way you dont see a difference.
If I can't figure out what's going wrong i will end up with a homepage with the same template as the other templates.

I'm sure it has to do with the link that is placed in the original code.
Anyway, thanx for looking at it, and if you don't have an answer, I will settle with the 'new' homepage  :-\

Regards,
Matthijs

Re: CartMS updateQTY help needed, update doesn't work very neatly.

Posted: Wed Apr 01, 2009 6:03 pm
by dikruo
I have a solution
(made by myself :))

I changed the code inside fe_showcart
This line of code is in there right now:

Code: Select all

function UpdateQty(item)
{
	product_id = item.name;
	newQty = item.options[item.selectedIndex].text;
	document.location.href = 'index.php?mact=CartMadeSimple,cntnt01,cart,0&cntnt01product_id='+product_id+'&cntnt01qty='+newQty+'&cntnt01perfaction=update_product';

}
It lacks a redirect to the Shop Made Simple module.

Code: Select all

function UpdateQty(item)
{
	product_id = item.name;
	newQty = item.options[item.selectedIndex].text;
	document.location.href = 'index.php?mact=CartMadeSimple,cntnt01,cart,0&cntnt01product_id='+product_id+'&cntnt01qty='+newQty+'&cntnt01perfaction=update_product&returnmod=ShopMadeSimple&cntnt01returnid=59';

}

Re: [solved] CartMS updateQTY help needed, update doesn't wo

Posted: Mon Mar 07, 2011 2:39 pm
by Rolf
Thanks for sharing, dikruo
Just what I was looking for.

grtz. Rolf