View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

data assist ecart & search

Thread began 11/17/2009 2:02 pm by chaintm153675 | Last modified 11/19/2009 5:25 pm by chaintm153675 | 935 views | 5 replies

chaintm153675

===========================
Found the issue and fixed.

The script is not placing the cart php data tie in correctly. It puts it in the location that you you select to put the "add cart button" so a section. Moving the
==============================
<?php
//WA eCart Include
require_once("WA_eCart/MoonJumpCart_PHP.php");
?>
===============
to the top of the page above the
==============
<?php
$MoonJumpCart->GetContent();
?>
====================
solved this issue, don't know why I kept missing this. so in the end...

my script looks like this now...
=====================
<?php require_once('Connections/mjconn.php'); ?>
<?php
//WA eCart Include
require_once("WA_eCart/MoonJumpCart_PHP.php");
?>
<?php
$MoonJumpCart->GetContent();
?>
<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: mjrslistprod;
//Searchpage: ;
//Form: ;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((((isset($_POST["search"]))?$_POST["search"]:"") != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
$KeyArr1 = array("ItemName");

//comparison list additions
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($_POST["search"]))?$_POST["search"]:"") ."","OR","Includes",",%20","%20","%22","%22",0);

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_product_search"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_product_search"]) && $_SESSION["WADbSearch1_product_search"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_product_search"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$maxRows_mjrslistprod = 6;
$pageNum_mjrslistprod = 0;
if (isset($_GET['pageNum_mjrslistprod'])) {
$pageNum_mjrslistprod = $_GET['pageNum_mjrslistprod'];
}
$startRow_mjrslistprod = $pageNum_mjrslistprod * $maxRows_mjrslistprod;

mysql_select_db($database_mjconn, $mjconn);
$query_mjrslistprod = "SELECT * FROM items";
setQueryBuilderSource($query_mjrslistprod,$WADbSearch1,false);
$query_limit_mjrslistprod = sprintf("%s LIMIT %d, %d", $query_mjrslistprod, $startRow_mjrslistprod, $maxRows_mjrslistprod);
$mjrslistprod = mysql_query($query_limit_mjrslistprod, $mjconn) or die(mysql_error());
$row_mjrslistprod = mysql_fetch_assoc($mjrslistprod);

if (isset($_GET['totalRows_mjrslistprod'])) {
$totalRows_mjrslistprod = $_GET['totalRows_mjrslistprod'];
} else {
$all_mjrslistprod = mysql_query($query_mjrslistprod);
$totalRows_mjrslistprod = mysql_num_rows($all_mjrslistprod);
}
$totalPages_mjrslistprod = ceil($totalRows_mjrslistprod/$maxRows_mjrslistprod)-1;

$queryString_mjrslistprod = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_mjrslistprod") == false &&
stristr($param, "totalRows_mjrslistprod") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_mjrslistprod = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_mjrslistprod = sprintf("&totalRows_mjrslistprod=%d%s", $totalRows_mjrslistprod, $queryString_mjrslistprod);
?>
<?php
// WA eCart AddToCart
if (isset($_POST["MoonJumpCart_1_ATC"]) || isset($_POST["MoonJumpCart_1_ATC_x"])) {
$ATC_itemID = $_POST["MoonJumpCart_1_ID_Add"];
$ATC_AddIfIn = 0;
$ATC_RedirectAfter = "cart.php";
$ATC_RedirectIfIn = "";
if (isset($totalRows_mjrslistprod) && $totalRows_mjrslistprod > 0) {
$row_mjrslistprod = WAEC_findRecordMySQL($mjrslistprod, "ItemID", $ATC_itemID);
if ($row_mjrslistprod) {
$ATC_itemName = "".$row_mjrslistprod['ItemName'] ."";// column binding
$ATC_itemDescription = "".$row_mjrslistprod['ItemShortDesc'] ."";// column binding
$ATC_itemWeight = floatval("".$row_mjrslistprod['ItemWeight'] ."");// column binding
$ATC_itemQuantity = "".$_POST["MoonJumpCart_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_mjrslistprod['ItemPrice'] ."");// column binding
$ATC_itemSize = "".$row_mjrslistprod['ItemSize'] ."";// column binding
$ATC_itemThumbpic = "".$row_mjrslistprod['ItemThumb'] ."";// column binding
mysql_data_seek($mjrslistprod, 0);
$row_mjrslistprod = mysql_fetch_assoc($mjrslistprod);
}
}
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$MoonJumpCart->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice, $ATC_itemSize, $ATC_itemThumbpic);
if ($ATC_RedirectAfter != "" && $MoonJumpCart->redirStr == "") {
$MoonJumpCart->redirStr = $ATC_RedirectAfter;
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
}
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
}
}
}
?>
<?php
// WA eCart Redirect
if ($MoonJumpCart->redirStr != "") {
header("Location: ".$MoonJumpCart->redirStr);
}
?>


=================================
Which is correct and works perfectly.
==========================

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...