close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

add to cart dont work

Thread began 9/06/2012 1:01 pm by sfj6167 | Last modified 9/07/2012 1:24 pm by Jason Byrnes | 501 views | 9 replies |

sfj6167

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

Sign in to reply to this post

Jason ByrnesWebAssist

  Can anybody help ?  



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.

Sign in to reply to this post

sfj6167

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

Sign in to reply to this post

Jason ByrnesWebAssist

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

Sign in to reply to this post

sfj6167

Here is the pages - Jason

regards
Bison

Attached Files
shop.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the problem is code otrder.

The eCart code block is before the code for the recordset.

on the details page, move this code:

php:
<?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

Sign in to reply to this post

sfj6167

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

Attached Files
shop2.zip
Sign in to reply to this post

Jason ByrnesWebAssist

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

Sign in to reply to this post

sfj6167

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

Sign in to reply to this post

Jason ByrnesWebAssist

move the code from line 80 - - 125:

php:
<?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) {
    
$_SESSION["WADbSearch1_products_results"]=$WADbSearch1->whereClause;
  }
}
else     {
  
$WADbSearch1 = new FilterDef;
  
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
  
//get the filter definition from a session variable
  
if (== 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

Sign in to reply to this post
loading

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