New answers tagged

0

What worked for me was simply moving each tab in the order I wanted. <move element="product.info.description" destination="product.info.details" /> <move element="reviews.tab" destination="product.info.details" /> <move element="product.custom.tab" destination="product.info.details" /> Hope this helps!


0

The problem that I just stumbled across was that this "footer before" block does not follow Magento's naming conventions. I tried referencing it by "footer_before" which did not work, I had to use "footer.before" according to RWD's page.xml: <reference name="footer.before"> <block type="page/html" name="foo" after="-" template="template.phtml" /...


0

create a plugin to check the product status "afterGetStatus" method for class \Magento\Catalog\Model\Product, if the product status is disabled, then create a custom 404 page and forward the controller to that. Find below the code to do that, I have checked it and it is working. di.xml <type name="Magento\Catalog\Model\Product"> <plugin name="...


0

Most likely the $paymentInfoBlock class extends Mage_Core_Block_Template and not Mage_Adminhtml_Block_Template. Specifically to your extension, replacing $blockType = 'core/template'; with $blockType = 'adminhtml/template'; should do the trick.


0

Doesn't matter either you are clearing cache from admin console or from command line. It will clear all the active cache. Cache:flush will remove both "Active" and "Inactive" cache. The only difference is, when you remove the cache from command line, you need to set the permission back. Can you show me what are you trying to update in "default_head_blocks....


0

If you use custom theme means follow the below steps 1. Open the 'theme' table and update the type=0 for the particular custom theme. 2. php bin/magento setup:static-content:deploy -f 3. php bin/magento c:f Finally we got the solution.


3

Please Check Below Step :- Go to your Magento store root folder. You need open the contact_index_index.xml file to edit. The file is stored under the app\design\frontendMgs\child_theme_name\Magento_Contact\layout folder. Add This Code In contact_index_index.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:...


0

https://gist.github.com/joshfortyfour/11d0f7dbc7be9e85bf4e9c62c668f465 @here you find a list of containers still it is difficult to locate right one but i know you can manage to find the right one. or as above some one provides a free module link to find container or block in magento , i tried it but still it is some how useful in respoect to wandering ...


3

Go To Store -> (Under Attribute) Product Search page_layout Attribute. Set Your Default Layout


0

Your custom container should be under product.info <block class="Magento\Catalog\Block\Product\View" name="product.info" template="Magento_Catalog::product/view/form.phtml" ...> try BY default product.info.form.options coming at underproduct.info so, you no need to custom option section.


0

Inside module.xml file, you have to declare dependency of core module, <?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="Vendor_Modulename" setup_version="1.0.0" active="true"> <sequence> ...


0

Resolved. I just wasn't including enough layout information: <?xml version="1.0" ?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="page.bottom.container"> <container ...


0

Your code is correct: <referenceBlock name="product.info.sku" remove="true" /> You don't need to change your composer.json or delete the static folders or change permissions or run the static content deployment. You just have to clear the cache bin/magento cache:clean and see the changes. If it doesn't work you can try: Check the browser cache (it'...


0

Just add below code to catalog_product_view.xml file for the simple and configurable product: For Simple Product <referenceBlock name="product.info.addtocart"> <block class="Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist" name="view.addto.wishlist" template="Magento_Catalog::product/view/addto/wishlist.phtml" /> </...


0

To set a default grid value of 48 products for one category, you have to set "Products per Page on Grid Allowed Values" configuration in Store > Configuration > Catalog >Catalog > Store Front > Products per Page on Grid Allowed Values add 48. You will have to then move to catalog > categories (select the category in which you have to set default grid value ...


0

You can enable a template path hints for admin System > Configuration > Developer > Debug Select Yes to Template Path hints and Add Block names to hints You can get the controller from the Url. Hope it Helps.


0

Mage/Adminhtml module is responsible for backend functionality. Here you can find Controller & block related to each module in backend. For Customer block, you can refer in Mage/Adminhtml/Block/Customer/. For Backend layout & template, you can check on below two paths: app/design/adminhtml/default/default/layout/ app/design/adminhtml/default/...


0

There's an issue with default_head_blocks.xml if the theme type is set to virtual. Check the type field in the theme table. If it's set to 1, try setting it to 0. Then clear the cache and reload the page. See if that does the trick. See also: https://github.com/magento/magento2/issues/4330


2

I've found a solution pretty simple. $block = $result->getLayout()->setData(['test'=> 'Content here'])->getBlock('category.description'); $block->setTemplate('Vendor_Module::myTemplate/blank.phtml') ->toHtml(); Then my blank.phtml: <?php print_r($this->getData()) ?> It prints: Array ( [test] => Content here [module_name] =&...


3

You should try this echo $this->getLayout()->createBlock("Vendor\Module\Block\Myblock")- >setTemplate("My_Module::history-suite.phtml")->toHtml();


2

You will have to override customer_account_index.xml. To Override this file in your extension, copy customer_account_index.xml at app/code/VendorName/ModuleName/view/frontend/layout and add below code : <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:...


0

I fix the problem like this .my-container { width: 100vw; position: relative; margin-left: -50vw; left: 50%; padding: 50px 0; margin-bottom: 50px; margin-top: 50px; background-color: #fafafa; }


2

To override the layout file in module simple SpaceName/ModuleName/view/frontend/layoutname.xml Example SpaceName/ModuleName/view/frontend/cms_index_index.xml Your Case SpaceName\ModuleName\view\frontend\layout\customer_account_index.xml


0

To add a list of new products on the home page of your website you can follow the below instructions 1st Method Go to the following location Admin (backend) > Content > Elements > Widgets Click on the Add Widgets. In Settings section select Type => Catalog new Product List & select your theme & press to continue. In Storefront Properties ...


0

If you want it can be done via admin : Create a Cms Block , and as a content , inser a widget : Add widget type : Catalog Product List Set Number of Products to Display: (usually is used 4 ) Tempate : Products Grid Template For your request to be the New Products : You can either use a condition to set up a category for the new products. Or you dont wont ...


1

I guess that you want a new product collection depends created_atfield. So, you have to create a block class at your module and at that block class, you have to create a product collection and sort by DESCENDING created_at ORDER. I have create a block class at here depends on the structure of Magento\Catalog\Block\Product\NewProduct and that block class ...


2

Try Below way. Create your block file and add below code <?php namespace YourCompanyName\YourModuleName\Block; class YourCustomBlock extends \Magento\Framework\View\Element\Template { protected $_productCollectionFactory; protected $_productVisibility; public function __construct( \Magento\Framework\View\Element\Template\Context $...


0

You can pass arguments in M2 https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/xml-instructions.html#argument Example: Setting a value of css_class in the [app/code/Magento/Theme/view/frontend/layout/default.xml] layout file: <arguments> <argument name="css_class" xsi:type="string">header links</argument> </...


1

This is a tricky one, I got a similar case and found a solution, using the _initSelect in the collection and changing the index in the xml. Just follow the steps and you will be fine! First you need to add a preference for the collection and overwrite _initSelect(): <preference for="Magento\GiftCardAccount\Model\ResourceModel\Giftcardaccount\Collection" ...


Top 50 recent answers are included