New answers tagged

0 votes

How to remove extra dash from virtual category page meta title

After a bit of research I learned that my company is using a third party extension that uses a Template Manager. The template responsible for the handling of meta data had a hard coded dash in the ...
user avatar
0 votes

Magento 2 | Item with the same ID already exists when join tables

The problem can be in the cataloginventory_stock_status table (see @Msquare answer https://magento.stackexchange.com/a/350958/10018) but potentially also in other tables with product_id duplicated. In ...
user avatar
  • 1,451
0 votes

Magento 2.4.2 composer install PHP extension errors

In case anyone searching for php8.1 ヅ sudo apt-get install php8.1-opcache php8.1-pdo php8.1-calendar php8.1-ctype php8.1-dom php8.1-exif php8.1-ffi php8.1-fileinfo php8.1-ftp php8.1-gettext php8.1-...
user avatar
2 votes
Accepted

Magento 2: Add class to body from PHP

You can achieve your requirement by following steps: Step 1. Create registration.php under app/code/M2Expert/Classes/registration.php with below content: <?php \Magento\Framework\Component\...
user avatar
0 votes

How to remove extra dash from virtual category page meta title

Have you checked store view? Most of the time we ignore this. can you please it once if using single store then please tick the checkbox.
user avatar
0 votes

I am confused which observer should I use for an order placed event in magento 2?

I want to suggest 2 events which detailed scope and information: checkout_submit_all_after: I will be going with this if I just need to get order information. sales_order_place_after: I will be ...
user avatar
  • 1,172
0 votes

How to hide messages after certain time

Tested this in Magento 2.4.4. Copy this file to your theme: vendor/magento/module-theme/view/frontend/templates/messages.phtml into this folder of your theme: Magento_Theme/templates/messages.phtml ...
user avatar
  • 160
0 votes

special price product collection working but loading speed is too slow ,I don't understand why the speed is so slow please help!

Here are some improvements you can do. Try getting rid of ->addAttributeToSelect('*'). Select only what you need. Adding all product attributes can be expensive. You can use ->...
user avatar
  • 195k
0 votes

PHP Fatal error: Class Magento\Setup\Mvc\Bootstrap\InitParamListener contains 1 abstract method

The fact that you got this error suggests that you were using the setup directory from the older Magento version. In such case you could do what snez suggested above: rm -rf vendor composer install ...
user avatar
0 votes

How to solve the message "Character content other than whitespace"?

In my case the reason was "preference" had no content, i changed from this <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
user avatar
0 votes

Magento 2 :- Magento upgrade error 2.4.4 in php 8.1

mcrypt module is depricated and seems to be enforced from php 8.1 Try below steps- Check if mcrypt module is there using php -m If mcrypt module is listed, disable it in php8.1 Restart php Verify ...
user avatar
0 votes

Add dynamic rows (No UI Component) block, into the custom widget

@AcidBurn, could you share the answer to the saving problem? This is an ideal solution to a widget I'm building, but I'm having trouble saving the widget as @MagestryApps already predicted.
user avatar
0 votes

How to fix admin session issue to login to the admin panel?

It's happening because of a function in the core expecting a string but receiving NULL from your DB table called admin_user_session. Run this command so that new sessions will have the right parameter....
user avatar
0 votes

Magento 2: Enable/Disable Payment methods based on product attribute value

You could create a custom extension to look through every item in the cart and disable the payment method MagePal/PaymentRestrictions/etc/events.xml <config xmlns:xsi="http://www.w3.org/2001/...
user avatar
0 votes

Magento2 run specific cron manually

An other way would be to use the standard cron system for linux by editing directly the crontab. This is what i'm used to do for my projects Ex with 2 custom command ran by cron: #~ MAGENTO START xxx *...
user avatar
  • 737
0 votes

Magento2 run specific cron manually

You can use this module: https://github.com/Ethan3600/magento2-CronjobManager bin/magento cronmanager:killjob - Kill cron jobs by code bin/magento cronmanager:runjob - Run a specific cron job by its ...
user avatar
0 votes

Magento 2 run a specific Cron without cron:run CLI command?

You can use this module: https://github.com/Ethan3600/magento2-CronjobManager bin/magento cronmanager:killjob - Kill cron jobs by code bin/magento cronmanager:runjob - Run a specific cron job by its ...
user avatar
0 votes

Incorrect integer value: '' for column `project-preprod_db`.`catalog_product_entity`.`has_options` at row 1

can you try (if you haven't already) setting has_options and required_options to 0 . Maybe Mysql interprates the empty value as null and this field is set to notNull.
user avatar
0 votes

Remove button from customer admin form in Magento 2

I came across this issue and ended up solving it a different way. I wrote up a class NullButton extending button where getButtonData() returns an empty array. Then I used a custom xml layout file to ...
user avatar
  • 399
0 votes

Warning: array_replace_recursive(): Expected parameter 2 to be an array,

You get this error if you have syntax error in your db_schema_whitelist.json file. Just remove it and run: bin/magento setup:upgrade bin/magento setup:db-declaration:generate-whitelist
user avatar
0 votes
Accepted

Owl Carsouel in Magento2

You need to append the field on click owl.append('<div class="item"> << image here >> </div>'); and use the owl carousel add method on load owl.trigger('add.owl....
user avatar
0 votes

My website is not working, I am having this error

In addition to all suggestions try also doing: composer install
user avatar
  • 1,280
0 votes

Changing Magento 2 Page Builder Images to use <picture> and srcset

You can set up the srcset attribute adding a new element in app/code/[Vendor]/[ModuleName]/view/adminhtml/pagebuilder/content_type/image.xml, for example: <config xmlns:xsi="http://www.w3.org/...
user avatar
1 vote

My website is not working, I am having this error

Try below commands: php bin/magento setup:di:compile rm -Rf var/view_proccessed rm -Rf var/cache rm -Rf pub/static/frontend php bin/magento setup:static-content:deploy -f php bin/magento c:f or php ...
user avatar
0 votes

My website is not working, I am having this error

rm -Rf var/view_proccessed rm -Rf var/cache rm -Rf pub/static/frontend php bin/magento setup:static-content:deploy -f If it not works, tell us if all of madantory Magento 2 packages are installed....
user avatar
0 votes

My website is not working, I am having this error

Simply deploy through CMD php bin/magento setup:static-content:deploy -f it will fix your error.
user avatar
  • 2,421
0 votes

Error "Payment model name is not provided in config" when having config in payment section

1.I got the Same error while adding a custom payment method in the checkout page. I resolved the error by following: a.Make sure the payment method code is added same as the title for the payment ...
user avatar
0 votes

two magento site in one elasticsearch

Simply you have to change the Index Prefix for each Magento 2 website. You can do this by going to Stores > Configuration > CATALOG > Catalog Search. then update the Elasticsearch Index ...
user avatar
0 votes

Magento 2.4.4 API PUT products

This is expected behavior. Here's the TLDR for anyone else who comes across this question. Your API endpoint is defined in vendor/magento/module-catalog/etc/webapi.xml. The PUT method with this ...
user avatar
0 votes

How to install 2 different magento2 instance with same server and same database

I also don't see the benefit of using the same database for 2 instances; it will just lead to performance issues, and complicate work for developers. Also, I guess many extensions will have problems ...
user avatar
1 vote

How to install 2 different magento2 instance with same server and same database

Is there a reason why you would not make use of the Magento multi-store functionality? Two applications passing data to the same database at once seems to be a bad idea, in my opinion. Multi-store ...
user avatar
0 votes

Magento 2 PWA Studio: Issue with SSL certificate

To work with a custom hostname and SSL certificate in your local environment you need to run this command below first. yarn buildpack create-custom-origin ./ Linux On Linux, make sure you have the ...
user avatar
0 votes

Magento 2.4.4 API PUT products

The behaviour you describe would probably cause a lot of trouble, as many shops use a bunch of custom attributes. So I'd say it's expected.
user avatar
0 votes

Magento 2 How to restrict specfic ip address to access magento site in admin panel

The easiest way to restrict a Magento system to specific IP addresses when you're developing or doing maintenance work is to use the maintenance mode like this: # get your ip adress: curl ifconfig.me ...
user avatar
  • 113
0 votes

Magento Subscription or Recurring payment

I have a little bias on this subject. I run my backend using Magento and my business is a subscription business. In 2018 I reviewed close to a dozen various Magento 2 extensions that claim they offer ...
user avatar
  • 101
0 votes
Accepted

Magento 2 - Add column to a table by using the declarative schema

I figured it out. It actually worked all the time !!! The problem was my SQL Viewer Software HeidiSQL (v12.0.0.6468) which has a bug and is not showing new data even after refreshing, you need to ...
user avatar
  • 2,402
1 vote

Magento 2 - Add column to a table by using the declarative schema

Check your extension order, It should be after Magento_Sales. etc/module.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
user avatar
  • 1,049
0 votes

Magento 2 contribution automated tests

I have not found an answer to my question, but re-running tests several times and they started to be successful... This makes me think that probably, sometimes, if the test fails it is not our fault. ...
user avatar
0 votes

Error: "Name Prefix" is a required value in Magento 2.2

You just need this: Go to: Configuration -> Customers tab -> Customer Configuration -> Name and Address Options section -> Show Prefix -> No Clean the cache, and you will get removal of ...
user avatar
0 votes

Is there any tool to Convert magento 1 Product import csv file to magento 2

If you are converting Magento 1 to Magento 2 then you can migrate the Magento. You can simply use data-migration-tool for that which is by default provided by Magento. If you have csv and you want to ...
user avatar
0 votes

Create magento 2 Patch

Add the file you want to modify:: git add vendor/magento/module-customer/Block/CustomerData.php -f make changes to the original file vendor/magento/module-customer/Block/CustomerData.php git diff ...
user avatar
0 votes

How to disable the cache for the block in Magento 2?

I wouldn't recommend using cacheable="false" since it's a "page cache breaker" as it states in Magento developer docs. If you make getCacheLifetime in the block to return null it ...
user avatar
1 vote

Magento 2 : How to set the Title of Page in Admin Grid using UI_COMPONENT

Try this within body tag of your layout file view/adminhtml/layout/id_foldername_classname.xml <body> <referenceBlock name="page.title"> <action method=&...
user avatar
0 votes

How to get product collection without special price and tier price?

You can check for special price in addAttributeToFilter protected $productCollection; public function __construct( ... \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $...
user avatar
  • 1,049
0 votes

How to Integrate Magento Social in Magento 2.2

To integrate Magento social, you need to be proficient with coding, ReactJS, GraphQL, and other technologies. This is not easy. Therefore, I want to mention a way helping you solve this issue. You can ...
user avatar
0 votes

Unable to Set Custom Price or Quantity in Admin Orders

I don't have enough reputation to comment, sorry. I'm having this problem all. If you post a list of the extensions you're using, I'll cross reference the ones I'm using and we'll see if there's any ...
user avatar
  • 1
0 votes

Magento 2.4.x: How to pass custom variable from controller to phtml file?

I had to work on same requirement and i achieved as below. Controller Class namespace Vendor\Module\Controller\Index; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context;...
user avatar
0 votes

Magento 2.4.x: How to pass custom variable from controller to phtml file?

You can do it with static variable like below. Controller class. <?php namespace Vendorname\Modulename\Controller\Index; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\...
user avatar
  • 1,049
0 votes

Magento 2.4.x: How to pass custom variable from controller to phtml file?

it's also possible by ajax call. By using that controller variable could be call in phtml file. Phtml file <div id ="Div_id"></div> <script type="text/javascript"&...
user avatar
0 votes

Magento2.4.2 multi website setup not working

@paj's solution must be completed with this step to allow app/bootstrap.php to be pointed correctly: magento_root/pub/wholesale/index.php require __DIR__ . '/../../app/bootstrap.php'; @Balaji ...
user avatar

Top 50 recent answers are included