WordPress / 12 MIN READ
Woo Pages Overview
Overview of WooCommerce Pages and how to customize them
From the original Fervor library. Examples may use older package versions.
WooCommerce Pages Overview: A Beginner’s Guide to Store Customization 🚀
WooCommerce, the go-to plugin for turning your WordPress site into a thriving online store, comes with several essential pages. Each page serves a specific purpose in the eCommerce flow, and understanding their structure is step one to customizing your store like a pro. Let’s break down the main pages and their functions:
🛍️ Key WooCommerce Pages
Here’s the default lineup of WooCommerce pages and what they do:
1. Single Product Page
- Purpose: Displays detailed information about a single product.
- Key Features:
- Product title, image gallery, price, and description.
- “Add to Cart” button.
- Tabs for more details (e.g., Reviews, Specifications).
- Related products section.
- Template:
single-product.php - Customization:
- Edit layout with hooks like
woocommerce_before_single_product_summaryor page builders (e.g., Elementor). - Override templates in your theme folder under
/woocommerce/single-product/.
- Edit layout with hooks like
2. Product Archive Page (Shop, Categories, or Tags)
- Purpose: Displays a grid of products based on filters like categories, tags, or search results.
- Key Features:
- Product grid with images, titles, prices, and “Add to Cart” buttons.
- Sorting and filtering options (price, popularity, etc.).
- Pagination for easy navigation.
- Template:
archive-product.php - Customization:
- Adjust the number of products per row or add custom filters using hooks like
woocommerce_before_shop_loop. - Use CSS for grid styling.
- Page builders like Divi or Beaver Builder can help tweak layouts without coding.
- Adjust the number of products per row or add custom filters using hooks like
3. Cart Page
- Purpose: Allows customers to review their selected items before checkout.
- Key Features:
- Product name, price, quantity, and subtotal for each item.
- Option to update quantities or remove items.
- Cart totals (subtotal, shipping, taxes).
- Coupon code field.
- “Proceed to Checkout” button.
- Template:
cart.php - Customization:
- Modify sections with hooks like
woocommerce_before_cart_totals. - Add custom fields (e.g., gift notes).
- Modify sections with hooks like
4. Checkout Page
- Purpose: Final step where customers enter shipping, billing details, and payment information.
- Key Features:
- Billing and shipping address forms.
- Payment gateways (e.g., PayPal, Stripe).
- Order review section.
- Template:
checkout.php - Customization:
- Add or remove fields using
woocommerce_checkout_fieldsfilter. - Style the layout with CSS or page builders.
- Simplify the process by enabling guest checkout or reducing required fields.
- Add or remove fields using
5. My Account Page
- Purpose: A hub for customers to manage their accounts.
- Key Features:
- View orders and downloads.
- Edit addresses and account details.
- Login/logout functionality.
- Template:
myaccount.php - Customization:
- Add new endpoints (e.g., custom tabs for subscriptions or wishlists).
- Modify sections using hooks like
woocommerce_account_menu_items.
6. Order Confirmation (Thank You) Page
- Purpose: Displays an order summary after a successful purchase.
- Key Features:
- Order number, details, and customer information.
- Payment method summary.
- Thank-you message.
- Template:
thankyou.php - Customization:
- Add custom thank-you messages or upsell recommendations with hooks like
woocommerce_thankyou.
- Add custom thank-you messages or upsell recommendations with hooks like
7. Other WooCommerce Pages
- Wishlist Page: Created by wishlist plugins like YITH WooCommerce Wishlist.
- Login/Registration Pages: Used for account creation and customer logins.
- Custom Pages: WooCommerce blocks make it easy to create custom product showcases or landing pages.
🛠️ How WooCommerce Pages Work (Under the Hood)
Each page uses a combination of templates, hooks, and shortcodes. Here’s a peek at their structure:
-
Templates: Found in the
woocommerce/templates/folder. You can override them in your theme.- Place custom templates in
/your-theme/woocommerce/to avoid losing changes after plugin updates.
- Place custom templates in
-
Hooks and Actions: WooCommerce relies on WordPress hooks to inject content into pages.
- Example:
woocommerce_before_cartlets you add a custom message above the cart.
- Example:
-
Shortcodes: WooCommerce uses shortcodes to display key pages.
- Cart:
[woocommerce_cart] - Checkout:
[woocommerce_checkout] - My Account:
[woocommerce_my_account] - Shop: Handled by WordPress’ archive page for products.
- Cart:
🖌️ Customization Options
Here are some ways to make WooCommerce pages your own:
- Use a Page Builder: Elementor, WPBakery, or Divi allow drag-and-drop editing.
- CSS Styling: Add styles in your theme’s stylesheet or via the Customizer.
- Child Theme Templates: Copy and tweak WooCommerce templates for advanced edits.
- Plugins: Extend functionality with WooCommerce-specific plugins.
- Example: Product Add-Ons, Checkout Field Editor.
📦 A Sample Customization Project
Let’s say you want to customize the Single Product Page:
- Create a Child Theme: Prevent your changes from being overwritten by updates.
- Copy Template: Copy
single-product.phpto/your-theme/woocommerce/single-product.php. - Add Custom Code: Use hooks like
woocommerce_single_product_summaryto insert extra content, like a trust badge.add_action('woocommerce_single_product_summary', 'add_trust_badge', 15); function add_trust_badge() { echo '<div class="trust-badge">100% Secure Payment</div>'; }
WooCommerce is like a box of LEGOs for your online store. Understanding the structure of its pages is the foundation for building something amazing. Ready to dive deeper? 🎨✨
Bonus COolness
🎉 Bonus Section: Cool Stuff You Can Do with WooCommerce Pages! 🚀
Now that you’ve got the basics, let’s level up your WooCommerce store with some creative ideas and tweaks to make your pages stand out. These tips are all about enhancing user experience, boosting conversions, and adding a dash of pizzazz to your shop.
1. Add a Sticky Mini Cart 🛒
Give customers a floating mini cart that stays visible as they browse.
- Why? Improves UX by letting users quickly view or update their cart without leaving the page.
- How? Use a plugin like Side Cart WooCommerce or custom code with hooks:
add_action('wp_footer', 'add_sticky_cart'); function add_sticky_cart() { echo '<div class="sticky-cart"><a href="/cart/">View Cart</a></div>'; }
2. Dynamic Pricing Tables on Product Pages 📊
Show discounts based on quantity to encourage bulk purchases.
- Why? Increases average order value.
- How? Use the WooCommerce Discount Rules plugin or add custom tables with a shortcode:
echo '<table class="pricing-table"> <tr><th>Quantity</th><th>Discount</th></tr> <tr><td>3+</td><td>10%</td></tr> <tr><td>5+</td><td>20%</td></tr> </table>';
3. Show Recently Viewed Products 👀
Let customers easily revisit items they’ve checked out before.
- Why? Improves navigation and increases the chance of purchase.
- How? Add a “Recently Viewed Products” widget to your sidebar or footer using this shortcode:
[woocommerce_recently_viewed_products per_page="4"]
4. Interactive Filters on Shop Pages 🛒
Upgrade your product filters with sliders, color swatches, or search-by-tags.
- Why? Makes it easier for shoppers to find what they want, fast.
- How? Use plugins like YITH WooCommerce Ajax Product Filter for advanced filtering options.
5. Custom Thank You Page with Upsells 🎁
After checkout, offer personalized recommendations or discounts.
- Why? Encourage repeat purchases.
- How? Customize the thank-you page with the
woocommerce_thankyouhook:add_action('woocommerce_thankyou', 'custom_thankyou_content'); function custom_thankyou_content($order_id) { echo '<p>Thanks for your order! Check out these cool add-ons:</p>'; echo do_shortcode('[products limit="3" columns="3" orderby="rand"]'); }
6. Quick View for Products 🕶️
Add a “Quick View” button on archive pages so users can see product details in a popup.
- Why? Reduces friction and speeds up shopping.
- How? Use a plugin like YITH WooCommerce Quick View, or manually create a modal using JavaScript and hooks.
7. Countdown Timers for Flash Sales ⏳
Create urgency by showing how much time is left on special deals.
- Why? FOMO (Fear of Missing Out) drives conversions.
- How? Add a countdown timer to sale products with a plugin like Countdown Timer for WooCommerce, or embed a timer using JavaScript libraries like FlipClock.js.
8. Add a Product Video to the Gallery 🎥
Showcase your product with an explainer or demo video.
- Why? Videos boost engagement and build trust.
- How? Use the WooCommerce Product Video plugin, or embed a YouTube/Vimeo iframe in the product gallery.
9. Floating Trust Badges & Guarantees ✅
Add sticky “Safe Checkout” badges to product pages or the cart.
- Why? Builds confidence and reduces cart abandonment.
- How? Add HTML and style it with CSS:
add_action('woocommerce_after_add_to_cart_button', 'add_trust_badges'); function add_trust_badges() { echo '<div class="trust-badges"><img src="your-badge-url.png" alt="100% Secure Checkout"></div>'; }
10. Gamify Discounts with Spin-to-Win Wheels 🎡
Let visitors spin for discounts or free shipping in exchange for their email.
- Why? Engages visitors and builds your email list.
- How? Use a plugin like WooCommerce Lucky Wheel to create the wheel.
11. Add a Live Chat Bubble 💬
Provide instant customer support with live chat integration.
- Why? Helps shoppers get answers quickly, improving conversions.
- How? Use tools like Tawk.to, LiveChat, or HubSpot Live Chat for easy setup.
12. Create a Custom Landing Page for Sales 🌟
Build an exclusive page for flash sales, holiday deals, or new launches.
- Why? Drives targeted traffic to high-priority products.
- How? Use WooCommerce blocks or a page builder like Elementor to craft an eye-catching layout.
13. Customer-Only Hidden Pages 🔒
Create VIP pages with exclusive products or discounts for logged-in customers.
- Why? Encourages loyalty and rewards repeat buyers.
- How? Restrict access to certain pages using the WooCommerce Memberships plugin.
14. Add AI-Powered Product Recommendations 🤖
Use AI to suggest products based on user behavior or purchase history.
- Why? Boosts cross-sells and up-sells with minimal effort.
- How? Use plugins like Product Recommendations by WooCommerce or Beeketing.
15. Animate Your Add-to-Cart Button 🎨
Make the “Add to Cart” button bounce, glow, or shake when hovered over.
- Why? Draws attention to the most important action on the page.
- How? Add CSS animations:
.add-to-cart-button:hover { animation: bounce 1s infinite; } @keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-10px);} 60% {transform: translateY(-5px);} }
🚀 Wrap-Up
WooCommerce is a powerhouse, and with a little creativity, you can transform your store into a one-of-a-kind shopping experience. Whether it’s making the cart page more dynamic, jazzing up product pages, or surprising customers with fun features, there’s a lot you can do.
Bonus cool Code snipets
🛠️ Cool Code Snippets for WooCommerce Page Templates
Here are some awesome WooCommerce code snippets to jazz up your store. You can drop these into your theme’s functions.php file (preferably in a child theme) or use a custom code plugin like Code Snippets.
1. Add Custom Text to Single Product Pages
Show a custom message above or below the product description.
add_action('woocommerce_single_product_summary', 'add_custom_product_message', 20);
function add_custom_product_message() {
echo '<p class="custom-message" style="color: #ff4500; font-size: 16px;">✨ Free shipping on orders over $50! ✨</p>';
}
2. Display a Sale Countdown Timer on Product Pages
Add a countdown timer for sale products.
add_action('woocommerce_single_product_summary', 'add_sale_countdown_timer', 10);
function add_sale_countdown_timer() {
global $product;
if ($product->is_on_sale() && $product->get_date_on_sale_to()) {
$sale_end = $product->get_date_on_sale_to()->getTimestamp();
echo '<div id="sale-countdown" style="color: red; font-weight: bold;"></div>';
?>
<script>
const saleEnd = <?php echo $sale_end * 1000; ?>;
const countdown = document.getElementById('sale-countdown');
const timer = setInterval(() => {
const now = new Date().getTime();
const distance = saleEnd - now;
if (distance <= 0) {
clearInterval(timer);
countdown.innerHTML = 'Sale ended!';
} else {
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
countdown.innerHTML = `Hurry! Sale ends in ${days}d ${hours}h ${minutes}m ${seconds}s`;
}
}, 1000);
</script>
<?php
}
}
3. Customize the “Add to Cart” Button Text
Change the button text on product and archive pages.
add_filter('woocommerce_product_single_add_to_cart_text', 'custom_single_add_to_cart_text');
add_filter('woocommerce_product_add_to_cart_text', 'custom_archive_add_to_cart_text');
function custom_single_add_to_cart_text() {
return 'Buy Now 🚀';
}
function custom_archive_add_to_cart_text() {
return 'Add to Bag 🛍️';
}
4. Add a Trust Badge Below the Add-to-Cart Button
Boost buyer confidence by showing a secure payment badge.
add_action('woocommerce_after_add_to_cart_button', 'add_trust_badge_below_cart_button');
function add_trust_badge_below_cart_button() {
echo '<div style="margin-top: 15px; text-align: center;">
<img src="https://yourdomain.com/secure-badge.png" alt="Secure Checkout" style="max-width: 150px;">
<p style="font-size: 12px; color: gray;">100% Safe & Secure Checkout</p>
</div>';
}
5. Show Total Savings on Cart Page
Display how much the customer saved by applying discounts.
add_action('woocommerce_cart_totals_before_order_total', 'show_total_savings_on_cart');
function show_total_savings_on_cart() {
global $woocommerce;
$total_discount = $woocommerce->cart->get_cart_discount_total();
if ($total_discount > 0) {
echo '<tr class="cart-savings">
<th>You Saved:</th>
<td data-title="You Saved">' . wc_price($total_discount) . '</td>
</tr>';
}
}
6. Add Custom Content to the Checkout Page
Add a note or image above the billing details.
add_action('woocommerce_before_checkout_form', 'add_custom_checkout_note');
function add_custom_checkout_note() {
echo '<div style="background: #f9f9f9; padding: 10px; margin-bottom: 20px; text-align: center;">
<p style="margin: 0;">💳 All transactions are secured with SSL encryption.</p>
</div>';
}
7. Change Number of Products Per Row on Shop Pages
Customize how many products show in each row of the product grid.
add_filter('loop_shop_columns', 'custom_shop_columns', 999);
function custom_shop_columns() {
return 4; // Change to 3, 5, etc.
}
8. Show a Custom Tab on Product Pages
Add an extra tab to the product page (e.g., “How to Use”).
add_filter('woocommerce_product_tabs', 'add_custom_product_tab');
function add_custom_product_tab($tabs) {
$tabs['how_to_use'] = array(
'title' => 'How to Use',
'priority' => 50,
'callback' => 'custom_product_tab_content'
);
return $tabs;
}
function custom_product_tab_content() {
echo '<h2>How to Use</h2>';
echo '<p>This product is super easy to use. Follow these steps...</p>';
}
9. Redirect Users After Add-to-Cart
Send users directly to the checkout after they add an item to the cart.
add_filter('woocommerce_add_to_cart_redirect', 'redirect_to_checkout_after_add_to_cart');
function redirect_to_checkout_after_add_to_cart() {
return wc_get_checkout_url();
}
10. Limit Product Purchases Per Customer
Restrict how many of a product a customer can buy.
add_filter('woocommerce_add_to_cart_validation', 'limit_product_quantity_per_customer', 10, 3);
function limit_product_quantity_per_customer($passed, $product_id, $quantity) {
$max = 5; // Set your maximum limit.
$cart_item_quantity = WC()->cart->get_cart_item_quantities();
if (isset($cart_item_quantity[$product_id]) && ($cart_item_quantity[$product_id] + $quantity) > $max) {
wc_add_notice('You can only purchase up to ' . $max . ' of this item.', 'error');
return false;
}
return $passed;
}
11. Add Custom Fields to Product Pages
Let customers input custom text (e.g., for personalized items).
add_action('woocommerce_before_add_to_cart_button', 'add_custom_text_field');
function add_custom_text_field() {
echo '<div class="custom-field">
<label for="custom_message">Add a Personal Message:</label>
<input type="text" name="custom_message" id="custom_message" placeholder="e.g., Happy Birthday!" style="width: 100%; margin-top: 5px;">
</div>';
}
add_filter('woocommerce_add_cart_item_data', 'save_custom_text_field', 10, 2);
function save_custom_text_field($cart_item_data, $product_id) {
if (!empty($_POST['custom_message'])) {
$cart_item_data['custom_message'] = sanitize_text_field($_POST['custom_message']);
}
return $cart_item_data;
}
add_filter('woocommerce_get_item_data', 'display_custom_text_field_in_cart', 10, 2);
function display_custom_text_field_in_cart($item_data, $cart_item) {
if (isset($cart_item['custom_message'])) {
$item_data[] = array(
'name' => 'Personal Message',
'value' => $cart_item['custom_message']
);
}
return $item_data;
}
🚀 Wrapping Up
These snippets give you a ton of flexibility to customize WooCommerce pages for better usability and conversions. Copy, tweak, and deploy them to your heart’s content!🎨