Forums / Cotonti / Extensions / Support / Module main page blocking js?

tensh
#36534 2012-12-14 07:26

The addtocart() function is a javascript function, and I think you're trying to invoke it from PHP? This won't work as far as I know. Unless that addtocart() function is also a PHP function :)

Also I don't see the method in form, shouldn't it be <form action="(someurl)" name="form1" method="post">? It seems like it goes as a method="get" by default. I don't know where the adding to cart happens, but if outside the plugin then the form action="" would have to point to the script where the magic happens (in your case the shopping cart plugin).

By the way, you don't guard the productid value (dunno how about inside the addtocart() function)- it can be potentially dangerous. You should be using cot_import() function IMO.

I will upload my script today for you, you will see how I solved it (without javascript).