Without further ado, we’re please to announce “Peppy Penguin” Beta 1 is available for testing.
╭────────────╮ ┃ Woo! 2.1 ┃ (o< ╰─y──────────╯ // V_/_
2.1 has pretty much been developed in parallel with our 2.0 fix releases for several months now, with major changes being added to 2.1 whilst fixes were rolled out in 2.0. Since 2.0 there have been over 1,318 commits which shows how busy we’ve been 🙂
The plan is to allow the beta(s) to run through Christmas, with a release candidate early Jan quickly followed by a stable release. So 2.1 will be released in January, so long as WordPress 3.8 is out.
That gives theme and plugin developers at least a month and a half for testing. You have been warned 🙂
The most pressing requirement is that WC 2.1 requires WordPress 3.8. Why? MP6.
With the admin redesign in 3.8 we’ve worked on the look and feel of WooCommerce itself – this obviously works flawlessly in 3.8, but older versions will look rough around the edges. Please test with 3.8 when possible and only raise UI issues with this version.
If you find a bug with the beta, please ensure you prepend the ticket title with [2.1-beta-1] when submitting the issue to GitHub, or at least mention what version you are using in the ticket description.
Also when reporting anything to us:
- Describe the issue in detail, with a system status report
- Don’t report issues with extensions, only core
- Don’t report issues with themes
- Report bugs, not feature requests
The full changelog can be found in the readme, but highlights include:
- Revised admin
- Refactored all code
- New MP6 UI
- Icon fonts replace image icons – WooCommerce has its own icon font, similar to WP 3.8’s Dashicons set.
- Settings page streamlining/new tabs
- Plugin structure refactoring – easier to navigate structure with class files within
/includes/and admin class files in
- New reports and functions for getting report data
- Tax Rounding improvements – Particularly for tax inclusive prices.
- Price formatting additions – Display prices incl or excl tax on the frontend, and append a string of your choice.
- WC_DELIMITER constant lets you change the ‘pipe’ for separating values – requested by some non-english users.
- Coupon usage limits per user (using email + ID)
Also, in more detail:
The new notices API makes it easier to add notices, success messages and errors which are output on the frontend.
wc_add_notice( $message, 'notice_type' );
3 types (notice, error and success) are supported and each has its own template file.
These new notices replace the old $woocommerce->add_message() and $woocommerce->add_error() methods.
The brand new REST API lets you get orders, customers, reports, and products in JSON and XML format.
You can read more about the REST API in previous posts here on develop.woothemes, and docs will be available during the beta.
Endpoints instead of pages
WC 2.0 had many, many pages which were installed automatically, but we felt this was overkill, especially the nested pages for things such as payment and order confirmation.
These nested pages have been instead turned into endpoints – the pages we have now are:
All others (pay, order received, edit address etc) are endpoints.
If gateways declare support for it, customers will be able to add payment methods/cards to their account under the My Account pages for later use during checkout.
WooCommerce 2.1 ships with a custom icon font which we use for all the icons in the WooCommerce UI. This aids performance and provides pixel perfect clarity on any screen.
If you’re building a WooCommerce extension you may want to use these icons if you’re adding a tab to the product data, or adding a new top level menu item.
See http://docs.woothemes.com/document/utilising-the-woocommerce-icon-font-in-your-extensions/ for instructions on this.
A new default credit card form which gateways can use
Since many gateway plugins use a similar interface for card payments during checkout, we’ve added a new ‘default’ card form which gateways can make use of:
This form uses the jQuery payment library developed by Stripe, has automatic formatting for credit card numbers and expiry dates, and automatically displays the type of card being used. It’s really slick and we’re excited to see it in use.
To use the form, the gateway need only declare support for ‘default_credit_card_form’ – it will then be output via the payment_fields method automatically (as long as you haven’t replaced this method with your own), or the gateway can just call it manually.
To make core more lean, the following integrations have been dumped from core and made into plugins (available from .org):
Testing your extensions!
Key things to check for and fix:
Deprecated functions and classes
Throughout WC there may be deprecated methods in the classes, however the functions have been moved to the wc-deprecated-functions.php file. This file also maps old filters to new filters when applicable.
Check your usage of these and test with WP_DEBUG enabled.
Function name consistency
With the exception of template functions, all core function name prefixes have changed from woocommerce_ to wc_ – the old functions are still in the plugin (wc-deprecated-functions.php) and will not cause notices in 2.1 – deprecated notices will be added in 2.2, and the functions will be dropped in 2.3.
Getting page permalinks (e.g. in gateways)
If you get the permalinks of the pay and thanks pages directly you will have issues with 2.1; these pages are now endpoints.
Most commonly, if you have used
woocommerce_pay_page_id in a gateway, you need to use the class methods instead:
$order->get_checkout_payment_url( true )
The above will return the correct link to the pay page endpoint for a particular order – this is also supported in later versions of 2.0 making backwards compatibility a non-issue.
Downloadable file URLs
As of 2.1, the structure for downloadable file urls have changed within downloadable products to support more data.
- Downloads are stored with an md5-hash key, and an array value consisting of name and url.
- Functions/methods for getting URLs/paths have changed – get_files() method for example which is part of the product classes.
- Meta key ‘filepaths’ has been renamed to ‘downloadable_files’
- The 2.1 upgrade script will update the formats for you from 2.0.x to 2.1.x
add_to_cart_handler filters are gone
In 2.0 we introduced some add_to_cart_handler filters for conditionally changing how add to cart events would take place for custom product types. In 2.1 this has been removed in favour of class methods which your custom product types can extend, the methods being: