close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

View Cart - not re-direecting to the view cart page?

Thread began 8/06/2015 6:59 pm by Nathon Jones Web Design | Last modified 8/06/2015 7:35 pm by Nathon Jones Web Design | 414 views | 1 replies

Nathon Jones Web Design

View Cart - not re-direecting to the view cart page?

What's wrong with this code:

<form action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>" method="post" name="quickcartFORM">
<div class="btn-group btn-group-justified" role="group" aria-label="cartbtns">
<div class="btn-group" role="group">
<input name="whiskyCART_View_100" type="submit" class="btn btn-default" role="button" id="whiskyCART_View_100" onClick="MM_goToURL('plugins/parent','view-basket.php');" value="View Basket" />
</div>
<div class="btn-group" role="group">
<input type="submit" name="whiskyCART_Clear_100" id="whiskyCART_Clear_100" class="btn btn-default" role="button" value="Clear Basket" />
</div>
<div class="btn-group" role="group">
<input type="submit" name="whiskyCART_Checkout" id="whiskyCART_Checkout" class="btn btn-default" role="button" value="Checkout" />
</div>
</div>
</form>



I have this on every page of my site with the following above the header:

<?php
//WA eCart Include
require_once("WA_eCart/whiskyCART_PHP.php");
?>
<?php
$whiskyCART->GetContent();
?>
<?php
// WA eCart Clear Cart
if (isset($_POST["whiskyCART_Clear_100"]) || isset($_POST["whiskyCART_Clear_100_x"])) {
$whiskyCART->ClearCart();
$Redirect_redirStr="";
if ($Redirect_redirStr != "") {
$whiskyCART->redirStr = $Redirect_redirStr;
}
$whiskyCART->cartAction = "ClearCart";
}
?>
<?php
//WA eCart Redirect Check Out
if (isset($_POST["whiskyCART_Checkout"]) || isset($_POST["whiskyCART_Checkout_x"])) {
$Redirect_redirStr="";
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'];
}
}

$whiskyCART->redirStr = $Redirect_redirStr;
}
$whiskyCART->cartAction = "Checkout";
}
?>
<?php
// WA eCart Redirect
if ($whiskyCART->redirStr != "") {
if (function_exists("rel2abs")) $whiskyCART->redirStr = rel2abs($whiskyCART->redirStr,dirname(__FILE__));
header("Location: ".$whiskyCART->redirStr);
die();
}
?>



But it doesn't re-direct to cart, it just refreshes the page.

So I tried adding the View Cart button to a blank page, which inserted this into the head section, albeit it inserted it right in the middle of other JS script on the page:

<script type="text/javascript">
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
</script>



You can see this live at
www.nathonjoneswebdesign.co.uk/whiskybroker/

No idea why eCart does this. View Cart shouldn't be this difficult. :(
Hope you can help. Thank you.
NJ

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...