Hot answers tagged

14

In Magento 2.3.1 or Above we can use sort_order argument in "app/design/frontend/Packagename/themename/Magento_Catalog/layout/catalog_product_view.xml" xml config <referenceBlock name="product.info.description"> <arguments> <argument name="title" translate="true" xsi:type="string">Description</argument> <...


8

I just stumbled across the answer. As of Magento 2.3.1, if the tab does not have a sort order set, it uses 0. Unfortunately, Magento uses that sort order as the array key, so if multiple tabs do not have a sort order set, they overwrite the same array element and only the last tab is left. This issue is not present in 2.3.0. The solution is to simply ...


4

Layouts are the XML files that specify the overall structure of a page like the position of header, side columns, and footer, etc. The Layout Object is an XML object that will define which Blocks are included on a page, and which Block(s) should kick off the rendering process. Templates are pieces of code in PHTML (PHP) files which add features and ...


4

Instead to modify your template for this label change just modify label by translations. create folder i18n in your custom theme in it create file en_US.csv and add translation into this file like following : "Address book", "My Contact Details" structure will be following: Once you create this you can change every label in this way for whole site


3

Another Way using sort order argument. File Path - app\design\frontend\<companyNAme>\<ThemeName>\Magento_Catalog\layout\catalog_product_view.xml Add the sort order argument inside the product.info.details reference block container. Example code <block class="Magento\Catalog\Block\Product\View" name="shipping_tab" template="Magento_Catalog:...


3

Instead of: <block class="Magento\Cms\Block\Block" name="block_category_below_collection"> <arguments> <argument name="block_id" xsi:type="string">block_category_below_collection</argument> </arguments> </block> Try: <block class="Magento\Cms\Block\Block" name="block_category_below_collection" after="-...


3

In Block :- protected $taxHelper; public function __construct(\Magento\Catalog\Helper\Data $taxHelper, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency ){ $this->taxHelper = $taxHelper; $this->priceCurrency = $priceCurrency; } public function finalPrice($product) { return $this->taxHelper->getTaxPrice($product, $...


3

From the technical guidelines: 14.1. All values (including objects) passed to an event MUST NOT be modified in the event observer. Instead, plugins SHOULD BE used for modifying the input or output of a function. 14.3. Events SHOULD NOT change a state of observable objects. So here is a plugin solution for this: Declare the plugin: <?xml version=...


3

Try this from phtml $full_action_name = $this->getRequest()->getFullActionName(); It will return catalog_product_view, most of the time full action name is equal to layout name.


3

This is only used in a couple of places https://github.com/magento/magento2/search?q=is_render_to_js_template&unscoped_q=is_render_to_js_template /** * Block Factory * * @param string $type * @param string $name * @param array $arguments * @return \Magento\Framework\View\Element\AbstractBlock */ public ...


3

Go to Manage category in Admin In Design tab you will find Theme dropdown Select your theme from there and this will apply to that category


3

The errors are invalid XML There is a plugin for PHPstorm editor https://github.com/magento/magento2-phpstorm-plugin You can then generate XML URN map to validate against. https://magento.stackexchange.com/a/101524/70343 Or better yet you can scan your code. I was going to type an answer on how to use it but then I came across this https://magento....


3

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


3

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


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:...


3

You can add your meta keywords or description in the product admin section under SEO Content tab. Or if you want to add your code file in the add then you can add your static block or file in the head with default.xml. Below is an example to add a template file in the head file. /app/design/frontend/[vendor]/[theme]/Magento_Theme/layout/default.xml <...


3

your AddtoCart Button out of the form id="product_addtocart_form" please move your addtocart Button with form like: xml move <move element="product.info" destination="product.info.main" after="mageArray.checkDelivery"/> Hope this will help you. thanks


3

I have to check your website and I have to find it what is an exact issue on your site. In your addtocart action form action not available Your AddtoCart HTML:- <div class="box-tocart"> <div class="fieldset"> <div class="field qty"> <label class="label" for="qty"><span>Qty:</span></...


3

If @Rising answer not work try this. In newsletter_manage_index.xml try this code. <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/...


3

As per your requirement i suggest set your product page layout as 1 column, set your HTML code in left (it contains Images section) & right (product details information) container. For sticky right part i suggest go with Sticky-Kit JavaScript, below is the source code from GitHub & working demo example from jsFiddle. Kindly check below URLs. ...


2

Add these lines to layout in Design > Layout Update XML of cms page: <body> <attribute name="class" value="body-class-aaa" /> </body>


2

Try this: <block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-address-link"> <arguments> <argument name="label" xsi:type="string" translate="true">Manage Address</argument> <argument name="path" xsi:type="string">customer/address</argument> <argument name="...


2

Thanks Abdul for the hint and debugging. I think using a plugin/interceptor for adding some extra functionality to core files should be considered first. If that fails or is not possible, go with the override method. With interceptors you won't loose future updates to Magento\SalesRule\Model\Rule\Condition\Adress::loadAttributeOptions(). If Magento adds ...


2

Add this in default.xml in the below path app/code/vendor/module/view/frontend/layout/default.xml or app/design/frontend/vendor/theme-name/Magento_Theme/layout/default.xml default.xml will render in all the pages so it's an global declaration. <?xml version="1.0"?> <page xmlns:xsi="...


2

You can easily override these file in your theme as: app/design/frontend/{PackageName}/{ThemeName}/Amasty_Faq/layout/catalog_product_view.xml app/design/frontend/{PackageName}/{ThemeName}/Amasty_Faq/templates/pages/question_view.phtml


2

If Infortis/base is your theme name (base is a weird name to give to a theme and usually this is written in CamelCase) and you have set your theme up like here then there are certain rules before it will show Select your theme under Content > Design > Configuration > Select the right store and select Infortis/base there. The theme that you select there is ...


2

Try to this way... vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml to app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/catalog_category_view_type_default.xml" Or open this file app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml and add below code <referenceBlock name="sidebar....


2

Based on the comments, I was able solve my problem by adding this method to my block public function getTemplate() { $template = parent::getTemplate(); $parts = \Magento\Framework\View\Asset\Repository::extractModule($template); if (empty($parts[0])) { $template = 'Vendor_Module'.\Magento\Framework\View\Asset\Repository::...


2

As per my opinion easiest way is the use of widget. Create a static block with content you want to show. Now create a widget with: Type : CMS static Block Display On : Specific Page Page: Customer Account Registration Form Container choose from available Hope above will help!


2

For customization on the Update cart button.Please follow this link it is worked great: How to override the checkout_cart_configure.xml template file into custom module Thank you.


Only top voted, non community-wiki answers of a minimum length are eligible