PR #25419 added a filter to change the value of the text in a button in
the cart-empty.php template. But it mistakenly changed the
capitalization of the string from 'Return to shop' to 'Return To Shop'.
This commit simply restores the string to its original version.
This commit reverts the functionality introduced in PR #26260
(later refined by #27175, #27190, #27508) in which filtering by
attribute using the layered nav widget was improved to handle the
cases of variations out of stock. The revert is a response to the
numerous problems reported by users in Woo 4.4 and 4.5
Not all the code has been reverted, only the code that resulted in
visible functionality changes. Thus, the code that generates
term relationships for variations is still in place to keep database
consistency and to keep the reverting changes to the minimum needed.
* Update cart-empty.php
Added filter to change "Return to Shop" button text
* Update cart-empty.php
* Escape HTML and add docblock
Co-authored-by: Claudio Sanches <contato@claudiosanches.com>
The layered nav filtering doesn't work well with variable products
when some variations have stock and other don't. When a term is
selected in the widget, a variable product having no stock for
the variation corresponding to that term but having stock for
other variations will be displayed, but it shouldn't.
This commit fixes that by introducing two changes:
- A new override of "is_visible" for WC_Product_Variable that
looks at the supplied filters, compares them against the corresponding
available variations and calculates the visibility based on
the query type (OR or AND).
- A hook on the "found_posts" filter in WC_Query, that adjusts
the posts count based on the found products visibility
when there are filters available; this is needed to sync the
"displaying X posts" messages and the paging when variable
products are hidden due to stock status.
Additionally, the visibility calculated in "found_posts" is cached
as loop variables so that it isn't calculated again when actually
displaying the products.
There is an extra dot "." right after the generated password string which is not part of the actual password and creates confusion for the users who want to login. It would be great if we can remove it.