Home Forums WoodMart support forum Woocommerce brand URL and brand attribute URL merge

Woocommerce brand URL and brand attribute URL merge

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #89690

    magnet
    Participant

    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

    #89704

    Artem Temos
    Keymaster

    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

    #89891

    magnet
    Participant

    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

    #89894

    Artem Temos
    Keymaster

    You can change your permalinks structure in Dashboard -> Settings -> Permalinks.

    #89898

    magnet
    Participant

    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.

    #89951

    Artem Temos
    Keymaster

    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.

    #91261

    magnet
    Participant

    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.

    #91263

    Artem Temos
    Keymaster

    Have you placed the code we sent you to the child theme? Please, send us a screenshot where you placed it.

    #91265

    magnet
    Participant

    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.
    #91268

    Artem Temos
    Keymaster

    Please, provide us your admin and FTP access so we can check what is wrong.

    #91270

    magnet
    Participant

    here you go.

    #91272

    Artem Temos
    Keymaster

    Try to turn on “Enable archives” option for the brand attribute in Dashboard -> Products -> Attributes.

    #91274

    magnet
    Participant

    Great, I checked “enable archives” and it seems to be working now.

    Thank you.

    #91292

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

Tagged: ,

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Woocommerce brand URL and brand attribute URL merge’ is closed to new replies.