New answers tagged

0

try this code to get sum of all id element. <?php $data =[ 0=>[ 'id'=>1, 'date'=>'3/3/2017', 'owner'=>'ownerName1', 'extension'=>'yourExtension1', 'filename'=>'YourFileName1', 'childs'=> [ ...


1

you have 2 CPU , so if you have more than 2 processes reading then cpu load will be high. this is normal for wordpress, but for magento you need cpu power. this is all related to how heavy is your theme, how many modules loaded and db readings. magento 2 in default and developer mode runs slower that production mode. if you change to production mode it ...


0

If you look inside vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js you will find some methods thats fire when a user changes option. The method responsible for updating the gallery images when the user changes an option is _changeProductImage. Some other methods that may prove useful to you: _configure _configureElement ...


0

This below might help with your question. Beside, you can also take help from this guide as well: https://docs.magento.com/m2/ee/user_guide/cms/editor.html


1

please avoid obectManager Add this into your My Controller protected $emamilHelper; public function __construct( .......................................... \vendor\RequestForQuote\Helper\Email $emamilHelper, .......................................... ) { .......................................... $this->emamilHelper = $...


0

Added in admin custom Form <field name="customer_group"> <argument name="data" xsi:type="array"> <item name="options" xsi:type="object">Magento\Customer\Model\Customer\Source\Group</item> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">int&...


1

$hasRequired = false; $options = $_product->getOptions(); if (is_array($options)) { foreach ($_product->getOptions() as $option) { if ($option->getIsRequire()) { $hasRequired = true; break; } } } now check the value of $hasRequired; ($_product - is the product instance for which you are checking)


0

Below commands will figure out the problems php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento indexer:reindex php bin/magento cache:flush Enjoy!!!


0

You can get all media images including hidden images from below code. First load single product from collection then use blow getData method to get all images. It will return with disable = 1 like. $product->getData('media_gallery'); Array ( [14576] => Array ( [value_id] => 14576 [file] => /m/a/mad-angle_6.jpg [media_type] =>...


0

Please can you share the steps or procedures to hit the required URL? Meanwhile, purge cache and check for the server logs to identify why are you getting this error. Also, look for the PHP and MySQL versions just in case.


1

I think the problem lies on the surface, but you don’t see it. experience has shown that many developers turn off block, full page, and layout caches when developing. most likely you have them enabled for production. try temporarily disabling full page cache and you will see your result. if this helps add cacheable="false" to your layout


0

$post['created_by'] = $user; $post['updated_by'] = $user; replace by if (!empty($id)) { $post['updated_by'] = $user; } else { $post['created_by'] = $user; $post['updated_by'] = $user; }


0

You can use in view in ui_component like as shown below under item name filter_url_params <item name="filter_url_params" xsi:type="array"> <item name="main_table.status" xsi:type="string">1</item> </item>


0

Add 'target' => '_blank' tag. Please refer below. Vendor/Module/Ui/Component/Listing/Column/PageActions.php $item[$name]['edit'] = [ 'href' => $this->urlBuilder->getUrl($this->editUrl, ['page_id' => $item['page_id']]), 'target' => '_blank', 'label' => __('Edit') ];


2

You can use _initSelect() to filter collection data. Add the below function in your Collection.php protected function _initSelect() { parent::_initSelect(); $this->addFieldToFilter('main_table.status', ['eq' => 'active']); return $this; } Hope this helps!


0

Fatal error: Call to undefined function Magento\Framework\Event\mb_strtolower() in C:\Apache24\htdocs\p4p\vendor\magento\framework\Event\Manager.php on line 56 Getting this error while running my project on localhost.


0

Your SQl Query Look Like UPDATE `catalog_product_entity_text` SET `value` = 'Change text' WHERE `catalog_product_entity_text`.`value_id` = 25; Table structure


0

You can use this SQL to select all product descriptions from database: SELECT * FROM catalog_product_entity_text WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE attribute_code LIKE 'description' AND entity_type_id IN (SELECT ...


0

I had a similar issue. It seems issue is due to partial or incomplete di compile execution. I cleared cache and generated folder and re run command.


0

In my case the attribute was not existed so I was needed to restore missed eav entities. Did it with \Magento\Catalog\Setup\Patch\Data\UpdateCustomLayoutAttributes Data Patch Just remove the installed state flag from patch_list and make setup:upgrade


0

you can remove this from your backend don't need to customize your code. first, go to your adminhtml->stores->settings->All Stores now open your store views and set status "disable".


0

An example of how to get magento2 Observer working can be found in the following files inside the vendor folder. magentofolder\vendor\magento\module-catalog\etc\frontend\events.xml magentofolder\vendor\magento\module-catalog\Observer If my answer helped you, you can accept the answer so it can help others also.


0

You can use this code step by step make sure module name must be in caps app\code\One\Two\registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'One_Two', __DIR__ ); app\code\One\Two\etc\module.xml <?xml version="1.0"?> <config xmlns:xsi="...


0

Here my column name is thumbnail for image <field name="thumbnail" formElement="imageUploader"> <settings> <label translate="true">Image</label> <componentType>imageUploader</componentType> </settings> <formElements> <imageUploader> <settings> ...


0

OK. Apparently this is a bug which occurs when the region field is empty. Found a workaround on Github here: https://github.com/magento/magento2/issues/7387#issuecomment-263586330 In vendor/magento/framework/DB/Adapter/Pdo/Mysql.php Search for the line in the error (in this case 3101) the text there should be as below case 'varchar': ...


1

Solved: I realized that the php commands I was executing were run by the php installed on the system, and not the one in use by Xampp. Thus installing the php-xml part solved that issue. I resolved all the subsequent errors in the same way. So far, the app is running ok. Granted, a proper, clean stack would be preferable, but this will do for now.


1

Possible ways to debug further. 1. First try Check If Flat catalog for category ENABLED then DISABLE it or if Flat Catalog for category found DISABLED then ENABLE it. Perform full reindexing Then try to save any category again, it should work. 2. If not solving then try to add the instance check condition like below: Culprit attribute can be found by ...


0

This is my debug after the error. I don't find what's wrong. And..i dont have a file GroupedProduct/view/adminhtml/ui_component/category_form.xml [2020-03-11 08:02:45] main.DEBUG: Request validation failed for action "Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor" [] [] [2020-03-11 08:02:56] main.DEBUG: cache_invalidate: {"method":"POST","...


0

Please take a look at this, I'd recommend you to read throught dev docs anyways : https://docs.magento.com/m2/ce/user_guide/catalog/product-price-group.html


1

You can find all attribute labels and codes in the eav_attribute table. If you need to find all attributes associated with a specific attribute set you can look in the eav_attribute_set table and find the required attribute_set_id. Then go to the eav_entity_attribute table and you can filter/search by the attribute_set_id to find all attribute id's ...


1

can you please try Magento\Framework\App\Filesystem\DirectoryList; instead of \Magento\Framework\Filesystem\DirectoryList Hope it will work !!


1

This error may be custom attribute then you can find this way.. Go to Below file and uncomment below line 1) app/bootstrap.php, there is: ini_set('display_errors', 1); 2) Run below commands php bin/magento deploy:mode:set developer php bin/magento cache:clean php bin/magento cache:flush and you can replace wysiwyg attribute with this <?xml ...


0

Remember that All caps HTTP headers with underscores dropped in Apache 2.4. Nginx: http://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers So we can try add other values. For example: AppId without underscores. We could get the header with \Magento\Framework\App\RequestInterface \Magento\Framework\Webapi\Request \Magento\...


Top 50 recent answers are included