Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouped Product inconsistency with on sale #14903

Closed
WillBrubaker opened this issue May 5, 2017 · 1 comment
Closed

Grouped Product inconsistency with on sale #14903

WillBrubaker opened this issue May 5, 2017 · 1 comment
Labels
status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. status: won't fix The issue won’t be fixed. type: enhancement The issue is a request for an enhancement.

Comments

@WillBrubaker
Copy link
Contributor

EXPLANATION OF THE ISSUE

If a child product of a grouped product is on sale, the parent (grouped) product gets a sale badge, however, if using the sale_products shortcode, the parent product is not displayed. I believe that the correct behaviour would be that the parent product would be displayed with the shortcode.

STEPS TO REPRODUCE THE ISSUE

  1. A grouped product exists
  2. At least one of the grouped product's child products is on sale
  3. See that the parent product has a sale badge
  4. See that the parent product is not output by the sale_products shortcode

SYSTEM STATUS

``` ` ### WordPress Environment ###

Home URL: http://local.woo
Site URL: http://local.woo
WC Version: 3.0.5
Log Directory Writable: ✔
WP Version: 4.7.4
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: ✔
WP Cron: ✔
Language: en_US

Server Environment

Server Info: nginx/1.11.8
PHP Version: 7.0.14-2+deb.sury.org~trusty+1
PHP Post Max Size: 1 GB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.35.0
OpenSSL/1.0.1f

SUHOSIN Installed: –
MySQL Version: ❌ 5.5.53 - We recommend a minimum MySQL version of 5.6. See: WordPress requirements
Max Upload Size: 1 GB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 3.0.5
WC Database Prefix: wp_
woocommerce_sessions: ✔
woocommerce_api_keys: ✔
woocommerce_attribute_taxonomies: ✔
woocommerce_downloadable_product_permissions: ✔
woocommerce_order_items: ✔
woocommerce_order_itemmeta: ✔
woocommerce_tax_rates: ✔
woocommerce_tax_rate_locations: ✔
woocommerce_shipping_zones: ✔
woocommerce_shipping_zone_locations: ✔
woocommerce_shipping_zone_methods: ✔
woocommerce_payment_tokens: ✔
woocommerce_payment_tokenmeta: ✔

Security

Secure connection (HTTPS): ❌Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
Hide errors from visitors: ✔

Active Plugins (2)

WooCommerce Stripe Gateway: by WooCommerce – 3.1.7
WooCommerce: by Automattic – 3.0.5

Settings

API Enabled: ✔
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

WC Pages

Shop base: #4 - /shop/
Cart: #5 - /cart/
Checkout: #6 - /checkout/
My account: #7 - /my-account/

Theme

Name: Twenty Seventeen
Version: 1.2
Author URL: https://wordpress.org/
Child Theme: ❌ – If you're modifying WooCommerce on a parent theme you didn't build personally
then we recommend using a child theme. See: How to create a child theme

WooCommerce Support: ✔

Templates

Overrides: –
`

</details>

<!--
BEFORE POSTING YOUR ISSUE
- These comments won't show up when you submit the issue.
- Try to add as much detail as possible. Be specific!
- GitHub issues ARE NOT FOR SUPPORT! If you have questions, use the either:
  - https://wordpress.org/support/plugin/woocommerce for general support
  - https://woocommerce.com/my-account/tickets/ for premium plugin support
- If you're requesting a new feature, explain why you'd like it to be added.
- Search this repository (top of the page) for the issue and it has not been fixed or reported already.

Before logging BUGS, ensure you:
- Use the latest stable release of WooCommerce.
- Disabled all plugins to ensure it's a core bug and not a plugin issue.
- Switched to Twenty Twelve theme to ensure it's a core bug and not a theme issue.
-->
@claudiulodro claudiulodro added type: enhancement The issue is a request for an enhancement. type: bug The issue is a confirmed bug. labels May 5, 2017
@mikejolley mikejolley added status: won't fix The issue won’t be fixed. status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. and removed type: bug The issue is a confirmed bug. status: won't fix The issue won’t be fixed. labels May 8, 2017
@mikejolley
Copy link
Member

This one is not going to change (for now). The sale badge reflects that of the children within the group and you can see it's dynamically done here:

public function is_on_sale( $context = 'view' ) {

No sale status is stored on the grouped product itself so there is nothing to query when getting sale_products via the shortcode.

We can get the children, but remember each child can be in multiple groups now so grabbing all grouped products and comparing them to the found children would be too inefficient.

This cannot be fixed until #14217 is in place enabling us to do a more efficient query. Let's revisit this once we have that table in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. status: won't fix The issue won’t be fixed. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

3 participants