Help needed with Checkout code
I have a CMS style site which I would like to keep the eCart pages within the CMS if possible. Each page in the site is usually referenced like this: index.php?page=xxxx so for the cart page it would be index.php?page=cart.
So, to do a checkout, I need to go to index.php?page=checkout.
Unfortunately the code that takes you to the checkout page includes code that prevents this form of addressing from working as expected.
On my cart page and the page which displays the products the following code is included:
<?php
//WA eCart Redirect Check Out
if (isset($_POST["UndercliffeCart_Checkout_1"]) || isset($_POST["UndercliffeCart_Checkout_1_x"])) {
$Redirect_redirStr="index.php?page=checkout";
if ($Redirect_redirStr != "") {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
if (strpos($Redirect_redirStr, "?") === false) {
$Redirect_redirStr .= "?".$_SERVER['QUERY_STRING'];
}
else {
$Redirect_redirStr .= "&".$_SERVER['QUERY_STRING'];
}
}
$UndercliffeCart->redirStr = $Redirect_redirStr;
}
$UndercliffeCart->cartAction = "Checkout";
}
?>
This means that the query string of the current page is appended to the query string set in the code so I never get to the checkout page.
I have attempted to modify this code without any success. Can anyone suggest a solution please ?
Have attached the cart and products pages.
If this cant be easily achieved then the checkout pages will have to be kept out of the CMS which is not ideal, but if all else fails ......
Thanks.