Browsed by
Category: Code

Sorting the country select in Shopp

Sorting the country select in Shopp

This came up recently while working on a site that had a bunch of target markets selected in Shopp. The country dropdown list on the Checkout page was in a somewhat random order, and I realized that it was displaying them in the order they were selected or saved. When I checked 3 new countries, they showed up at the bottom of the list. So, knowing that, we decided it would be better for everyone if we sorted the list…

Read More Read More

Adding a date picker to Shopp

Adding a date picker to Shopp

Every once in a while I get asked to add a date picker to the checkout page of a Shopp e-commerce site, usually to allow the customer to choose a delivery date for the order. There are a ton of date picker scripts out there, including a jQuery UI Datepicker (which I find ugly and difficult to reskin without adding a lot of extra bulk to your site), so I’m not going to list them all here. For my purposes,…

Read More Read More

Filtering Free Shipping Discounts in Shopp

Filtering Free Shipping Discounts in Shopp

When most people think of Hawaii, they picture palm trees, sandy beaches, mai tais, and sunsets, or sitting under a palm tree, drinking mai tais on the beach while watching the sunset. I have to admit that living in Hawaii is pretty great, but one of the things that most people don’t think about is that there is no such thing as cheap shipping to Hawaii. We’ve all see Free Shipping promotions online, and if you’re lucky enough to live…

Read More Read More

Disabling Multiple Clicks to the Submit Order button in Shopp

Disabling Multiple Clicks to the Submit Order button in Shopp

Most of us who use web browsers understand that the web UI only requires a single click on links, form buttons, and input fields. However, there are people who are used to double-clicking everything in the same way you double-click icons in an OS GUI. Sometimes this causes problems, specifically with shopping carts, where double-clicking can lead to the checkout form being submitted twice which results in duplicate orders. I ran into this problem with Shopp, in a very specific…

Read More Read More

Changing the default WordPress email sender

Changing the default WordPress email sender

It’s not uncommon to want to change the email sender that WordPress sets automatically, especially in e-commerce situations. It’s actually really easy to do by adding a couple of filters in your theme’s functions.php file: /** change the default WordPress email sender */ add_filter(‘wp_mail_from’, ‘my_mail_from’); add_filter(‘wp_mail_from_name’, ‘my_mail_from_name’); function my_mail_from($email) { return ‘customerservice@example.com’; } function my_mail_from_name($name) { return ‘Customer Service’; }

Filtering excerpts in WordPress

Filtering excerpts in WordPress

By default WordPress displays […] at the end of an excerpt, which doesn’t look good. Instead, I use this¬†functions on blogs that I build, which changes it to something that looks better. Just add the following to your active theme’s functions.php: