cancel
Showing results for 
Search instead for 
Did you mean: 

Modify Checkout URL

Modify Checkout URL

Hi There,

 

Can any one please guide me on how I can change the "Go to checkout" url to a bespoke magento URL i.e.

 

test.com/checkout -> test.com/my/checkout

 

Thanks!!

1 REPLY 1

Re: Modify Checkout URL

You can change the word "checkout" in the URL to something else. Add a etc/frontend/routers.xml file to any of your modules with the following content:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="checkout" frontName="thenameyouwant">
            <module name="Magento_Checkout" />
        </route>
    </router>
</config>

Take care that your module is being loaded after the Magento_Checkout module, i.e. by modifying your etc/module.xml as follows:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Your_Module" setup_version="0.1.0">
        <sequence>
            <module name="Magento_Checkout"/>
        </sequence>
    </module>
</config>

You cannot change the whole path easily, that'd be much more complicated.

Andreas von Studnitz, Trainer, Consultant, Developer and CEO of integer_net, Germany.