Drupal Commerce Bulk Product Update

Drupal Commerce has the best implementation for handling virtual products sales as if in a real life store, in my opinion. Each product has a product display (or container) which houses each individual product, a variation per se, ( ex: shirt Z size small, shirt Z size medium) which provides better stock management and a streamlined business process if you do have a physical store and virtual store. There's just one major caveat: each product variation has to your product data attached, not the product display. So a t-shirt with 6 sizes is actually 6 products. That means entering a sale price 6 times, updating shipping information 6 times. I've been working on a client project that has over 1,200 products. There was no way in hell I was going to tell them, "Yeah, after your migrate your products over, you're going to have to edit each variation with that shipping information." I created a basic bulk product update rule that will take matching fields found on the product display and the product variation to update the product variation's information.

Ubercart Tax Per Product

Recently I had to configure a client's to tax per product to prevent gift certificates from being taxed at checkout. Ideally I wanted to add a "NOT" rule to my sales tax rate item within Ubercart; but, Drupal only supports "AND" and "OR" operators. Read my run down on my pitfalls and eventual success in setting up Ubercart tax per product.

jQuery Rating Script

For KenoBarNight I just added a simple rating system mocking that of YouTube and others; a simple "I Like It" or "I Don't Like It". Use whatever verbage you'd like, that is what this script does. The user clicks one of the buttons, and the script POSTs the data to a PHP script which saves a MySQL entry so we can do some math later and find a rating.

Sanitize Text for SQL

Cross Site Scripting (XSS) and SQL Injections are some of the biggest security threats to a PHP application.  Every developer has different ways of preventing SQL Injections or malicious JavaScript from being inserted into the database. Here are some easy solutions to help safeguard your PHP applications.

Pages