- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Magento 2.3 Best Practice on Saving an updated file and proper Theme structure
Hi,
I am new to Magento and I am working on a store in Magento 2.3. I want to have the proceed to checkout button in the minicart open the shopping cart page instead of Shipping because the customer doesn't get the option for a gift card on the shipping page but does in the shopping cart.
I updated the sidebar.php file and set the checkout url to get the shopping cart url on line 78, is this the correct way of doing this? I works just as I want it to.
Also, I made the change to the core file and of course, I don't want to do that either. I have created a theme but I am confused as how to save this file in the correct folder structure.
The sidebar.php file is in vendor -> magento -> module-checkout -> Block -> Cart
to save it to my theme, do I created the path below, but that doesn't work? Where do I save this file in MyTheme Sturcture?? Should the Block folder go inside the Magento_Checkout folder in MyTheme?
app-> design->frontentend-> MyFolder-> MyTheme_-> vendor -> magento -> module-checkout -> Block -> Cart
Any help is appreciated and thank you for your patience as I learn Magento
Thank You very much. Marisol
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2.3 Best Practice on Saving an updated file and proper Theme structure
You cant override any PHP file in your custom theme, You can only override phtml file in your custom theme.
You are trying to override Block Php file so you cant does this stuff in your theme level.
You need to follow below tutorial for override your block,
https://magenticians.com/magento-2-override-block/
Magento 2 Blogs/Tutorial