Sometimes you may require to change the default Magento URLs of some of the pages in order to handle and recognize them in a better way. The use of fancy URL leads you to initiate rewrite for them.
Here we have come up with a quick solution to change URL of checkout page. From this, you can change URLs of wishlist page and customers’ my account page as well.
Basic checkout page URL is something like:
domain.com/checkout
domain.com/checkout/#shipping
domain.com/checkout/#payment
-
- Create a new module with module.xml file
1<!--?xml version="1.0"?--> - Go to etc/frontend/routes.xml and change the code as stated below.
1<!--?xml version="1.0"?-->
- Create a new module with module.xml file
Easily create Custom URL for checkout page in #magento2 https://t.co/fWDH05u5Xi
— MageComp (@theMageComp) February 15, 2016
- Go and find sections.xml” located at etc/frontend, it must be something like this,
1<!--?xml version="1.0"?-->1 - You will need to override all the actions resided at Magento/Catalog/etc/frontend/sections.xml and you’re done.
Hope you have found this effective rewrite trick useful and it will definitely help you creating fancy URLs in Magento.
Feel free to contact if you have any queries regarding. We would appreciate your comments and suggestions.
Would it be possible to update snippets, since they appear to be empty ?
I need to make
domain.com/checkout/#shipping -> domain.com/checkout/step/shipping or something in that direction
its not working can exaplin in details?
Hello guys,
I got that answer
http://magento.stackexchange.com/questions/100615/magento-2-how-can-refresh-minicart-cache-after-clear-cart-session-and-place-orde
Glad to hear 🙂
Hello How to update mini cart in magento 2 actually we created quick view when tou added product to cart then
mini cart is not updated after page refresh it shows can you tell how do it in jquery or code
Try placing this code in ajax success method,
if (typeof extendFunctions !== "undefined" && typeof extendFunctions.showMiniCart !== "undefined") {
extendFunctions.showMiniCart.each(function(item_function, index) {
if(jQuery.isFunction(item_function)) {
item_function(data);
}
})
}
if(mobilecheck()) {
jQuery('html, body').animate({ scrollTop: 0 }, 'slow');
}
Hi,
I create a order programmability but my mini-cart cache not showing item in this and when i click on this showing cart is empty.
So how can i refresh mini-cart cache?
Hi Prince Yadav,
Generally in Magento 1, mini cart can be updated using following code. You can try implementing it in your script.
$miniCart = $this->getLayout()
->createBlock('checkout/cart_sidebar')
->addItemRender('simple', 'checkout/cart_item_renderer', 'checkout/cart/sidebar/default.phtml')
->addItemRender('configurable', 'checkout/cart_item_renderer_configurable', 'checkout/cart/sidebar/default.phtml')
->setTemplate('checkout/cart/cartheader.phtml')
->toHtml();
And if you are using AJAX mini cart, use following code:
if (typeof extendFunctions !== "undefined" && typeof extendFunctions.showMiniCart !== "undefined") {
extendFunctions.showMiniCart.each(function(item_function, index) {
if(jQuery.isFunction(item_function)) {
item_function(data);
}
})
}
Drop us again if you need more help.