6

Can you try to add following under global tag in config.xml: <blocks> <Mymodule> <class>Mynamespace_Mymodule_Block</class> </Mymodule> </blocks>


5

By default, Magento 2 provides the Modal popup functionality. Please check below code to open modal popup <div> <button id="click-here">Click Here</button> </div> <div id="popup-modal-main" style="display:none;"> <h1> Content for Popup </h1> </div> <script> require( [ '...


4

Not sure about this but your input name is wrong. It should be in this format groups[general][fields][terms][value]. That structure is needed in order to read the values properly and store them in the database. [EDIT] Checkboxes are a bit strange. If you don't check them, no value is sent via post and the way the system configuration section works for ...


4

Create a catalog_product_view.xml <referenceContainer name="product.info.stock.sku"> <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.cutom.attribute" template="Magento_Catalog::product/view/attribute.phtml" after="product.info.sku"> <arguments> <argument name="at_call" xsi:type="...


3

I got solution as below: namespace Vendor\ModuleName\Model\Frontend; class Style extends \Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend { public function getValue(\Magento\Framework\DataObject $object) { $this->getAttribute()->setData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::IS_HTML_ALLOWED_ON_FRONT, 1); ...


3

A coworker thinks that administrators accessing System->Configuration may slow down the frontend of the site. That doesn't look particularly problematic to me -- Magento's backend is typically under a very light traffic load -- i.e. you might have dozens of administrators (not thousands or tens of thousands) hitting that page at once. Unless your MySQL ...


3

Ok so i just tried your code and it works fine, however the die function actually does not output anything. Changed it to Mage::log(123); and i got an output in the system log. So it definitely works. I even echo 'hello'; just to be sure.


2

Replace onclick with: 'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl('*/*/downloadTextFile') . '\')', then in your etc/config.xml add: <admin> <routers> <adminhtml> <args> <modules> <Namespace_Modulename before="Mage_Adminhtml">...


2

With Varien_Data_Form_Element_Renderer_Interface you have the freedom do design the whole row as you want. Since you extend Mage_Adminhtml_Block_Abstract and return only the iframe in its render() method, this is what you get. To use the default table layout, extend Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element instead, and use its default ...


2

For system configuration fields, use dropdowns instead of checkboxes. For example, if you have a field called Enabled, use a dropdown with the values Yes (1) and No (0). Don't use a checkbox because the off value is never sent (in fact, an off value doesn't exist - there is only an on value).


1

Call below code instead Remove: <?php $newsCollection = $this->getNewsCollection(); ?> Replace : <?php $newsCollection = $this->_getNewsCollection(); ?>


1

I have a function which grabs all the details I need : public function getDetails(){ $ruleArray = $this->productCollectionFactory->create()->getData(); $ruleArray = array_column($ruleArray,'rule_id'); $ruleArray = array_chunk($ruleArray, 1); foreach( $ruleArray as $rule_id ) { $currentTime = $this->_date-&...


1

create a layout file in your extension NameSpace/ModuleName/view/frontend/layout/catalog_product_view.xml <?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="...


1

There is only two scenario when you have this issue 1st as Marius said check the class file exist : app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php 2Nd : please check Mage_Whistlist module is enable in system->configuration->Advanced


1

The problem here is that the Block class Form.php (Magento\Review\Block\Form) is not accessible as you have just included the PHTML file without its class. You need to change below mentioned line of code: <?php include ($block->getTemplateFile('Magento_Review::form.phtml')) ?> to <?php echo $this->getLayout()->createBlock("Magento\...


1

The menu visibility is already managed in Catalog -> Manage Categories - it would probably make sense to put the static block configuration in the same place so that the menu can be controlled from a single point in the backend.


1

If you are relying on showing your new attribute in the "Additional Data" section of the product detail page, what you are trying will not be possible. Here is why: The value that is returned from getValue() will always be escaped. There is also no way to change the styling of the for a single attribute without changing the attributes.phtml itself: <?...


1

Why has Magento made design like that in its JS? I think because you did it that way in the past. There was no need to add a hidden field right before to make sure the value is either 0 or 1 (I guess you mean this?). If you are checking a boolean magento value, you want to use \Mage::getStoreConfigFlag, so you get either true or false. It doesn't matter if ...


1

I usually opt to use the following method in installation scripts. It's much easier and you don't need to know the resource setup methods. It works on all types of Magento tables. // To add a custom column to the quote item table $quoteTable = $this->getTable('sales/quote_item'); $this->run( "ALTER TABLE `$quoteTable` ADD test DECIMAL(12,4) ...


1

Try this: $this->getConnection()->addColumn( $installer->getTable('custom_data'), 'street', "VARCHAR(255) NOT NULL DEFAULT ''" );


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