How to Build a Custom Woo Return System with Bricks Form, Custom Fields & PHP

Last Updated: 18/08/2025

Tired of handling customer return requests through email? A dedicated return system can streamline the process, improve customer service, and keep all your requests organized. In this tutorial, I’ll show you how to build a complete, lightweight return system for your WooCommerce store using a Custom Post Type (CPT), the Bricks Builder form element, and just a few lines of PHP code.

If you’re looking for another way to streamline your WooCommerce workflow, be sure to check out my new plugin, Woo Quick Stock Adjust. It makes managing product stock a breeze, directly from your WooCommerce product list.

This method avoids bulky, expensive plugins and gives you full control. We’ll use the Advance Custom Fields (ACF) plugin to create the necessary fields for your return requests.

Features

This custom solution gives you a powerful, yet simple, returns management system:

  • Dedicated Request Management: All return requests are saved as a custom post type called “Returns,” creating a central hub for all requests instead of getting lost in your inbox.
  • User-Friendly Form: Customers submit their requests through a simple, custom-designed form built with Bricks Builder.
  • Instant Request Status: The system automatically saves new requests with a default status of “In Progress,” keeping your team instantly informed.
  • Intuitive Admin Interface: The system adds key information directly to the “Returns” list view in your WordPress admin dashboard. You’ll see the customer’s name, phone number, order ID, and the product they want to return at a glance.
  • Visual Status Badges: Requests are visually color-coded with badges—for example, yellow for “In Progress” and blue for “Completed”—making it easy to see the status of each return.
  • Quick Actions: A “Quick Complete” link appears on each return in the list view, allowing you to change a request’s status to “Completed” with a single click.
  • Admin Menu Notifications: A red notification badge appears next to the “Returns” menu in the admin sidebar, showing you the number of open “In Progress” requests that need your attention.

Step 1: Create the ‘Returns’ Custom Post Type and Fields

Before adding any code, you must create the foundation for your system: the Custom Post Type (CPT) and its fields. This is where all the information from the return requests will be stored.

  1. Create the Custom Post Type: Using ACF, create a new CPT with the following details:
    Slug: return (this is critical, it must match the code)
    Plural Name: Returns
    Singular Name: Return
  2. Create the Custom Fields: Next, create a field group and link it to the ‘Returns’ CPT. Make sure the Attribute Name of each field matches exactly with the name referenced in the PHP code, as shown below:
Field LabelAttribute Name (for the form)
Order No.return_order_id
Order Emailreturn_order_email
Full Namereturn_name
Phonereturn_phone
Reason for Returnreturn_reason
Product for Returnreturn_product
Product Detailsreturn_product_info
Product for Exchangereturn_product_change
Exchange Product SKUreturn_product_change_sku
Bankreturn_bank
IBANreturn_iban

Step 2: Building the Return Form with Bricks Builder

Now that your custom post type and fields are ready, it’s time to build the form that customers will use to submit their requests.

bricks forms return gallery 3
  1. Create a New Page: Create a new page in WordPress, title it “Return Request” (or similar), and open it with Bricks Builder.
  2. Add the Form Element: Drag the Form element onto the canvas.
  3. Configure Form Actions: In the form settings, go to the Form Actions tab and select Custom Action. This is the critical step that links the form to the first PHP snippet you will add.
  4. Create the Form Fields: Delete the default fields and create new ones, making sure the Attribute Name of each field matches exactly with the names you defined in Step 1 and the PHP code.

Here’s a guide for the form fields and their corresponding Attribute Name you must enter:

Field TypeField LabelAttribute Name Description
TextOrder No.return_order_idFor the customer’s order ID.
EmailOrder Emailreturn_order_emailFor the order’s email address.
TextFull Namereturn_nameFor the customer’s name.
TelPhonereturn_phoneFor the customer’s phone number.
SelectReason for Returnreturn_reasonA dropdown for the return reason.
TextProduct for Returnreturn_productThe name or SKU of the product.
TextareaProduct Detailsreturn_product_infoAny additional info about the product.
TextProduct for Exchangereturn_product_changeThe name or SKU of the exchange product.
TextExchange Product SKUreturn_product_change_skuThe SKU of the exchange product.
TextBankreturn_bankThe name of the customer’s bank.
TextIBANreturn_ibanThe customer’s IBAN for the refund.

Step 3: Adding the PHP Code Snippets

You’ll need to add these three PHP snippets to your website. The best practice is to add them to your child theme’s functions.php file or in WP Code or Code Snippets.

1. Bricks Form Action

This snippet tells your Bricks form what to do when a user submits it. It creates a new “Return” custom post and saves the form data as custom fields.

Important: You must change the form ID and ensure your form field names match the names in the code.

2. Admin Columns & Badge

This snippet customizes the admin list view for your “Returns” CPT. It adds new columns, displays the custom field data within them, and shows a status badge. It also adds a notification badge to the “Returns” menu item.

3. Custom Statuses & Quick Actions

This snippet creates the two custom statuses for your “Returns” CPT (“In Progress” and “Completed”) and adds a quick action link to the list view, allowing you to easily change a request’s status.

Keep in mind that this system is fully customizable. You can add or remove form fields and custom fields as you see fit. Just remember that for the system to work correctly, the Attribute Name you use in your Bricks form must exactly match the name of the custom field in ACF and the field name in the PHP code.

If you found this helpful and want to support more tutorials like this, consider a donation via PayPal or Buy me a Coffee
Having trouble with an animation or layout? I offer quick, hands-on help for a small donation fee.
LET'S SOLVE IT
Leave the first comment


0%

Need Help with Bricks or Next Bricks?

Having trouble with an animation or layout? I offer quick, hands-on help for a small donation fee. Whether it’s a tricky animation or a design detail that won’t work as expected, I’ve got you covered.

BETA