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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
dikruo
Forum Members
Forum Members
Posts: 12
Joined: Sat Jan 24, 2009 10:12 am

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

Post 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
Last edited by dikruo on Wed Apr 01, 2009 6:40 pm, edited 1 time in total.
Duketown

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

Post 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
dikruo
Forum Members
Forum Members
Posts: 12
Joined: Sat Jan 24, 2009 10:12 am

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

Post 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
dikruo
Forum Members
Forum Members
Posts: 12
Joined: Sat Jan 24, 2009 10:12 am

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

Post 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';

}
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

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

Post by Rolf »

Thanks for sharing, dikruo
Just what I was looking for.

grtz. Rolf
Post Reply

Return to “Modules/Add-Ons”