add to cart dont work
Hi there
have been following the "integrating databridge and Ecart" tutorial.
when trying out the functions, "add to cart" dont do nothing...
Can anybody help ?
regards
Bison
Hi there
have been following the "integrating databridge and Ecart" tutorial.
when trying out the functions, "add to cart" dont do nothing...
Can anybody help ?
regards
Bison
Sure, i can, but i would need a link where i can see the problem and a copy of the add to cart page so I can view the code.
Of course Jason - sorry about that..
Here are the product result and detail pages.
products_results.php
products_detail.php?ProductID=1
What I dont understand is the the tutorial says to change the add to cart button in the detail page, but what about the button on the results page ??
regards
Bison
1) when creating the public product catalog pages, you should no be including the delete button, you don't want the public customers to be able to delete the item from your store.
2) I need a copy of the pages to view the code.
3) adding the add to cart button to the results page is the same as adding it to the details page. you need to remove the form from the results page, then you can add the add to cart button
the problem is code otrder.
The eCart code block is before the code for the recordset.
on the details page, move this code:
<?php require_once('../Connections/ks.php'); ?>
<?php require_once("../webassist/database_management/wa_appbuilder_php.php"); ?>
<?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;
}
}
?>
<?php
$ParamProductID_WADAks_products = "-1";
if (isset($_GET['ProductID'])) {
$ParamProductID_WADAks_products = $_GET['ProductID'];
}
mysql_select_db($database_ks, $ks);
$query_WADAks_products = sprintf("SELECT ProductID, ProductName, ProductImage, ProductName, ProductShortDesc, ProductLongDesc, ProductPrice, ProductShortDesc, ProductLongDesc FROM ks_products WHERE ProductID = %s", GetSQLValueString($ParamProductID_WADAks_products, "int"));
$WADAks_products = mysql_query($query_WADAks_products, $ks) or die(mysql_error());
$row_WADAks_products = mysql_fetch_assoc($WADAks_products);
$totalRows_WADAks_products = mysql_num_rows($WADAks_products);
?>
to line 1
Hi jason
I did what you suggested, at indeed it works...
I tried to remove the delete button, but the page kept giving me errors, so I build the pages again, without the delete button..
Again following the tutorial "Integrating Databridge and eCart"
I removed the original add button and added the eCart add button. the detail page works BUT
When adding the add cart button to the product_results page the page dont work..
I have attached the pages, original works, and with the eCart add button it dont...
There must be a bug in this "Integrating Databridge and eCart" procedure
Can you see whats the error ?
regards
Bison
a blank page means that a php error is occurring but error reporting is turned off.
to turn error reporting on, add the following code at line 1:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
once we know what the error is, we will be able to troubleshoot the cause.
Hi Jason
Here is the error I get:
Fatal error: Call to undefined function setQueryBuilderSource() in /home/kameraservice/public_html/shop/products_results.php on line 53
regards
Bison
move the code from line 80 - - 125:
<?php require_once("../webassist/database_management/wada_search.php"); ?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAks_products;
//Searchpage: products_search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if (isset($_GET["Search"]) || isset($_GET["Search_x"])) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
//comparison list additions
$WADbSearch1->addComparisonFromEdit("ProductName","ProductName","AND","=",0);
$WADbSearch1->addComparisonFromEdit("ProductMetaKeywords","ProductMetaKeywords","AND","=",0);
$WADbSearch1->addComparisonFromEdit("ProductPrice","ProductPrice","AND","=",1);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_products_results"]=$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_products_results"]) && $_SESSION["WADbSearch1_products_results"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_products_results"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
<?php
//WA eCart Include
require_once("../WA_eCart/eCart1_PHP.php");
?>
to line 1
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.