Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
michael.broughton331

WooCommerce Variation Prices are sorted as text value

Hi,
I was trying to sort my WooCommerce variation by price as well as cost, and noticed that these numeric fields are being treated as text values even when they have a currency prefix. I wasn’t sure if this was coming from ACP or not, but some numeric fields look alright so it might be. Any feedback would be appreciated.

5 months ago
Stefan van den Dungen Gronovius
Developer

Thanks for your feedback.
The sorting logic is indeed implemented incorrectly.
It will be patched in the next version of Admin Columns,

If you want to quickly patch it yourself, you can change the following file:

/admin-columns-pro/addons/woocommerce/classes/Column/ProductVariation/Price.php#68 (in the sorting method)

It should now look like this:

    public function sorting()
    {
        return new ACP\Sorting\Model\Post\Meta(
            $this->get_meta_key(),
            new ACP\Sorting\Type\DataType(ACP\Sorting\Type\DataType::DECIMAL)
        );
    }
5 months ago

You must be logged in to reply to this topic.