PDA

View Full Version : cgi-bin check out page error


Breda
25-Apr-2005, 03:13 PM
Hi,
I am getting an error on my check out page, it seems to be on the os00001.pl script.
If you go to this page:
http://www.qualityirishfood.com/acatalog/Stuffings.html
and add the product to the basket, put in a quantity of 6 or more as I have a minimum quantity set there.
When I check out the error on the next page is Line 30, char 1, error: syntax error, and then there is a long url address. If I click ok to get rid of the error box it beings up the 1st address page. I choose the country and click Next and instead of going to the page where you enter the invoice details it just goes back to the product page????

I ahve deleted all the pl and pm files locally and on the server and replaced them with the files in the orginal folder but same error is appearing.
Has anyone come accross this before as I can't see what i'm doing wrong?
Thanks for your help.
Breda

Mike Hughes
25-Apr-2005, 04:01 PM
That looks to me as if it's because you've got comments in your javascript that haven't been commented out with a // or */

Mike

Breda
25-Apr-2005, 05:50 PM
Hi Mike,
Would the javascript be in the os000001.pl or in the previous ca000001.pl or would it be carried from the Act_primarycheckout. I looked in the os00001.pl file and there is no java in it. The only java I can see in these files are the java files that actinic provide in the check out page:
<SCRIPT LANGUAGE="JavaScript" SRC="actiniccore.js" TYPE="text/javascript"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="actinicextras.js" TYPE="text/javascript"></SCRIPT>

Thanks,
Breda

Mike Hughes
25-Apr-2005, 09:37 PM
Breda,

The javascript looks to me like the stuff you've put in the checkout to prevent orders with less than 6 items. I would thinks it's going to be in one of the checkout pages rather than the cgi/perl scripts.

Mike

NormanRouxel
25-Apr-2005, 09:54 PM
Probably Act_Order01.html (also check Act_Order02.html, etc). This bit of JavaScript<script language=JavaScript>
<!--

*
* getCartItem - Gets the Actinic Cart Value & No of Items
*
*************************************************************/
//CART_CONTENT = Cookie name
//1 = TOTAL_VALUE
//3 = CART_COUNT
function getCartItem(index)
{
var act_cart= getCookie("CART_CONTENT")
temp =(act_cart != null) ? temp=act_cart.split("\t"):0;
return (temp.length > 0) ? temp[index] : 0;
}
// -->
</script>can be completely deleted as it is redundant due to being already loaded at the top of the page by the actinicextras.js routines.

Breda
26-Apr-2005, 07:58 AM
Hi Norman, Mike,
I have removed the java script as Norman suggested from order00.html, it dosen't seem to be in order01.html.
I've uploaded it and it no longer gives the error but it still goes back to the product page when you click next after choosing the country instead of going to the page asking for invoie details.

I can't remember how I set the miminum quanity on the shopping cart, perhaps if I removed it that would help?

Regards
Breda

Mike Hughes
26-Apr-2005, 08:26 AM
Hi Breda,

it is probably this bit of javascript which is preventing the next button working.

<input type=SUBMIT name=ACTION2 value="Next>" onClick="if (getCartItem(3) >= 6) {return true;} else {alert('Minimum order is 6 items');return false;}">

Norman will know better than me, but I think the 'name=ACTION2' bit should probably be 'name=ACTION'. Try it and see.

Mike

Breda
26-Apr-2005, 09:14 AM
HI Mike,
Yes you were right I took out the action2 and left the ordinary button in and it's working fine, thanks.
But I still have a problem now in that is there any way I can ensure that there are at least 6 items in the shopping cart as it is not viable to ship any less. It would be better to check this on the 1st shopping cart page as you had to cancel and go back to the shopping cart to change the quantity.

I can't find where in Developer I set this up orginally.
Regards
Breda

Mike Hughes
26-Apr-2005, 10:04 AM
I think the javascript that you had was doing what it should have only the name used was wrong, leading to the perl scripts returning users to the previous page by default.

You could probably use the same javascript on the 'checkout' button on the cart page (and probably on any other checkout buttons you may have on other pages too). I would still use it on the checkout page too, just to make sure you catch any carts that may have slipped past the earlier checks.

Mike

NormanRouxel
26-Apr-2005, 11:17 AM
That JavaScript looks like something I've written (I've done too many snippets to be sure). However it seems that it's been typed in (with assorted typos) rather than copied and pasted.

Here's what it should be:

In Act_Order00.html look for the line <input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON">Replace that line with <input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON"
onClick="if (getCartItem(3) >= 6) {return true;} else {alert('Minimum order is 6 items');return false;}">Which I've tested on V6 and V7 and it works fine.

Breda
26-Apr-2005, 11:38 AM
Hi Norman
Yes it may have been from a site you helped me on before.
I'll try that and let you know,
Regards
Breda