New answers tagged

0 votes

How to pass .phtml file variable to another module .phtml file in magento2

You can set and get value using by registry Know more about registry Magento 2 set & get Registry values Thanks !
user avatar
0 votes

How to pass .phtml file variable to another module .phtml file in magento2

I am assuming that you want $transactions = $block->getTransactions(); in another PHTML File What we can do Create a view model (recommended) and check the block \Magento\Customer\Block\Account\...
user avatar
0 votes

magento 2 - first order dicount

You can follow using customer segment for that refer this: https://docs.magento.com/user-guide/marketing/price-rule-discount-first-purchase.html You can create a customer segment and use it on the ...
user avatar
0 votes

How do i get the order ID and Order Subtotal in the credit memo page?

public function __construct( ... \Magento\Sales\Model\Order\CreditmemoRepository $сreditmemo, ... ) { ... $this->сreditmemo = $сreditmemo; ... } ............. $orderId = $...
user avatar
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 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
1 vote
Accepted

Magento 2.4.2: The following modules are outdated: Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1

Keep your database backup before do it. delete your module entry from setup_module table. Ex. SELECT * FROM setup_module where module = "Perfectmakeupmirrors_PmmHead"; delete FROM ...
user avatar
  • 1,049
0 votes

Shipment Created but not showing under order Information Magento 2.4.2 p-2

You should check Re-Index status and shipment data in sales_shipment_grid, Your admin grid data would be renderer from sales_shipment_grid table. First make sure that your data would be in ...
user avatar
  • 1,049
0 votes

Shipment Created but not showing under order Information Magento 2.4.2 p-2

Hi @karthik if you have created shipment programmatically please check the table sales_shipment This table has a column order_id which hold the order id relation with sales_order table
user avatar
0 votes

How to attach pdf in mail in Magento 2.4

Magento2.4 does not provide addattachment function in TransportBuilder Class, You need to build it. public function __construct( ... \Magento\Framework\App\Config\...
user avatar
  • 1,049
0 votes

Get admin attribute label

It can be done this way: $product->getResource()->getAttribute('attribute_code')->setStoreId(0)->getFrontend()->getValue($product);
user avatar
  • 48
0 votes

Magento 2.3 REST API not working for default store - rest/V1/inventory/source-items

Please follow the below steps to update the product inventory for the default stock. Step 1: https://domain.com/rest/V1/inventory/source-items Use Method : Post Step 2: Send parameters in the api body:...
user avatar
0 votes

How to add category dynamic field with textbox in admin form magento 2

In your custom module create : src/app/code/VENDOR_PROJECT/Category/view/adminhtml/ui_component/category_form.xml <?xml version="1.0"?> <form xmlns:xsi="http://www.w3.org/2001/...
user avatar
  • 737
1 vote
Accepted

How to override the Search.php using preference in magento 2?

You can only specify preferences for classes that get instantiated. From what I see, the class Magento\Framework\Search\Search does not get instantiated. It is only extended by the class Magento\...
user avatar
  • 195k
0 votes

How we show customer group name in magento 2 email template

This should give you what you need. Dont forgot to initialize in construct. /** * @var \Magento\Customer\Model\Session */ protected $session; /** * @var \Magento\Customer\Api\...
user avatar
  • 737
0 votes

How can I limit discount coupons amount

It's out of box requirement. you can use any 3rd party extension for special promotion. e.g amasty special promotion for magento 2 https://amasty.com/special-promotions-for-magento-2.html
user avatar
  • 2,421
0 votes

Magento 2 showing notification again and again even after page refresh

Hello thanks for this post. I tried your code and not works in my Magento 2.4.4 version. What is wrong? /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */...
user avatar
0 votes

How to move language switcher outside of settings tab on mobile view Magento 2

Here is the code which might help you. Add default.xml file at following path app/design/frontend/ThemeVendor/ThemeName/Magento_Theme/layout/default.xml <?xml version="1.0"?> <!-- ...
user avatar
1 vote

How to change the custom controller url to fancy url in magento 2

First you neeed to define a router in your etc/frontend/di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...
user avatar
  • 737
0 votes

Magento 2.3 data insert using Data patch

<?php declare(strict_types=1); namespace Moazzam\AddPatch\Setup\Patch\Data; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\Patch\DataPatchInterface; use ...
user avatar
  • 13
0 votes

Magento 2 how to modify SKU in order rest api response

The best way should be to create plugins for OrderRepository and OrderItemRepository, in detail: create plugin OrderRepository:afterGet() method create plugin OrderItemRepository:afterGetList() ...
user avatar
  • 147
0 votes

Find all duplicate product name

Try below code. protected $productCollection; public function __construct( \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory ) { $this->...
user avatar
  • 1,049
0 votes

Adding extension attribute to customer in GraphQL Magento 2

For fetching custom attributes data in your customer graphql api you just need to add the attribute into your schema.graphqls file in following way type Customer { mobile_number: String ...
user avatar

Top 50 recent answers are included