Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

1

You should create your own option array that fetches the list of store your website has and then use it as an option in your xml form field. First, create the option like this in the path: app/code/Vendor/Module/Model/Config/Source/Stores.php <?php namespace Vendor\Module\Model\Config\Source; class Stores implements \Magento\Framework\Option\...


0

As a last resort you can do stuff like this in template html echo $this->getLayout()           ->createBlock('Chapagain\HelloWorld\Block\HelloWorld')           ->setTemplate('Chapagain_HelloWorld::helloworld.phtml')           ->toHtml(); And remove the other XML reference. Whilst I appreciate this isn't the best approach we all have deadlines.


0

basically, you need to create a child theme, so if any update come then no effect on your theme. and also use git so you can track the whole summary.


0

If you have created a child theme, You can override the file by copying the file to below location app/design/frontend/YourVendor/Module/CompanyTheme_LayoutSwitcher/layout/layouts.xml and add a sixth layout or any customization you need


2

You should use name instead of element in your xml <referenceBlock name="register-link" remove="true"/>


0

Can you try with this script instead ? I should work for you. I have done 2 things : Added the domReady to wait for the DOM to be loaded Define $ to be jQuery This is it : require([ 'jquery', 'domReady!' ], function ($) { $("input[name='code']").bind('input', function(){ $(this).val(function(_, v){ return v.replace(/\s+/g, ...


0

Looks like this error related to your XML layout files, you have element , this will show the error, You you need to search ' element in admin in XML Layout update field in Category, CMS Page and etc. As you are getting this is product detail page so you should look in product detail xml or it's admin section of layout updates. Or there may be third party ...


0

Create an after plugin for the product model isSalable method: in Your/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="\Magento\Catalog\Model\Product"> <plugin name="...


0

Looking at the Magento\Framework\View\Element\Html\Link\Current code for version 2.2.6, there is no class argument supported (as documented in the previously accepted answer). However class is an accepted attribute. It can be used to set the css_class as follows: <block class="Magento\Framework\View\Element\Html\Link\Current"> <arguments> ...


0

You need to create an admin configuration field for "Button position" with 3 values consisting of the name of the three blocks added in your xml file ('test1.tab', 'test2.tab'and the third one) Then, your xml should look like: <referenceBlock name="product.info.addtocart"> <block class="Vendor\Module\Block\CustomButton" name="test1.tab" template=...


0

You can conver your XML to PHP Array using following code: $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); $json = json_encode($xml); $array = json_decode($json,TRUE); May be this will help you. NOTE: your XML format should be correct.


0

Instead of messing around with the layout files, I just added custom CSS inside style tags with the html editor inside the magento 2 page design area. Then Added custom js with a script tag in the same editor that selected the divs that were already there and removed their css classes. The divs are still there which is not a problem in my case as it was only ...


0

Try to change template name like below: (change Vendor_Module according to your custom module) <referenceBlock name="product.info.details"> <block class="Magento\Catalog\Block\Product\View" name="product.subdescription" template="Vendor_Module::product/view/subdescription.phtml" group="detailed_info"/> </referenceBlock>


0

This issue is coming because of system.xml. Please correct as per below, your system tab id="custom_tab" translate="label" sortOrder="10"> And tab name under section should be same.


0

You can try like this: <?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> <css src="Vendor_Module::css/AdvancedSearch.css" media="all and (min-width: 1px)" /> </head&...


0

Just for Knowledge share: I used the following code to load related product collection and show results in a custom way (only "formato" field) <?php $relatedProducts = $_product->getRelatedProductCollection() ->addAttributeToSelect('formato'); ?> <?php if ((count($relatedProducts)) != 0): ?> <div ...


1

You should try with reference block method. <referenceBlock name="product.review.related"> <arguments> <argument name="template" xsi:type="string">[Vendor]_[Module]::product/list/items.phtml</argument> </arguments> In above name="" write your block identifier name. and name="" in argument pass tempalte. Or you can set a ...


0

You should indicate the specific Module location of your template: <block class="Magento\Catalog\Block\Product\ProductList\Related" name="product.review.related" template="Vendor_Module::product/list/items.phtml" />


0

The ENS error response is normal if you are directly accessing the address, as there isn't an XML or JSON call attaxhed to it. You may want to ensure that the ENS response URL is publically accessable, and ensure that the URL is listening on port 80 and/or port 443. (Check your firewall setting for that). That is the best I can offer.


1

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.


0

To remove header & footer : 1: Update design with empty layout 2: add particular static block on cms by following way add below live in page content: {{block type="cms/block" block_id="static-block-to-use-in-cms-page"}} Let me know if you still have an issue in it


0

Create _module.less file inside Vendor\Module\view\frontend\web\css\source\ and write below code inside & when(@media-common = true) { // write here your css } Then run below commands php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento cache:flush


1

A workaround would be to use the translate attribute to tell which other attributes to translate. <tabs> <training translate="label" module="training"> <label>training</label> <sort_order>50</sort_order> </training> </tabs> In your example translate="label" where label is a ...


1

Not sure what theme you are using and may need to find out what your block names are but this should do the trick <reference name="before_body_end"> <block type="cms/block" name="custom_footer"> <action method="setBlockId"> <block_id>your-static-block</block_id> </action> </block> <...


Top 50 recent answers are included