Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Bug: All products block ignoring filters to modify product prices hooks #8972

Closed
melberthrymera opened this issue Apr 6, 2023 · 4 comments
Closed
Labels
type: bug The issue/PR concerns a confirmed bug.

Comments

@melberthrymera
Copy link

melberthrymera commented Apr 6, 2023

Describe the bug

I can't use woocommerce block filter to change product prices display using "All Products" Gutenberg blocks.

To reproduce

Steps to reproduce the behavior:

  1. log in to your store as admin.
  2. Create any type of products.
  3. Go to pages and add a new page.
  4. Use Gutenberg editor and select "All Products" block.
  5. Visit new added "All product" page.
  6. Try to modify the added products prices with any of the hooks below.
- woocommerce_blocks_product_grid_item_price - This hook allows you to modify the HTML markup for the product price displayed in the grid. You can use this hook to customize the appearance of the product price.
- woocommerce_blocks_product_grid_item_price_html: This hook allows you to customize the HTML for the product price in each product grid item.
- woocommerce_template_loop_price function, which is used to display the price of a product on the shop and archive pages.
  1. Check the "All Products" page.

Expected behavior

It should display modified prices in all blocks when use any filter hooks above.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

WordPress (please complete the following information):

  • WordPress version: 6.2
  • Gutenberg version (if installed): Built-in WordPress
  • WooCommerce version: 7.5.1
  • WooCommerce Blocks version: Built-in woocommerce plugin
  • Site language:
  • Any other plugins installed:

Desktop (please complete the following information):

  • OS: macOS, Windows
  • Browser: All browser

Smartphone (please complete the following information):

  • Device: Any device
  • OS: [e.g. iOS8.1]
  • Browser: All browser

Additional context

The purpose of this is to should display custom discounted prices using "All Products" block.

Note: I use "Product" block and work well.

@melberthrymera melberthrymera added the type: bug The issue/PR concerns a confirmed bug. label Apr 6, 2023
@gigitux
Copy link
Contributor

gigitux commented Apr 7, 2023

The All Products block doesn't support any filter/hook. For this reason, we are focusing on the Products block that also provides compatibility with filters and hooks of WC Core and performs better.

Is there a particular use case that you want to cover using the All Products block?

@jkohlbach
Copy link

@gigitux as a third party dev, we are looking to filter the price and product visibility in particular (we're a wholesale plugin).

I'm sure there's lots of other use cases as well (multi-currency, dynamic discounts, etc) that would require this to be filterable but this one of our particular ones.

Since core is pushing for blocks of all kinds it would be great if we could maintain the standard of filtering all the things which is one of Woo's big draw cards for extensibility.

@gigitux
Copy link
Contributor

gigitux commented Apr 11, 2023

Thanks for giving me context.

We're currently working on a Products block that's available in a beta version since WooCommerce Blocks 9.1.0. The progress around that block can be tracked through this issue: woocommerce/woocommerce#42616. The plan is to migrate the existing product grid blocks (including All Products) to the new Products block.

One of the major point to use the Products block is that it supports the hooks of WC Core.

Given the direction towards the Products block, your suggestions don't fit with our current priorities/strategy for the project. This doesn’t mean what you are suggesting isn’t a good idea or doesn’t make sense – it’s just that we have limited time to work on various projects and bringing Products block to its full capacity is a top priority.

The progress on Products block can be followed through the Store Editing Snaps series that we publish every other week. Here's a link to the latest edition.

The plan is that this block will in future start to replace other blocks such as All Products, but don't be alarmed these blocks will continue to work but we just won't be actively supporting them and will instead start to encourage the adoption of the Products block once it's come out of the Beta phase.

I'll go ahead and close this issue for now, but it does not mean that we didn't note the suggestions from this issue. Also, please be aware that closed issues can also still be commented on.

@gigitux gigitux closed this as completed Apr 11, 2023
@jkohlbach
Copy link

Thanks also @gigitux - we just wanted to know where it was at/heading. Good to know progress is coming on the Products block.

I would definitely encourage you and the team to think about extensibility, lots of plugins like ours work with display of products. If this new block is going to be the one block to rule them all it really needs to be quite flexible in terms of filtering both product content (like price and other elements) and also product visibility.

Will also post a question about RC timeline on the latest blog post for you :) thanks again

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

No branches or pull requests

3 participants