Using a Date Picker with Data Assist Search

A question I have seen quite a lot on the Web Assist Data Assist forum is how to integrate a Date Picker into a DataAssist generated search form. Well with jQuery is is very simple using a very simple plugin written by Ted Devito. I have included the plugin and css file in the download file which contains a working example (just click anywhere in the Order Date text input box).

First obviously generate your DataAssist Pages and that will give you a search page with a form something like this:

Form

In the head of the document locate the css links and add the calendar css file included in the download like so:
<link href="WA_DataAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
<!-- add calendar css file, make sure you link to the file stored in your site -->
<link href="css/calendar.css" rel="stylesheet" type="text/css" />

Now add the necessary jQuery files, also included in the download, like so:
<!-- add jquery files, make sure you link to the files stored in your site -->
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/cal.js"></script>

Finally you need to call the plugin like so:
<script type="text/javascript">
// <![CDATA[
$(function() {
$('input.calendar').simpleDatepicker({enddate: '<?php echo date('m/d/Y',time()); ?>'});
});
// ]]>
</script>

I set the end date for the search to today via PHP as I do not want to search in the future but this can be left out if you wish. A full run down on the options is available on the plugin page.

I have put a working example (just click anywhere in the Order Date text input box) on my site and I have included the plugin and css files etc. in the download which again is available on my site.

Dealing with Vatable & Non-Vatable Goods and Shipping in eCart

Here in the UK if the goods that are being sold are subject to VAT and the company selling them are registered for vat then the carriage charge is also subject to VAT, but what if there are also goods being sold (in the case of the site I am working on children's clothes) that are not subject to VAT, how do you get eCart to add the VAT correctly ?

First of all you need to have a column in your database that denotes whether the product is vatable or not and a column in the eCart object to store this value in as per Jason Byrne's (WebAssist Technical Support Manager) advice in this thread

Also make sure that the include shipping in cart subtotal when calculating sales tax checkbox under the shipping tab is checked.

eCart Shipping Tab

When shipping to an address within the EU you must charge vat so I have a tax rule called EU Tax Calc that checks the for the existence of the session variable $_SESSION['eCartCheckoutForm_country'] and then checks the value to see whether the country being shipped to is within the EU. If the address is within the EU then we have to charge VAT

So the first rule in the Tax id the Standard Check that the number of unique items in the cart is greater than zero and then we check the session variable as described above.

For the Calculation choose Flat rate and paste this code into the box
((($this->GetTaxableTotal()) - ($this->ConditionalTotal("TotalPrice", "Taxable", "0"))) * 0.175)

What this code does is subtracts the non vatable portion of the order from the taxable total and then calculates the VAT due on the remainder (plus shipping)

I hope that helps somebody else who finds themselves in this situation.

The entire eCart rule should look like this in your eCart file
//eCart Rule
function WAEC_eCart1_EUTaxCalc() {
$totalTax = 0;
if (true && ((sizeof($this->Items) > 0) &&
(isset($_SESSION['eCartCheckoutForm_shipping_country'])) &&
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "GB") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "BE") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "BG") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "CZ") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "DK") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "DE") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "EE") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "GR") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "ES") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "FR") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "IE") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "IT") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "CY") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "LV") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "LT") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "LU") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "HU") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "MT") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "NL") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "AT") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "PL") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "PT") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "RO") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "SI") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "SK") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "FI") ||
((isset($_SESSION['eCartCheckoutForm_shipping_country'])?
$_SESSION['eCartCheckoutForm_shipping_country']:"") == "SE"))) {
$totalTax += ((($this->GetTaxableTotal()) - ($this->ConditionalTotal("TotalPrice", "Taxable", "0"))) * 0.175);//Result
}
return WA_eCart_FormatNumber($totalTax, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

eCart Tax Calculation Tab

New Site Launch - T Shirt Town

Since taking over the development of this site we have completely revamped the look and feel of it in conjunction the T Shirt Town's in house designer.

The site features “search engine friendly url's”, comprehensive site search system, previously viewed and you might also like product modules as well a completely new product viewing system that enable the customer to see as many products and as much detail as they want.

But the most development time has gone into the administration system of the site which has been completely rebuilt to enable ease of entering products whose input time has been reduced dramatically, along with custom reporting, order tracking and dynamic discount/coupon module makes looking after this site a pleasure and not a chore.