Add coupon code to order details and emails

If you are offering multiple coupons it can be useful to know which of them was used in an order. This code adds the coupon code to the order details and displays them in a separate row in the emails sent to the customer and admin.

Add extra fields to checkout process

It’s possible to add extra custom fields to the checkout process if you want to collect more information from the customer. In this example, extra fields for “student name” and “student year” are being added. There are a number of steps involved. First, the fields need to be created; then the data entry fields are … Read moreAdd extra fields to checkout process

Add shortcode to make link to individual product

This snippet adds a shortcode that can be used to quickly insert a link to any individual product page. The product is specified by id, for example [product_url id=”428″] and the title of the product is used as the link text.

Add a payment gateway surcharge to checkout

Payment gateways such as PayPal and Stripe charge a small amount for processing a transaction. This code adds a credit card surcharge as a percentage of the cart total to cover that amount. Examples are shown for PayPal and Stripe, adding 3% for each.  

Add custom suffix to prices

Use this code to attach a suffix to all prices. For example, you might sell wine only by the mixed case, so you could add ” in any mixed dozen” after the bottle price.

Add custom prefix to prices

You can add a prefix to all prices with this code. For example, you could add “Only” before the price.

Add custom row to order email table

This code will another row to the order email table to add in some regularly recurring information about the order. In this example we are including a line about the standard one year warranty.