Woocommerce brand URL and brand attribute URL merge
-
Hello,
Is it possible to merge (or any other way) URL addresses of brands that WooCommerce provides and those that come with theme as a brand attributes?
We would like to list products from one brand like this:
https://myshop.sk/znacka/veva
Right now, only way to list brand attribute is like this:
https://myshop.sk/shop/?filter_znacka=veva
Hello,
You can add the following code to the functions.php file in the child theme to change brands link structure there
add_filter( 'woodmart_brands_link', function( $link, $brand ){
return get_term_link( $brand->term_id, $brand->taxonomy );
}, 10, 2 );
Kind Regards
I added the code, but I don’t know how to change it so I’ll get the expected result – site.com/brand/brand-name. Can you edit the code or help me with understanding how to achieve desired URL?
The result I got with your code: https://myshop.sk/?taxonomy=pa_znacka&term=veva
You can change your permalinks structure in Dashboard -> Settings -> Permalinks.
Of course I tried that but doesnt seem to work.
When I access the brand I want to list with url /brand/brand-name/ only thing I get is the PNG logo of the brand.
Sorry, but your problem is not quite clear for us. Please, explain in details for better understanding. And we don’t see your website because of the maintenance mode active.
I disabled maintenance mode, so you can check it out.
We want Google to index the page that has listed all the products from one brand. (for example the link in the private content) Problem is, that the link has parameters in it and Google may have problem with indexing that page.
more in the private content.
Have you placed the code we sent you to the child theme? Please, send us a screenshot where you placed it.
I tried it before, it wasn´t working as expected. I put it in functions.php again so you can see it.
Attachments:
You must be
logged in to view attached files.
Please, provide us your admin and FTP access so we can check what is wrong.
Try to turn on “Enable archives” option for the brand attribute in Dashboard -> Products -> Attributes.
Great, I checked “enable archives” and it seems to be working now.
Thank you.
You are welcome! If you have any questions please feel free to contact us.
Best Regards
The topic ‘Woocommerce brand URL and brand attribute URL merge’ is closed to new replies.