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

Bugfix: Product shortcode triggering error when category is empty #48

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

DogByteMarketing
Copy link
Contributor

Using the product shortcode with no categories triggers an error because type is not being passed to WP_Query.

Bugfix: Using the product shortcode with no categories triggers an error because type is not being passed to WP_Query.
@crftwrk
Copy link
Member

crftwrk commented Aug 31, 2023

I don't get an error when an empty category is selected in the shortcode? What is the test case?

@DogByteMarketing
Copy link
Contributor Author

DogByteMarketing commented Aug 31, 2023

[31-Aug-2023 20:36:11 UTC] PHP Fatal error: Uncaught Error: Call to a member function is_on_sale() on null in E:\www\test\wp-content\themes\test\woocommerce\loop\sale-flash.php:25
Stack trace:
#0 E:\www\test\wp-content\plugins\woocommerce\includes\wc-core-functions.php(345): include()
#1 E:\www\test\wp-content\plugins\woocommerce\includes\wc-template-functions.php(1422): wc_get_template('loop/sale-flash...')
#2 E:\www\test\wp-includes\class-wp-hook.php(308): woocommerce_show_product_loop_sale_flash('')
#3 E:\www\test\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#4 E:\www\test\wp-includes\plugin.php(517): WP_Hook->do_action(Array)
#5 E:\www\test\wp-content\plugins\bs-swiper-main\templates\sc-swiper-card-product.php(77): do_action('woocommerce_bef...')
#6 E:\www\test\wp-includes\shortcodes.php(355): bootscore_product_slider(Array, '', 'bs-swiper-card-...')
#7 [internal function]: do_shortcode_tag(Array)
#8 E: in E:\www\test\wp-content\themes\test\woocommerce\loop\sale-flash.php on line 25

Copy link
Member

@crftwrk crftwrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thank you.

@crftwrk crftwrk merged commit 0e7e9a9 into bootscore:main Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants