• Resolved bleulundi

    (@bleulundi)


    Hello,

    I’m using your EU Withdrawal and Legal Guarantee Compliance plugin on my WooCommerce website, which is a French-language online store.

    I would like to adapt the customer account endpoint URL to better suit a French-speaking audience.

    Currently, the withdrawal section is accessible at /my-account/withdrawal/ (or /mon-compte/withdrawal/ on my site). I would like to change the endpoint slug from withdrawal to retractation, so the URL becomes /mon-compte/retractation/.

    I couldn’t find an option to customize this endpoint in the plugin settings or in WooCommerce.

    Is there a recommended way to change the endpoint slug ?

    Thank you for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Fernando Tellado

    (@fernandot)

    Hi @bleulundi,

    There is no setting for it, but you can change it with a small snippet, because the plugin’s account tab is a regular WooCommerce endpoint:

    /* Change My Account withdrawals endpoint */ 
    add_filter( 'woocommerce_get_query_vars', function ( $vars ) {
    $vars['withdrawal'] = 'retractation';
    return $vars;
    } );

    Add it with a code snippets plugin (only if you’re already using one, because always is a bad idea use this kind of plugins for security concerns), in your child theme’s functions.php, or much better in a mu-plugin, then go to Settings > Permalinks and click Save changes once, so WordPress learns the new URL.

    From then on the My account menu item and the withdrawal button of each order point to /mon-compte/retractation/. The old /mon-compte/withdrawal/ address keeps working, so nothing already sent or bookmarked breaks.

    I would rather not add one more setting just for this, but I have noted your request, and the snippet will keep working in future versions.

    Fernando

    Thread Starter bleulundi

    (@bleulundi)

    Hi @fernandot ,

    Thank you so much for your help! The snippet works perfectly, and the URL is now exactly what I wanted.

    I really appreciate your support and the work you put into developing and maintaining this plugin. It’s a great help for small businesses like mine!

    Thanks again! 😊

    Plugin Author Fernando Tellado

    (@fernandot)

    You’re welcome

    🙂

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.