WordPress development tutorials

How to Generate a Post Excerpt Outside the Loop

When you work with WordPress, you become pretty familiar with using the WP_Post object or objects for custom post types. For example, while working with WooCommerce, products use the WC_Product post object (or the object for a class that inherits this, such as WC_Product_Variation). If you’re in the loop while working with posts or custom post types, get_the_excerpt() is a beautiful function, as it returns the excerpt if it’s set by the user, and automatically…

Read More

WooCommerce reviews + tutorials

How to Create a WooCommerce Widget

This is post 3 of 8 in the series “Build a WooCommerce Extension” Today we’re continuing our series on building your first WooCommerce plugin with an article on how to create a WooCommerce widget for your store. Widgets and shortcodes are great tools to let users output some information on the frontend of their eCommerce site, and they’re fairly easy to build and include as part of your plugin. We’ve already written about creating a…

Read More

How to Simplify Free WooCommerce Checkout

For most WooCommerce checkouts, customers will be purchasing products and remitting payment to your store. They may also be selecting shipping methods or entering coupon codes. However, when customers purchase a free item, you may not need all of the fields at checkout if you’re not collecting any payment for shipping. As a result, you may require almost none of the checkout fields. While WooCommerce will helpfully remove payment method selection for free checkouts, the…

Read More

Add Actions to WooCommerce My Orders Table

You can easily add action buttons to the WooCommerce My Orders table in the customer’s My Account section of your site. The default buttons include actions like “Pay”, “Cancel”, and “View”, but you can add your own actions for each order. The woocommerce_my_account_my_orders_actions filter makes it very simple to add our actions. Actions are an array, so you add your own action into the array and then give them back to WooCommerce. The filter gives…

Read More

How to add a flash for WooCommerce Featured Products

When a product is on sale in your shop, WooCommerce adds a sales flash to that product to show customers that the product has a sale running to draw their attention to it. This sales flash is shown on the shop page and on the single product page to keep the customer informed. Depending on how you’re using “Featured” products in your shop, you may want to draw the customer’s attention to the featured products…

Read More

Ask SkyVerge

How to Remove WooCommerce Product Images from the Cart

This Ask SkyVerge question comes from Frank: Is it possible to remove the product thumbnails and the links to the product page on the cart page? By default, the WooCommerce cart page includes product images and links to product pages in your shop for each item in the cart. However, the cart template is pretty flexible, and there a couple of handy filters in it that can let us change these cart elements. First, we…

Read More

Add Text to the WooCommerce Review Form

Product Reviews are one of the most powerful selling tools your store has. We have an extension to add fields like qualifier questions (“How did this fit?”) and accept attachments like uploads, but you can add simple text notices to reviews without an extension. WooCommerce already includes a couple of additional fields in the review form that are not set: comment_notes_before: shown above the name / email fields when the reviewer is not logged in…

Read More

Ask SkyVerge

Add Information Above WooCommerce Product Images

Today’s question comes from Pawan: Could you tell me how to add a company icon just above the products in shop page? Images and text can be added to the shop page with a small code snippet. However, while we’re on this topic, we’ll also cover how to add images and text above or below images on the single product pages as well. If you’ve never added custom code to your site, please view our…

Read More

Ask SkyVerge

How to Edit Required WooCommerce Checkout Fields

Here’s an Ask SkyVerge question from Brett: It looks like all of the WooCommerce checkout fields are added in the billing form template but I’m not sure where they’re coming from. Is there an easy way to change which of these fields are required? I don’t need the phone, but I do need the company field instead and I’m not seeing where the fields are. The WooCommerce checkout fields are generated outside of the checkout…

Read More

Ask SkyVerge

Changing the Storefront My Account Page

Today’s Ask SkyVerge question is from Harshad: The “My Account” page used to display the login and register forms side by side, but now that I switched to Storefront and updated WooCommerce they are below each other, taking up a lot of space on the page. Can the Storefront My Account page be changed? If you use WooCommerce in a default theme, like TwentyTwelve, you’ll see that the “My Account” page layout is in two…

Read More