When you first activate Return-sell on your Magento 2 webshop, there are already two pages set up for you to use for Return-sell, and you can select which on you would like in the Swiipe Return-sell settings.
However, Return-sell can also be displayed on a different page that contains other elements or has a different url and page name than the ones that it comes with. If you would like to display Return-sell on a different page (one that you made yourself) – this guide is for you.
To display Return-sell on a different page, you must add that page as a custom page in Swiipe Return-sell settings. This is how:
- Go to your webshops admin panel on Magento 2 and log in.
If you’re not sure where to find it, type in “/admin” at the end of your webshops URL, e.g. webshop.dk/admin. - In the main menu select System, find the Swiipe section and click on Settings.
- In the Swiipe Settings page, navigate to the Return-sell tab.
- Ensure to select the specific store in the scope switcher, for which you want to set up the Return-sell page.
- In the Return-sell settings, under Return-sell page, click the Add custom page button.
- In the popup for the custom page enter the name of the page you want to use for Return-sell and click Done.
- Save the settings.
- Now go to your webshops FTP server (access should be provided by your hosting provider).
- Navigate to the vendor folder, then go to the swiipe folder, and then open the folder called checkout_dk.
- From the checkout_dk folder go to the etc folder, and then open the frontend folder.
- Open the routes.xml file and add the following code above the </router> tag:<route frontName="custom-page-name" id="custom-page-name">
<module name="Swiipe_Checkout"/>
</route>
! Ensure to replace “custom-page-name” with the actual name of the page you want to use for Return-sell. - Go back to the checkout_dk folder and navigate to the view folder. Then find the frontend folder, and in it open the layout folder
- In the layout folder create a new file called custom-page-name_index_index.xml, where “custom-page-name” is the name of the page you want to use for Return-sell.
- Open the newly created file and enter the code:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Returns page</title>
</head>
<referenceContainer name="content">
<block class="Swiipe\Checkout\Block\ReturnSell\Index" name="custom-page-name_index" template="Swiipe_Checkout::returnsell/returnsell.phtml" cacheable="false"/>
</referenceContainer>
</page>
! Ensure to replace “custom-page-name” with the actual name of the page you want to use for Return-sell. - Go back to your webshops admin panel on Magento 2.
If you’re not sure where to find it, type in “/admin” at the end of your webshops URL, e.g. webshop.dk/admin. - In the main menu, select System, find the Tools section, and click on Cache Management.
- In the Cache Management page, click Flush Magento Cache.
- You should now see the Return-sell on your chosen custom page.
Check it by going to: https://your-webshop-domain.com/custom-page-name, where your-webshop-domain.com is just your webshop URL, and custom-page-name is the name of the page you chose to use for Return sell.
Kommentarer
0 kommentarer
Log ind for at kommentere.