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

Possible bug setting featured products #13934

Closed
ghost opened this issue Apr 5, 2017 · 5 comments
Closed

Possible bug setting featured products #13934

ghost opened this issue Apr 5, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2017

EXPLANATION OF THE ISSUE

I have Version 3.0.0 and it would seem that the meta_key _featured is not being updated when you change this via the edit screen or by clicking the star icon on the product list screen.

STEPS TO REPRODUCE THE ISSUE

Set a featured product either via the Edit Product or List screen, and monitor it's value via SQL, where 123 is the post ID:

SELECT * FROM `wp_postmeta` WHERE `post_id` = 123 AND `meta_key` LIKE '_featured'

The key does not seem to set/update.

SYSTEM STATUS

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

Home URL: http://www.pdc.com/wp-agd
Site URL: http://www.pdc.com/wp-agd
WC Version: 3.0.0
Log Directory Writable: ✔
WP Version: 4.7.3
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_GB

Server Environment

Server Info: Apache/2.4.18 (Ubuntu)
PHP Version: 7.0.15-0ubuntu0.16.04.4
PHP Post Max Size: 10 MB
PHP Time Limit: -1
PHP Max Input Vars: 1000
cURL Version: 7.47.0
OpenSSL/1.0.2g

SUHOSIN Installed: –
MySQL Version: 5.7.17
Max Upload Size: 10 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 3.0.0
WC Database Prefix: wp_storm_
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 (42)

Advanced Custom Fields: Flexible Content Field: by Elliot Condon – 1.1.1
Advanced Custom Fields: Options Page: by Elliot Condon – 1.2.0
Advanced Custom Fields: Repeater Field: by Elliot Condon – 1.1.1
Share Buttons by AddThis: by The AddThis Team – 5.3.5
Advanced Custom Fields: by Elliot Condon – 4.4.11
BackupBuddy: by iThemes – 7.1.3.2
Basic Comment Quicktags: by Mika "Ipstenu" Epstein – 3.3.1
Better Font Awesome: by MIGHTYminnow & Mickey Kay – 1.6.0
Admin Columns - ACF add-on: by Codepress – 1.3
Admin Columns: by AdminColumns.com – 2.5.6.4
Custom Upload Dir: by Ulf Benjaminsson – 3.4.3.1
Enable Media Replace: by Måns Jonasson – 3.0.6
EWWW Image Optimizer: by Shane Bishop – 3.2.7
Formidable Honeypot: by Ryan Pilling – 999
Formidable Forms: by Strategy11 – 2.03.04
Image Widget: by Modern Tribe
Inc. – 4.3.1

Intuitive Custom Post Order: by hijiri – 3.0.8
Loco Translate: by Tim Whitlock – 2.0.12
Login LockDown: by Michael VanDeMar – v1.7.1
Max Mega Menu: by Tom Hemsley – 2.3.5
NS Automation for WordPress SEO: by Never Settle – 2.0.6
Parker Design Media: by Parker Design – 1.5.0
Parker Design Retina Images: by Parker Design – 2.0.1
Stormguard Shipping Rates: by Parker Design – 1.0.0
Redirection: by John Godley – 2.5
Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 2.2.6
Roots Rewrites: by Roots – 1.0.1
Rotating Tweets (Twitter widget & shortcode): by Martin Tod – 1.9
Soil: by Roots – 3.0.3
TablePress Extension: DataTables Sorting plugins: by Tobias Bäthge – 1.0
TablePress Extension: Responsive Tables: by Tobias Bäthge – 1.2
TablePress: by Tobias Bäthge – 1.8
WooCommerce WorldPay Gateway: by Add On Enterprises (Andrew Benbow) – 3.5.3 – 3.6.0 is available
WooCommerce MultiStep Checkout: by Mubashir Iqbal – 2.3.1
WooCommerce: by Automattic – 3.0.0
WooCommerce Helper: by WooCommerce – 1.7.2 – Network enabled
Yoast SEO: by Team Yoast – 4.5
WP All Export Pro: by Soflyy – 1.4.5
WP All Import Pro: by Soflyy – 4.4.3
WP Google Maps: by WP Google Maps – 6.4.03
HTML5 Boilerplate .htaccess: by Ben Word –
Media Library Categories Premium: by Jeffrey-WP – 2.1.1

Settings

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

WC Pages

Shop base: #2295 - /products/
Basket: #2296 - /basket/
Checkout: #2297 - /checkout/
My account: #2298 - /my-account/

Theme

Name: Aluminium Gutters Direct
Version: 1.0.0
Author URL: http://parker-design.co.uk
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: agd/woocommerce/archive-product.php
agd/woocommerce/auth/footer.php
agd/woocommerce/auth/form-grant-access.php
agd/woocommerce/auth/form-login.php
agd/woocommerce/auth/header.php
agd/woocommerce/cart/cart-empty.php
agd/woocommerce/cart/cart-item-data.php
agd/woocommerce/cart/cart-shipping.php
agd/woocommerce/cart/cart-totals.php
agd/woocommerce/cart/cart.php
agd/woocommerce/cart/cross-sells.php
agd/woocommerce/cart/mini-cart.php
agd/woocommerce/cart/proceed-to-checkout-button.php
agd/woocommerce/cart/shipping-calculator.php
agd/woocommerce/checkout/cart-errors.php
agd/woocommerce/checkout/form-billing.php
agd/woocommerce/checkout/form-checkout.php
agd/woocommerce/checkout/form-coupon.php
agd/woocommerce/checkout/form-login.php
agd/woocommerce/checkout/form-pay.php
agd/woocommerce/checkout/form-shipping.php
agd/woocommerce/checkout/payment-method.php
agd/woocommerce/checkout/payment.php
agd/woocommerce/checkout/review-order.php
agd/woocommerce/checkout/terms.php
agd/woocommerce/checkout/thankyou.php
agd/woocommerce/content-product.php
agd/woocommerce/content-product_cat.php
agd/woocommerce/content-single-product.php
agd/woocommerce/content-widget-product.php
agd/woocommerce/emails/admin-cancelled-order.php
agd/woocommerce/emails/admin-failed-order.php
agd/woocommerce/emails/admin-new-order.php
agd/woocommerce/emails/customer-completed-order.php
agd/woocommerce/emails/customer-invoice.php
agd/woocommerce/emails/customer-new-account.php
agd/woocommerce/emails/customer-note.php
agd/woocommerce/emails/customer-processing-order.php
agd/woocommerce/emails/customer-refunded-order.php
agd/woocommerce/emails/customer-reset-password.php
agd/woocommerce/emails/email-addresses.php
agd/woocommerce/emails/email-customer-details.php
agd/woocommerce/emails/email-footer.php
agd/woocommerce/emails/email-header.php
agd/woocommerce/emails/email-order-details.php
agd/woocommerce/emails/email-order-items.php
agd/woocommerce/emails/email-styles.php
agd/woocommerce/emails/plain/admin-cancelled-order.php
agd/woocommerce/emails/plain/admin-failed-order.php
agd/woocommerce/emails/plain/admin-new-order.php
agd/woocommerce/emails/plain/customer-completed-order.php
agd/woocommerce/emails/plain/customer-invoice.php
agd/woocommerce/emails/plain/customer-new-account.php
agd/woocommerce/emails/plain/customer-note.php
agd/woocommerce/emails/plain/customer-processing-order.php
agd/woocommerce/emails/plain/customer-refunded-order.php
agd/woocommerce/emails/plain/customer-reset-password.php
agd/woocommerce/emails/plain/email-addresses.php
agd/woocommerce/emails/plain/email-customer-details.php
agd/woocommerce/emails/plain/email-order-details.php
agd/woocommerce/emails/plain/email-order-items.php version 2.1.2 is out of date. The core version is 3.0.0
agd/woocommerce/global/breadcrumb.php
agd/woocommerce/global/form-login.php
agd/woocommerce/global/quantity-input.php
agd/woocommerce/global/sidebar.php
agd/woocommerce/global/wrapper-end.php
agd/woocommerce/global/wrapper-start.php
agd/woocommerce/loop/add-to-cart.php
agd/woocommerce/loop/loop-end.php
agd/woocommerce/loop/loop-start.php
agd/woocommerce/loop/no-products-found.php
agd/woocommerce/loop/orderby.php
agd/woocommerce/loop/pagination.php
agd/woocommerce/loop/price.php
agd/woocommerce/loop/rating.php
agd/woocommerce/loop/result-count.php
agd/woocommerce/loop/sale-flash.php
agd/woocommerce/myaccount/dashboard.php
agd/woocommerce/myaccount/downloads.php
agd/woocommerce/myaccount/form-add-payment-method.php
agd/woocommerce/myaccount/form-edit-account.php
agd/woocommerce/myaccount/form-edit-address.php
agd/woocommerce/myaccount/form-login.php
agd/woocommerce/myaccount/form-lost-password.php
agd/woocommerce/myaccount/form-reset-password.php
agd/woocommerce/myaccount/lost-password-confirmation.php
agd/woocommerce/myaccount/my-account.php
agd/woocommerce/myaccount/my-address.php
agd/woocommerce/myaccount/my-downloads.php
agd/woocommerce/myaccount/my-orders.php
agd/woocommerce/myaccount/navigation.php
agd/woocommerce/myaccount/orders.php
agd/woocommerce/myaccount/payment-methods.php
agd/woocommerce/myaccount/view-order.php
agd/woocommerce/notices/error.php
agd/woocommerce/notices/notice.php
agd/woocommerce/notices/success.php
agd/woocommerce/order/form-tracking.php
agd/woocommerce/order/order-again.php
agd/woocommerce/order/order-details-customer.php
agd/woocommerce/order/order-details-item.php
agd/woocommerce/order/order-details.php
agd/woocommerce/order/tracking.php
agd/woocommerce/product-searchform.php
agd/woocommerce/single-product/add-to-cart/external.php
agd/woocommerce/single-product/add-to-cart/grouped.php
agd/woocommerce/single-product/add-to-cart/simple.php
agd/woocommerce/single-product/add-to-cart/variable.php
agd/woocommerce/single-product/add-to-cart/variation-add-to-cart-button.php
agd/woocommerce/single-product/add-to-cart/variation.php
agd/woocommerce/single-product/meta.php
agd/woocommerce/single-product/price.php
agd/woocommerce/single-product/product-attributes.php
agd/woocommerce/single-product/product-image.php
agd/woocommerce/single-product/product-thumbnails.php
agd/woocommerce/single-product/rating.php
agd/woocommerce/single-product/related.php
agd/woocommerce/single-product/review.php
agd/woocommerce/single-product/sale-flash.php
agd/woocommerce/single-product/share.php
agd/woocommerce/single-product/short-description.php
agd/woocommerce/single-product/tabs/additional-information.php version 2.0.0 is out of date. The core version is 3.0.0
agd/woocommerce/single-product/tabs/description.php
agd/woocommerce/single-product/tabs/tabs.php
agd/woocommerce/single-product/title.php
agd/woocommerce/single-product/up-sells.php
agd/woocommerce/single-product-reviews.php
agd/woocommerce/single-product.php
agd/woocommerce/taxonomy-product_cat.php
agd/woocommerce/taxonomy-product_tag.php

Outdated Templates: ❌Learn how to update
`

</details>
@mikejolley
Copy link
Member

_featured is not used in 3.0. Featured is a term - product_visibility taxonomy.

@ghost
Copy link
Author

ghost commented Apr 5, 2017

Thanks for leading me onto this. I missed this in the change log.

Here's a custom query should anyone have this issue, as by the looks of it Woocommerce runs a database update so it should work with your existing featured products:

$args = array(
    'post_type' => array(
        'product', 
        'product_variation'
    ),
    'posts_per_page' => 16,
    'post_status'    => 'publish',
    'tax_query' => array(
        array(
            'taxonomy' => 'product_visibility',
            'field'    => 'slug',
            'terms'    => 'featured'
        )
    ),
);

@alexandrecanuto
Copy link

@simonmacfadyen You, sir, are a savior!

@shaunvine
Copy link

Yes!!! It works. I have been searching and trying other loops. Nothing worked until this post. Thank you!

@AnthonyLombard
Copy link

Anyone know how I would access these via SQL? eg to remove all featured with one sql call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants