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

Facets resets/removes Woocommerce default sorting orderby= query string #2960

Closed
ouch-digital opened this issue Aug 24, 2022 · 2 comments · Fixed by #2982
Closed

Facets resets/removes Woocommerce default sorting orderby= query string #2960

ouch-digital opened this issue Aug 24, 2022 · 2 comments · Fixed by #2982

Comments

@ouch-digital
Copy link

Hey EP Team, firstly thank you for creating such an amazing plugin.

This is a little feature request to persist the orderby= query string when filtering facets in EP.

When sorting using Woocommerce orderby= (sort by price, relevance etc), when selecting a EP facet, the WC orderby query string is removed when the new page is loaded.

Describe the solution you'd like

It would be great if this persisted after refresh in the same way that the search s= query string is retained.

A possible solution might be to include the orderby= query into the new page refresh using $referer = wp_get_referer();

Thanks in advance and have a great day.

@felipeelia
Copy link
Member

Hey @ouch-digital,

Thanks for the idea! We will add that in a future release. In the meantime, you can use the following snippet:

add_filter(
	'ep_facet_allowed_query_args',
	function ( $args ) {
		$args[] = 'orderby';
		return $args;
	}
);

I am marking this as a good first issue, as the solution in the plugin should be as simple as adding orderby to this array.

@felipeelia felipeelia added this to the 4.4.0 milestone Aug 29, 2022
@ouch-digital
Copy link
Author

Thank you! @felipeelia

That's awesome. Have a great day. I will continue to let you know if I find any small ways I can contribute to the project.

Warm regards

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

Successfully merging a pull request may close this issue.

3 participants