New answers tagged

0

You can use margin-right in CSS as 35% or according to your need. In your custom LESS File, Put this below Code : .block-search{ margin-right: 35%; }


0

This is Ternary Condition so basically if $block->isrequiered() getting then apply 'required' class otherwise black class add If you don't want to add condition just remove condition <div class="field company">


1

If you want to add some block on the base of category you need to follow the following step. By following these you will be able to achieve your requirement. Step 1 create layout handle vendor/module/view/frontend/layout/catalog_category_view_id_3.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" ...


0

If you want to show block for specifc category page, you can try with Catalog -> Categories -> Choase 1 -> Design In here you can config design for only this category page! Hope it help!


1

By default, Magento supports only the following layout handles for product page customizations: catalog_product_view_type_<product_type>.xml, catalog_product_view_id_<product_id>.xml and catalog_product_view_sku_<product_sku>.xml. As you can see, attribute set id is not supported. But you can easily implement this by adding the following ...


0

Unfortunately, you cannot add the search results block to the layout once again as it has already been initiated. You should create a separate block for your purposes and call the existing results block from it. Here are the steps: Create a new block app/code/Vendor/Module/Block/GtmSearchResult.php with the following content: <?php namespace Vendor\...


0

Magneto 2.1.x, 2.3.x and 2.4.x Create custom module and Override Magento\Checkout\Block\Onepage\Success #1 Create: app/code/VendorName/ModuleName/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_Module', __DIR__ ); #2 create: app/code/...


0

Use catch and through blocks the error messaged thrown can be called in block and same can be shown to user in phtml file $block->getErrorMessage(); in block class public getErrorMessage(){ return error message; }


0

You overrided perfectly.! If you want to check your applied theme then you can check from admin panel Way 1 Admin panel => Content => Design => Configuration => Edit => Applied Theme Way 2 You can press ctrl+u and check any css or js file. It will show full path with theme name. Now you will get theme name and override your template(phtml) ...


0

Wrong $options['title'] = 'Rustic'; Right Hard Coded: $options[2] = 3; Dynamic: $options[$optionTypeId] = $optionId; The key: 2 is the optionTypeId. The val: 3 is the optionId. Accessible by loading product by Id, ex: $loadedProduct = $viewModel->getLoadProduct($loadedProductId); foreach ($loadedProduct->getOptions() as $options) { $...


0

Phtml will have an instance of Block class. So in phtml file you can have that dynamic variable and pass it to one of the block functions. The other way of passing a predefined argument value can be by XML but you have stated a dynamic parameter. Other option could be to use http Request object or some registry variable.


0

Usually what you would do is define a template in your block. Create a block with this content in admin {{block class="Cpy\ModuleName\Block\BlockName" name="block-test" template="Your_Theme::html/your-path/your-file.phtml"}} Then you can define any variable you want in the BlockName block and use them in the your-file.phtml


0

Re-write the Controller like this and then it will work <?php namespace Netzz\ShippingRework\Controller\Vendor; class Vendorsettingpost extends \Magento\Framework\App\Action\Action { public function execute() { $this->getpost(); } public function getpost() { $post = $this->getRequest()->getParams(); ...


0

Put your getpost function out side of execute function. Then It should work


Top 50 recent answers are included