Skip to content
Advertisement

How to make the “coupon amount” column sortable in WooCommerce

Departing from the following tutorial: “Columns in WooCommerce“, the intention is to make the coupon amount column sortable based on amount.

Making it sortable seems to be successful with my already written code. Nevertheless, the rule to sort goes wrong.

I’ve tried several things before but the sort code is not applied after clicking,

Who would like to take a closer look?

What I’ve used so far:

JavaScript

Advertisement

Answer

The correct metakey is coupon_amount instead of amount

So this should suffice

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement