New answers tagged

0

You need to do following things : create the events.xml file on following location. app\code\Vendor\Extension\etc\events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="...


1

Backup Database php bin/magento setup:backup --db This command line will backup current database and save to a static file. It will be stored to ./var/backups/ folder. Then follow below steps Step 1: Login to your Magento 2 backend On the Admin sidebar, click Stores. Then under Settings, select Configuration. In the panel on the left under General, select ...


1

First create database backup then go to below path in admin panel. Stores -> Setting -> All Stores here remove your website,store and store view which is not required. Note: please do not delete main website, main store and main store view. after that you can switch to "single store mode".


0

I found out that the index is specified by an alias in the actual query: magento2_product_1 in our case, which points to the current actual index: magento2_product_1_v38. I can see the indexes by running this curl statement: curl -X GET "localhost:9200/_cat/aliases?v=true&pretty"


0

Well, this issue I am also facing when enabling of FPC cart item not getting properly, So there is another way of getting the cart item is through phtml/js file inject the following code as your requirment , require('Magento_Customer/js/customer-data').get('cart')().items You can also refer to this link hopefully it will help you allot How to get Cart ...


0

You could check this for the api integration https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/create-integration-with-api.html


0

I did a switch form PHP 7.3 -> 7.4 and I got the same error. In my case I was missing the intl library, so by executing this command: sudo apt-get install php7.4-intl Fixed my problem .


0

The answer provided by @Danial is great but still if it is not working then check the below point as well 1- Check if module is enable or enable it using bin/magento module:enable Vendor_Module 2- Check if you have the correct permission, maybe the file is not generating because you do not have the required permission.


0

I have resolved this issue Please follow this link


0

Here's what worked for me: PUT /V1/products/byProductSku/stockItems/byItemId with data as follows: [ { "product_sku": "BLA_BLA", "stockItem": { "item_id": 1234, "is_in_stock": true, "is_qty_decimal": true, "qty": 1000 ...


0

incase anyone is still in need of a solution. The problem was that there were some customer custom attributes that had not values or were null. Since I did not need those attributes. I removed the attributes from the DB. I removed the attributes manually from the tables: customer_form_attribute, eav_attribute, and customer_eav_attribute. If you decide to ...


0

Try to change your code like this one : public function aroundIsEnabled(\Magento\Sales\Model\Order\Email\Container\OrderIdentity $subject, callable $proceed) { $order = $this->checkoutSession->getLastRealOrder(); $orderId=$order->getEntityId(); // order id $connection = $this->resourceConnection->...


1

This is a bug in the Magento 2.4.2 inventory-configurable-product-frontend-ui module. Until a fix is released if you do not use the stock threshold options you can safely disable this module which will stop the "only 0 left" message from appearing. See this issue for more details and workarounds : https://github.com/magento/inventory/issues/3276


1

Try the following way: <preference for="Magento\Sales\Model\Order\Email\Sender\OrderSender" type="VendorName\ModuleName\Model\Sales\Order\Email\Sender\OrderSender"/> Now app/code/VendorName/ModuleName/Model/Sales/Order/Email/Sender/OrderSender.php <?php namespace VendorName\ModuleName\Model\Sales\Order\Email\Sender; ...


0

Idea 1 - Calling Method On Null The only thing so far that stands out about the code posted is the assumption that $customerGetValue->getCustomAttribute('disable_proforma_email') will always return an \Magento\Framework\Api\AttributeInterface that you can call AttributeInterface::getValue() on. See the interface method for that method below. If an ...


1

You can add like this in your xml file : <link rel="preload" href="fonts/opensans/light/opensans-300.woff2" as="font"/>


0

See this article I hope it will help you : https://black.bird.eu/en/blog/recettem2-3.html


0

Bit of a dirty fix here, but I hope this helps someone in the future. So after countless hours of googling, it seems this was fixed in 2.4.2 - which is great except for muggins here who has a store running on 2.3x. I don't even know where to begin when trying to patch my store just for this functionality. I gave it a go, but failed miserably. Anway here's ...


0

Kindly follow below link. I have successfully completed PWA setup using this tutorial. It's fully tested and working solution. https://devhooks.in/blog/magento-pwa-sudio-installation-guide Hope it'll help you too.


0

A simple fix that could work is to check the "full action name" in the pager.phtml file , by doing the following, for example for the product page: <?php if ((string) $block->getRequest()->getFullActionName() === 'catalog_product_view') : ?> // do you custom part <?php else: ?> // leave default magento <?php endif ?>


0

After investigate , set pcre.jit=0 solve this


0

If the product images you want to import are located in another folder you should copy them to a sub folder in <Magento root folder>/var/import/images Or create a symlink from this folder to the images. You cannot import images via the file system outside of the var/import folder. Make sure your import file has the correct path to the images on the ...


0

The problem is that you moved .header.links from .panel.header container to another container, and the javascript that clones the links does not find the element to be cloned, and the javascript that clones the links looks like this: /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ 'jquery', '...


0

can you please try with below sudo php bin/magento config:set web/unsecure/base_static_url http://127.0.0.1/m242/pub/static/ sudo php bin/magento config:set web/unsecure/base_media_url http://127.0.0.1/m242/pub/media/ and also check pub/static version sign is 1 or 0 using below command sudo php bin/magento config:set dev/static/sign 1


1

Try with below code Create source provider for email values Vendor\Module\Model\Email\Options.php <?php namespace Vendor\Module\Model\Email; class Options implements \Magento\Framework\Option\ArrayInterface { /** * Return array of options as value-label pairs, eg. value => label * * @return array */ public function ...


0

You can add select field like this : $fieldset->addField( 'custom_dropdown', 'select', [ 'name' => 'custom_dropdown', 'label' => __('Custom Dropdown'), 'title' => __('Custom Dropdown'), 'values' => [0 => __('No'), 1 => __('Yes')], 'class' => 'select' ] ); Replace custom_dropdown ...


1

You can use renderer for each column to modify the content of it. For example for question column Vendor/Module/view/adminhtml/ui_component/gridanswer_record_grid_list.xml <column name="question" class="Vendor\Module\Ui\Component\Listing\Column\Question"> <argument name="data" xsi:type="array"> ...


0

Create your custom.phtml here is the path app/design/frontend/{{YOUR THEME NAME HERE}}/default//Magento_Catalog/templates/custom.phtml After add XML <referenceContainer name="content"> <container name="custom.block" htmlTag="div" htmlClass="custom-block" before="product.info.details">...


0

Please use the below code snippet. It will display a boolean switch for Yes/No values. $this->customerSetup->addAttribute( Customer::ENTITY, 'attribute_approved', [ 'label' => 'Attribute approved', 'required' => 0, 'type' => 'int', 'input' => 'boolean', 'system' => 0, '...


0

extend your theme and in your theme : app/design/frontend///Magento_Theme/layout/default_head_blocks.xml within some js files are called via the RequireJS approach: require/define sections, these cannot be removed using layout approach


0

try this awesome solution. it works for me... https://magento.stackexchange.com/a/318528 in this solution, we need to change only one line in "Validator.php" file which is located at vendor\magento\framework\View\Element\Template\File\Validator.php find the function which named "protected function isPathInDirectories($path, $directories)" ...


0

… the module adds triggers to your MySQL database and sometimes, when you upgrade to e.g. Magento 2.3.6 the module, removes the table but fails to remove the triggers. ⚠️ Don't just delete the triggers given above! FIRST verify the triggers causing it! show triggers WHERE STATEMENT like '%scconnector_google_feed_cl%'; That gives you a list of all triggers ...


0

I'm experiencing the exact same thing. "On my local install (WSL2, Ubuntu 20.04, Magento 2.3.4) if I don't use my admin for many hours, and I try to log back in, the login can take 2-3 minutes to authenticate. But after that first long delay, I'm able to work quickly, and even re-login quickly."


1

For me I have solved this problem by deleting the session that is causing the problem (it is indicated in the message Exception: Warning). Identify this problematic php session in the php session directory, with this command: sudo ls -la var/lib/php/sessions/ For me it's: sess_6uha84kjcvjmq6qjsh0ctee5ff, then simply delete it, being careful to run the rm ...


0

Other than what Diana suggested, check if your user are losing sessions and creating new ones repetitively, and if you have bad custom extension that is saving large data in session due to bad design. Your customers will have to re-login after switching to redis, but they won't lose cart, cart is saved in DB.


1

Well.. files are created as sessions are created so it's a normal behavior. I would suggest you move the sessions to a service like Redis or Memcache. This will indeed mean that current sessions will be lost, but at least you won't face disk issues in the future. That's assuming you allocate a separate machine to the sessions and cache handling (you could ...


0

You just changed the price on the UI so when you save the order it won't take the displayed price. So you need to save the price of the product in the database along with the price you display


0

I think these are the possibilities: Possible reason 1: You have wrong permissions on your /media/ folder Possible reason 2: Media folder is owned by another user. Possible reason 3: There’s an issue with the .htaccess file in your /media/ folder Possible reason 4: Magento cannot resize images due low PHP memory limit. Possible reason 5: The GD library is ...


1

Create Plugin on Magento\Theme\Block\Html\Pager and changed output of getAvailableLimit Plugin Class: <?php /** * Copyright © All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace StackExchanges\Magento\Plugin\Frontend\Magento\Theme\Block\Html; class Pager { public function afterGetAvailableLimit( ...


0

Have the same problem with my Magento 2.3.1 with PHP version 7.2.17 - facebook/php-business-sdk 11.0.0 requires guzzlehttp/guzzle ^6.5 || ^7.0 Tried lower version of SDK as per your Facebook_Business extension version or require. I tried with lower SDK version 8.0.0 and its working fine in my case. composer require facebook/php-business-sdk 8.0.0


0

I managed to get it to work, but it's quite a clunky method. It boils down to Zoom relying on global declarations of everything, and requirejs like to scope the scripts to the module. Forget about using shims with this. define(["dataservice", "text!./zoom-tool.html", "react", "reactDom", "redux", "...


0

Please, try the code below. It works on Magento 2.4. /** * @var \Magento\Eav\Api\AttributeOptionManagementInterface */ protected $attributeOptionManagement; /** * @var \Magento\Eav\Api\Data\AttributeOptionLabelInterfaceFactory */ protected $optionLabelFactory; /** * @var \Magento\Eav\Api\Data\AttributeOptionInterfaceFactory */ protected $...


1

To customize it properly, follow the 2 steps: 1, create a afterGetOrders plugin to Magento\Sales\Block\Order\History, in this plugin , check if $result->isLoaded(), if not, $result->setOrder('grand_total', 'desc') or 'asc' (you don't want to change query on loaded collection) 2, as the way pager is inserted in the layout in magento, it does not give ...


0

There are 3 ways to resolve this error. Find more details here


0

getPrice is being called in total collectors, so the extra amount is also added to order. You want to create a plugin to the view only, e.g. a beforeRenderAmount of Magento\Framework\Pricing\Render\PriceBox class. Optionally check price code and area in $arguments for your needs.


0

SOLVED. chmod -R 777 var/* generated/* pub/static/


0

This link describes the way to upload image in admin. Replace Media folder path to Var folder path. https://www.codextblog.com/magento-2/how-to-upload-image-or-file-in-custom-module-using-ui-component-in-magento-2/


0

You can run this command in CLI to unlock admin account: Unlock admin account php bin/magento admin:user:unlock YOUR-ADMIN-USER-NAME Another solution is to create a new admin account in CLI Create new admin account in CLI bin/magento admin:user:create --admin-firstname="magentip" --admin-lastname="demo" --admin-email=magentip@gmail.com --...


0

If you are using the Magento-2.3 version and if the product is out of stock, then it won't work. Take a look at this issue https://github.com/magento/magento2/issues/21519. If possible upgrade your Magento version to 2.3.4.


0

we can disable graphQL modules using below command php bin/magento module:disable Magento_AuthorizenetGraphQl Magento_BraintreeGraphQl Magento_BundleGraphQl Magento_CatalogCmsGraphQl Magento_CatalogCustomerGraphQl Magento_CatalogUrlRewriteGraphQl Magento_CheckoutAgreementsGraphQl Magento_CmsUrlRewriteGraphQl Magento_ConfigurableProductGraphQl ...


Top 50 recent answers are included