close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PowerStore 2: Need for taxable/non-taxable

Thread began 12/03/2009 7:40 pm by elton | Last modified 3/16/2010 2:11 pm by Jason Byrnes | 3950 views | 11 replies |

elton

PowerStore 2: Need for taxable/non-taxable

Is there a solution available to provide the ability to

(1) mark individual products as taxable or non-taxable
(2) mark customers(users) as taxable or non-taxable

We do a lot of business with folks who need one or both of these options

Thanks

Sign in to reply to this post

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:

php:
<?php

$ParamProductID_WADAProducts 
"-1";
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']);
}
mysql_select_db($database_localhost$localhost);
$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:

php:
<?php

mysql_select_db
($database_localhost$localhost);
$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:

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

Sign in to reply to this post

elton

newly added field "taxable" not showing in dialog box

When I get to your instruction point:

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

...the new field is not showing in the box.

Obviously coding in PHP is not my primary job function. Photographing babies, teens, graduating seniors, and families is.

So, if you please...How do I get the new products.taxable field to display in the box. I am stumped at this point.

Thanks again for your help.

Sign in to reply to this post

elton

PowerStore: Just Need way to pass non-taxable flag to PayPal Express Checkout

Jason, I just need a bit more help. The new field you suggested I add is done, but it does not show up in the behaviors pannel. What can I do to get it to populate so I can complete your fix recommendations.
Thanks

Originally Said By: elton
  When I get to your instruction point:

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

...the new field is not showing in the box.

Obviously coding in PHP is not my primary job function. Photographing babies, teens, graduating seniors, and families is.

So, if you please...How do I get the new products.taxable field to display in the box. I am stumped at this point.

Thanks again for your help.  
Sign in to reply to this post

Jason ByrnesWebAssist

the new cart column is not showing? or the new database column is not showing? please be more specific.

a screen shot showing the problem may be helpful.

Sign in to reply to this post

elton

Taxable / non-Taxable in PowerStore

Originally Said By: Jason Byrnes
  the new cart column is not showing? or the new database column is not showing? please be more specific.

a screen shot showing the problem may be helpful.  



When I go into eCart and Create the new Column, it just disappears when I exit the eCart... I am missing something I guess. I add the "Taxable" Column, mark it as integer and then click [OK]. but when I exit eCart and go back in ... it gone. I never get to the server behavior because it does not show up in the eCart (or the server behavior) after I modify the eCart Instance.

Sign in to reply to this post

Jason ByrnesWebAssist

make sure that the files in the WA_eCart directory are not set to be read only.

Sign in to reply to this post

elton

That solved my problem

Thanks, that resolved the problem

Sign in to reply to this post

elton

revisit taxable vs non-taxable for PowerStore 3

Hi Jason,

Can you provide the equivalent code fix for the PowerStore 3 product_detail.php. I tried to search for the code you provided for the PowerStore 2 version...but it has obviously changed since then.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

the WADAProducts recordset on the products_detail page for powerstore 3 is not as complex as it was in powerstore 2, you will not need to modify it to bind the cart object column to the WADAProducts columns.

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