Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
WooCommerce Cookbook

You're reading from   WooCommerce Cookbook WooCommerce makes it easy to create, design, and manage your own personalized eCommerce store - this WooCommerce tutorial eBook will show you how to get started

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher Packt
ISBN-13 9781784394059
Length 248 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
 Rauland Rauland
Author Profile Icon Rauland
Rauland
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

WooCommerce Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. WooCommerce Basics FREE CHAPTER 2. Adding Products 3. Changing the Product Organization 4. Running a Membership Site 5. Setting Up Shipping Methods 6. Getting Paid 7. Modifying the Checkout Process 8. Managing Orders and Taxes 9. WooCommerce Theming 10. Exploring More with WooCommerce Index

Customizing the subscription price string


If you're running a subscription site, there are bound to be things you want to customize to make your website reflect your brand. Subscriptions are loaded with hooks that developers can use to customize all sorts of things programmatically. We'll be manipulating the Subscriptions price string using a filter just to show how things are done.

Getting ready

You must have the WooCommerce Subscriptions plugin installed and activated on your site.

How to do it…

In order to customize the subscription price string, go through the following steps:

  1. Open up your theme's functions.php file, located under wp-content/themes/your-theme-name/, or create a custom WooCommerce plugin and open up that file.

  2. Add the following two lines of code. These tell Subscriptions to look for your modifications to the price string:

    add_filter( 'woocommerce_subscriptions_price_string', 'woocommerce_cookbook_subscription_price_string', 10, 2 );
    add_filter('woocommerce_subscriptions_product_price_string...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images