New answers tagged

0

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

Please try with below code, hope its work for you.. if (is_array($hash) && array_key_exists($hash_key, $hash)) { //...magic stuff here }


0

Check the catalog module page layout. It should be 2 column left. Set it to 1.column and try.


0

As you want to remove shipping method section completely but magento must need to assign one specific shipping method. Please follow following steps to remove shipping method completely and assign automatically specific shipping method (magento 2.3.1) Override these two files to your theme folder /vendor/magento/module-checkout/view/frontend/web/...


0

I know this post might be closed and old but I am stuck to manage the XML file of MassAction to do exact what shown in Image. Can you please provide the XML File which allows me to access Text Input on MassAction?


0

you can see some magento 2 extension provider company selling magento 2 auto cancel order extension you can check this https://www.mageants.com/auto-cancel-order-for-magento-2.html if your requirement fulfil with this


0

Try This Command And Check :- bin/magento setup:upgrade bin/magento indexer:reindex bin/magento deploy:mode:set production -s #Here was the secret: run the di:compile after production bin/magento setup:di:compile bin/magento setup:static-content:deploy Merged JS and CSS do not work when Production mode Ask


0

As Per This Link The requested URL was not found on this server I am Check In Your Site And After Add index.php like this vitalticks.in/index.php/create-your-package.html open every category or page perfectly.


0

Check that the composer.json file in the Magento root directory is not corrupted / overwritten. You can compare it with the official composer.json file from https://github.com/magento/magento2


0

Doesn't matter either you are clearing cache from admin console or from command line. It will clear all the active cache. Cache:flush will remove both "Active" and "Inactive" cache. The only difference is, when you remove the cache from command line, you need to set the permission back. Can you show me what are you trying to update in "default_head_blocks....


0

If you use custom theme means follow the below steps 1. Open the 'theme' table and update the type=0 for the particular custom theme. 2. php bin/magento setup:static-content:deploy -f 3. php bin/magento c:f Finally we got the solution.


0

If you suddenly find that your Magento is suddenly massively slow after installing or updating a module, it might be this known bug where composer update turns off all your cache! https://github.com/magento/magento2/issues/17634 I know that this happens to me about once or twice a month. I now know to immediately go into command line and run php bin/...


0

Add this overridden template in the layout XML file. It's only for configurable products. <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\ConfigurableProduct\Block\Cart\Item\Renderer\Configurable" name="checkout.cart.item.renderers.configurable" as="configurable" template="YOURMODULE_CustomCart::cart/item/default....


1

app/code/Cm/Customer/Setup/InstallData.php <?php namespace Cm\Customer\Setup; use Magento\Customer\Model\Customer; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; class InstallData implements \Magento\Framework\Setup\InstallDataInterface { private $eavSetupFactory; private $eavConfig; ...


1

login in Magento admin section and navigate to store -> configration -> sales -> Tax Click on shopping cart display settings and make sure you have No for Display Full Tax Summary. If it is yes make it No. After change configuration Clear cache. Please find attachment


0

You could perform SQL joins to reduce multiple requests to SQL server. In your case you could write query as SELECT eav_attribute.*, eav_entity_type.additional_attribute_table, catalog_eav_attribute.* FROM eav_attribute LEFT JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_attribute.entity_type_id LEFT JOIN catalog_eav_attribute ON ...


0

I put together this extension which let's you approve / disapprove customers https://github.com/DominicWatts/CustomerApprove Although I'm unsure if you are saying you want this at customer group level. If so why would you want to toggle customer group access? With my extension you can toggle access via customer grid so you could filter however you want ...


2

Please create module and add below code in Block file. <?php namespace Vendor\CustomerGroup\Block; class CustomerGroup extends \Magento\Framework\View\Element\Template { public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\ResourceModel\Group\CollectionFactory $...


0

Please try with below code : <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $groupOptions = $objectManager->get('\Magento\Customer\Model\ResourceModel\Group\Collection')->toOptionArray(); ?> <select> <?php foreach($groupOptions as $groupOption) { ?> <option value="<?php echo $groupOption-...


0

While the above methods suggest overriding the js functions, I would recommend using mixins to avoid unnecessary code clashes: In your frontend requirejs-config.js add the following: var config = { config: { mixins: { 'Magento_Checkout/js/model/checkout-data-resolver': { '{Vendor}/{Module}/model/checkout-data-...


0

The above code is going to create an infinite loop, because every time the customer is saved the event will be triggered and the observer will keep executing until it crashes. Adding a stop condition should fix the issue: $groupId = $this->_request->getParam('groupId'); if ($groupId !== $customer->getGroupId()) { $customer->setGroupId($...


0

use this code $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $groupOptions = $objectManager->get('\Magento\Customer\Model\Customer\Attribute\Source\Group')->getAllOptions(); $fieldset->addField( 'customer_group', 'multiselect', [ 'name' => 'customer_group[]', 'label' => __('Customer Group'),...


2

For Ui-Form <form> -> <datasource> -> <fieldset> -> <field> For Ui-listing <listing> -> <datasource> -> <listingtoolbar> -> <columns> -> <column> this is the flow of loading UI components tags.


0

Please find below PHP script if you want to get product image data in the cart using "customer id". <?php use Magento\Framework\App\Bootstrap; require '../../app/bootstrap.php'; // Change it as per your file location $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); $obj = $bootstrap->getObjectManager(); $state = $obj->get('...


0

If (for some reason) you are using a theme from Venustheme the CSS file isn't getting created during a content deploy. There is an error in Chrome about unsupported MIME types, but when you check on FTP the file doesn't even exist. To fix it go to: Venustheme -> Customization -> and click Save Config Clear cache after that and it will be fine.


0

The error occurs because attribute was created as text field and for configurable product, the attribute field should be dropdown / text swatches. (not text field)


1

Please use below code, it will move review block just before the product.info block and product.info block contains quantity and addtocart button <move element="product.info.review" destination="product.info.main" before="product.info"/> Please make sure, you are editing in correct layout xml, sometimes same element is already moving by any other ...


0

Unfortunatly I didn't find any API to get hex or image of visual swatch attribute. After playing a bit i write a module which use extension attribute for AttributeInterface.... I've tried with AttributeOptionInterface but without success. After the module is installed is possible to fetch hex or image by checking the extension_attributes for these API calls:...


1

I am guessing you want to add a banner above the products? If so, navigate to Admin -> Catalog -> Categories On category section (right hand side), select category you wish to add the banner to. In the "Content" tab, click on "upload" next to "category Image" Upload your image and save the category.


2

After reading your question, I think that you are asking about the image which is displayed on the top off all products. Actually that image is the category image which you can add from the backend as follows. Catalog->Categories->Edit New Offer Zone Category->Content->Add the category Image->Save Your Category


0

Your code is correct: <referenceBlock name="product.info.sku" remove="true" /> You don't need to change your composer.json or delete the static folders or change permissions or run the static content deployment. You just have to clear the cache bin/magento cache:clean and see the changes. If it doesn't work you can try: Check the browser cache (it'...


0

Just add these variables to your theme _extend.less @form-element-input__border-color:#296db6; @form-element-input__border: 2px solid @form-element-input__border-color; You can find all variables in magento root folder -> lib\web\css\source\lib\variables see Magento docs https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-guide/...


0

I don't know exactly the solution I found is standard or not but I would like to share my code which worked fine. I override minicart.phtml file from vendor/magento/module-checkout/view/frontend/templates/cart/minicart.phtml to my theme and added below code at thee end of file <script type="text/javascript"> require(['jquery'], function($){ ...


0

Please try with below files : Overriding vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml


0

Edit This popped up on my Google feed and I foolishly didn't look at the date on it. Oh well. You didn't install Magento through the composer meta package, so you can't use that meta package to upgrade your system. There are alternative methods to install Magento outlined in their documentation. You'll need to figure out which one was used to install it ...


1

You can use Magento\Framework\Filesystem\Io\File instead. Example: <?php namespace Vendor\ModuleName\Model; use Magento\Framework\Filesystem\Io\File; class MyClass { /** * @var File */ private $file; /** * @param File $file */ public function __construct(File $file) { $this->file = $file; } public ...


0

please try with below code : var config = { map: { '*': { generateMenu:'TCM_HeaderMenu::js/generateMenu' } } }; i hope its work for you


1

Try : app/code/Company/Product/view/adminhtml/requirejs-config.js var config = { deps: [ "Company_Product/js/generateMenu" ] }; app/code/Company/Product/view/adminhtml/web/js/generateMenu.js define(["jquery"], function($) { "use strict"; //Your code here }); clean cache clean var/view_preprocessed content clean pub/...


0

I used the following method <?php function randomPassword() { $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789"; $password = []; $alphaLength = strlen($alphabet) - 1; for ($i = 0; $i < 8; $i++) { $n = rand(0, $alphaLength); $password[]...


1

A good way to keep configuration data out of the javascript is to declare a provider in the base component’s XML so it will be able to find that data provider component. Under the node, add a node like this (where [ComponentName] is the name of the component): <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">[...


0

I fix the problem like this .my-container { width: 100vw; position: relative; margin-left: -50vw; left: 50%; padding: 50px 0; margin-bottom: 50px; margin-top: 50px; background-color: #fafafa; }


0

In order to successfully remove the edit button for all products you need to remove the block for each product type like so: <body> <referenceBlock name="checkout.cart.item.renderers.default.actions.edit" remove="true"/> <referenceBlock name="checkout.cart.item.renderers.configurable.actions.edit" remove="true"/> <...


0

due to security reason Magento have introduced account disabled functionality so this is the better way: 1-Create new account by command line: php bin/magento admin:user:create --admin-user='new-admin' --admin-password='admin@123' --admin-email='abc@xyz.com' --admin-firstname='Firstname' --admin-lastname='Lastname' 2-Now login with the new created ...


1

Override in your module /view/adminhtml/ui_component/product/product_listing.xml <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> <listingToolbar name="listing_top"> <filters name="listing_filters"> <argument ...


0

For CSS: <style xml="space"><!-- .class-name{ your style goes here } --></style> For JS: <script type="text/javascript" xml="space">// <![CDATA[ require([ "jquery" ], function( $ ) { alert('working...'); }); // ]]></script> I hope this is useful. Thanks. Thumps up!


0

You need to check your checkout_index_index.xml file search for the element attribute xsi:type="boolean" and check the value if it only contains boolean value. I encountered this error because "isBillingAddressRequired" is set to "no" <item name="isBillingAddressRequired" xsi:type="boolean">no</item> It should have been <item name="...


0

The issue is not the setting of the area code it is the classes you are injecting. You found the right question but this answer explains it best. https://magento.stackexchange.com/a/162145/70343 Although what the answer doesnt say is that it is bad practice to inject proxies as they are potentially expensive in terms of resource. Which in my opinion makes ...


1

I am able to log out from two application from Magento and External application. First I destroyed the Magento session and redirect to the external application from there I also deleted the session of external application. so it is logged out and I have written in such a way that after logout it redirected to Magento customer/account/logoutSuccess page. ...


0

For what it's worth, I ran into this error when I forgot to enable my logger module, but I enabled a different module that depended on it. Could be a missing dependency.


0

I believe the bundle product don't have this option by default you need to customize the bundle product module or you may check below resources for more information extension https://www.itoris.com/magento-2-custom-options.html for "customizeable options" https://amirshakya.wordpress.com/2012/07/08/custom-options-on-a-bundle-product-in-dynamic-pricing/ ...


Top 50 recent answers are included