New answers tagged

2

That error can be solved by using the following code inside your upgrade method. $this->state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML); public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $this->state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML); $...


1

I have limited the checkbox count to 4. It will not append 5th checkbox. But still you can check those checkbox <script> require([ 'jquery' ], function ($) { 'use strict'; $('input[type="checkbox"]').click(function(){ if($(this).prop("checked") == true){ if($('.selected-items .sample-item-...


1

This is more question from js. You can try this: <script> require([ 'jquery' ], function($) { 'use strict'; function updateCounter() { var len = $(".sample-item-wrapper input[name='YourCheckboesxName[]']:checked").length; if (len > 0) { $("#YourDivWithNumber i .counter").text('(' + len + ')'); } else { $("#...


0

Use Model\Rule to get a collection of products by catalog price rules. I also used Type\Configurable to get product type, so the product can filter by parent or child. public function __construct(Context $context, \Magento\CatalogRule\Model\Rule $rule, \Magento\ConfigurableProduct\Model\...


0

Override your grid.phtml file in your theme app/design/frontend/VendorName/ThemeName/Magento_CatalogWidget/templates/product/widget/content/grid.phtml and change from <button type="submit" title="<?= $block->escapeHtml(__('Add to Cart')) ?>" class="action tocart primary"> <span><?= $block->escapeHtml(__('Add ...


Top 50 recent answers are included