Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/
    laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    Howdy!

    Can you try this rewrite rule?:

    /**
     * Add rewrite rule from <code>/shop/keyword/</code> to <code>shop/?search_text=keyword</code>
     */
    add_action( 'init', function (): void {
        add_rewrite_rule(
            '^shop/([^/]*)?',
            'index.php?post_type=product&search_text=$matches[1]',
            'top'
        );
    } );

    Then, you’ll flush your permalink settings by hitting the Save button. No need to make any other changes.

    Let me know if this helps!

    • This reply was modified 5 years, 8 months ago by laceyrod.
    Thread Starter ozanyilmaz2017

    (@ozanyilmaz2017)

    Yes, Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘RewriteRule on Shop Page for Search Keyword’ is closed to new replies.