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

PowerStore 2: Need for taxable/non-taxable

Thread began 12/03/2009 10:40 pm by elton | Last modified 3/16/2010 5:11 pm by elton | 2591 views | 11 replies

Jason ByrnesWebAssist

No, there is no solution to add this functionality to PowerStore.

You can use eCart to adjust the tax rules however.

Taxable, NonTaxable products:
you would need to add a column to the products table. For items that should be taxed, set the value to 1, or 0 for items that should not be taxed.

Using eCart, you need to edit the Cart Object to create a new cart Column. This cart column will get the taxable value from the database. You then need to modify the add to cart buttons on any page that has them, for example the product details page. Before you can edit the add to cart button code, you will need to temporarily simplify the WADAProducts recordset, find the following code:


if (isset(
$_GET['ProductID'])) {
$ParamProductID_WADAProducts = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
$ParamSessionProductID_WADAProducts "-1";
if (isset(
$_SESSION['WADA_Insert_Products'])) {
$ParamSessionProductID_WADAProducts = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_Products'] : addslashes($_SESSION['WADA_Insert_Products']);
$ParamProductID2_WADAProducts "-1";
if (isset(
$_GET['ProductID'])) {
$ParamProductID2_WADAProducts = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
$query_WADAProducts sprintf("SELECT * , (ProductStock - (SELECT Coalesce(Sum(DetailQuantity),0) FROM orderdetails INNER JOIN orders ON OrderID = DetailOrderID WHERE DetailProductID = ProductID AND OrderDate > ProductUpdateDate))*ProductLive AS NumLeft FROM products  WHERE ProductID = %s OR ( -1= %s AND ProductID= %s)"GetSQLValueString($ParamProductID_WADAProducts"int"),GetSQLValueString($ParamProductID2_WADAProducts"int"),GetSQLValueString($ParamSessionProductID_WADAProducts"int"));
$WADAProducts mysql_query($query_WADAProducts$localhost) or die(mysql_error());
$row_WADAProducts mysql_fetch_assoc($WADAProducts);
$totalRows_WADAProducts mysql_num_rows($WADAProducts);

and you will need to change it to:


$query_WADAProducts "SELECT * FROM products";
$WADAProducts mysql_query($query_WADAProducts$localhost) or die(mysql_error());
$row_WADAProducts mysql_fetch_assoc($WADAProducts);
$totalRows_WADAProducts mysql_num_rows($WADAProducts);

Now double click the eCart add to cart from recordset server behavior. On the bindings tab, bind the new taxable cart column to the taxable column from the products table.

After you click OK, revert the WADAProducts recordset back to the original code.

Now you need to modify the tax calculation in the eCart Object. For the Trigger use:

Number of Items with a specific column value:
If the number Of Items Where "Taxable" has a value of "1" is ">" a value of "0"

for the calculation:
Based on Items With A Specific value:
Total of "TotalPrice" where "taxable" has a value of "1" "times" "<tax rate>"

Creating tax exempt users will be a quite a bit more difficult since PowerStore does not force the user to register or login before checking out. Because they can checkout without logging in, there is the possibility that some orders that they place will still have tax applied regardless of the setting in the database. You will have to allert tax exempt users to this.

Again, it starts with adding a new column to the database. In the users table create tax exempt column, and set it to 1 for users that are exempt, and 0 for users that are not. Perhaps set the default value to 0, you can change to 1 at your discretion.

On the Login Page, you will need to use security assist to modify the Authenticate user server behavior. On the third page of the server behavior, you can select database column to store in a session variables, click the plus button and select the taxexempt column.

Now modify the tax calculation in the eCart object. you will need to add an additional trigger:

Based On Session Variable value:
If the Session Variable "taxexempt" is "!=" a value of "1"

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





Ease of use


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