Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

API: /products parameter "on_sale" doesn't retrieve variations on sale #15

@mategvo

Description

@mategvo

Describe the bug
"on sale" paramter from [https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products](products list endpoint), doesn't show variable products that are on sale

To Reproduce
Steps to reproduce the behavior:

  1. Create a variable product, add an attribute and a variation.
  2. Set variation price and sale price to lower than regular price.
  3. Using PHP library, query products list endpoint and include "on_sale" parameter as true. The product you just added will not be returned, even though it is on sale.

Expected behavior
on_sale parameter should show variable products when they are on sale.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

WooCommerce version:   3.6.2
Log directory writable:   /vagrant/html/fineyellow/wp-content/uploads/wc-logs/
WordPress version:   5.0.4 - There is a newer version of WordPress available (5.2.2)
WordPress multisite:  
WordPress memory limit:   1 GB
WordPress debug mode:    
WordPress cron:    
Language:   en_GB
External object cache:  

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions