Questions tagged [magento2]

General questions about Magento 2, not specific to a minor version. Use this tag to distinguish from Magento 1. If you have issues with a specific version, please use the appropriate 'Magento-2.x' tag instead. Functionalities between Magento 2 minor versions might differ.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Magento 2 Item with the same ID “24” already exists error

I don't know what is going on, but everytime I go to Sales > Orders, I see this error message: Item (Magento\Framework\View\Element\UiComponent\DataProvider\Document) with the same ID "24"...
0
votes
1answer
20 views

Magento 2 REST API For Place Order gives “transaction declined” error after successful Payment For Payfort Payment Gateway

I am using Payfort extension to process credit Card Payments online for Payfort Payment Gateway. For Website it's working Fine and Placing an order after successful payment. But when I am trying to ...
0
votes
0answers
18 views

I should use sql query or Magento function to get data from table?

I create a custom module, it will run by cron job. Suppose I want to write a sql query to get data from the 'sales_order_payment' table. I read a lot online, it is not a recommend way to get data from ...
0
votes
2answers
20 views

How to restrict payment methods by Attribute or Category?

I want to Restrict payment methods by attribute or category ? I am using Magento 2.4.0. if someone have idea or solution please share with me, I am stuck in this issue. Thanks
0
votes
0answers
23 views

Make parent category clickable in mobile device Magento 2

We have two level categories created on the magento 2 site, Once mouse hover on Parent category a sub category shows up, and when click on parent category its redirected to that category page in ...
0
votes
0answers
6 views

Magento 2 how to override Apply Coupon form submit override

I want to override the post method of apply coupons in the checkout payment tab. I want to redirect when a coupon is applied not an ajax call. I have tried using coupon code event and using js no ...
0
votes
0answers
6 views

Getting 'The XML in file “module-inventory-sales/etc/communication.xml” is invalid: Element 'topic', attribute 'is_synchronous':

i had upgraded my magento from 2.2 to 2.3 , but after doing that i m getting given below error. please let me know whats wrong
0
votes
0answers
7 views

Create order without region id

I want to create an order for country US. In Magento we have 2 ways to create an order one on frontent and other from Admin. We have blocked a particular region Alabama. When we fetch the region ...
0
votes
0answers
12 views

How to get the stock quantity of simple products associated with configurable product?

I can get the stock quantity of simple products but not for simple products which is attached with configurable products. Below is my code for simple product <?php echo $StockState->getStockQty($...
0
votes
0answers
11 views

Displaying shipping method and cost in mini cart (and default shipping method)

We want to have a default shipping method selected when we add a product to the cart and directly displaying the shipping cost in the mini cart. For the default shipping method we were thinking of ...
0
votes
1answer
19 views

Magento 2 add custom checkbox after payment method

In checkout page, after payment methods I want to add custom checkbox and save it's value in sales_order and quote table when click on placeorder button.
0
votes
2answers
16 views

Unable to save product attribute issue

I have an observer, using this event: catalog_product_save_after , where I would like to assign some website ids to my product. This is my code: public function execute(Observer $observer) { $...
0
votes
1answer
18 views

Magento 2.4 allow admin to add out of stock product from admin order

In magento 2.4 we can not add out of stock product while placing order from admin. I have requirement that admin should be able to order from admin side even the products are out of stock. I see the ...
0
votes
0answers
22 views

Ajax based cart update Magento 2

I have implemented the ajax cart update following this. But the issue is when I enter the max qty for a product it does not shows any error. (which is Magento default behavior, should show a popup)....
0
votes
0answers
13 views

Filter products based on location

I have a Magento2 Store where I have multiple location. for (eg. Jaipur, Delhi, Mumbai etc). I want to show products based on location. (Product A is available for one location only, Product B ...
0
votes
2answers
44 views

How to get date of tomorrow in magento2

How can I get date of tomorrow in Magento2? I can use below code to get current date but I couldn't fetch the date of tomorrow. // $this->datetime \Magento\Framework\Stdlib\DateTime\DateTime $...
0
votes
0answers
12 views

Sort products with most quantity first on product list page in Magento 2

I want to sort products with quantity in a way items with most quantity should be shown first and items with smaller quantity should be shown later. here is a similar solution but it is for Magento 1. ...
0
votes
0answers
25 views

How can i pass an object with it's value using DI?

I'm still new at Magento and im trying to work on something where I need to pass the product SKU from a file that has a function that retrieves the product SKU to another file with no such function, ...
0
votes
1answer
16 views

How to Implement Rest API Magento 2 for Mobile App

I read online tutorials for mobile app development.My question is this how I can implement those API in mobile which I will share with app developer.Does I need to add API in module and share module ...
0
votes
0answers
6 views

How do I add a custom customer attribute to Order REST API?

I have a custom customer attribute which needs to be shown upon requesting the order via the REST API. How do I do this?
0
votes
0answers
10 views

Magento Checkout Page Performance

I was going through perfomance improvement in magento 2 checkout page and I found in view source country Id with huge country list irrespective of your admin configuration Allowed country list the ...
0
votes
0answers
42 views

How to Add to cart all product in magento 2

I added a button ("Add all product") on the header. How can I add all products to the cart by clicking on. Someone can help me to solve this problem. Thank you
0
votes
1answer
24 views

How to set search page as home page

I would like to set search page /catalogsearch/result/AVMP as the home page. Anyone have any idea?
0
votes
0answers
26 views

The block is not displaying after loading the page

Please help solve this puzzle. I'm created after plugin, after load category widget. The collection of items must be used in the js. The idea is to simply intercept the collection in the plugin, load ...
0
votes
1answer
30 views

what is the correct way to modify 3rd party module?

I have a 3rd party module installed in my magento. I want to do some modification. I should modify the module directly or write another module to override it? Please advise
0
votes
1answer
18 views

How can I know from which file the table error is coming for?

I updated some modules and went up this "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento_prod.amazon_nding_authorization' doesn't exist, query was: DESCRIBE ...
0
votes
0answers
15 views

how to pass multiple values to fieldtofilter

I am passing attribute color value in URL as rest/V1/filterattribute/81?color=32,5. By using getparams $bodyParams = $this->request->getParams(); foreach($bodyParams as $key=>$value) { $this->...
0
votes
1answer
15 views

Magento 2 Pass array data to Custom Email template

I'm a beginner in magento and I have a custom email template as follows wishlist_email_template.html {{template config_path="design/email/header_template"}} <table cellspacing="0&...
0
votes
1answer
27 views

How do I get the language code in the product price amount template file?

How can I get the current language code in Magento_Catalog::product/price/amount/default.phtml?
0
votes
0answers
10 views

How to create sitemap exclude in magento 2?

I need to create a custom module that allows excluding/skipping the Products, Categories and CMS Pages URLs from generating in sitemap.xml. How could I do it in Magento 2?
0
votes
0answers
16 views

How do I change the totals (price, tax, shipping) in an order email?

I want to remove the unnecessary totals in my emails such as "Grand total excl. Tax", "Tax" etc. Where can I find the file where I can change this? Thanks in advance. This is what ...
1
vote
0answers
8 views

Steps to install magento 2 on vagrant box

Steps to install magento 2 on vagrant box How to setup magento 2 on vagrant box ? what are the minimum requirements to make it run at better then basic pace ?
0
votes
1answer
19 views

How to Recieve array in request in Custom REST API in Magento 2

I am working on a custom API in which user will pass the request like below in JSON. { "cartItem": [ { "sku": "11223344", "qty": 1 }, { "sku": "...
0
votes
0answers
8 views

i want to show alert if not select any of two options in magento 2 under specfic shipping mathod

i want to show alert if not select any of two options in magento 2
0
votes
1answer
15 views

Magento 2 - Delete/update all products attribute values by attribute_code

In Magento 2, How to do a mass deletion of all products attribute values, by attribute_code. For exemple I want to delete all values for attribute_code = "my_code". EDIT I also want to ...
0
votes
1answer
15 views

Ajax tabs for configurable product with description of child products

I need to create custom tab in configurable product that will check is there a description in child product that is selected now and load description of child product. So for example in configurable ...
0
votes
1answer
21 views

How to add a custom block in the sales_order_shipment_view page in backend M2?

How to add a custom block in the sales_order_shipment_view page in backend M2? I have to override the sales_order_shipment_view.xml file in my module then I have added the below code for the override ...
0
votes
0answers
6 views

Elasticsearch error - Undefined index | Trying to access array offset on value of type null

So when im trying to reindex my products im getting these errors. Undefined index: prices_0 in../app/code/Wyomind/ElasticsearchCore/Model/Indexer/Product.php on line 938 Trying to access array offset ...
0
votes
1answer
18 views

How to get associated product Id's from grouped product Id?

I try many solutions but i can't get the result please help me for getting associated products from grouped productId like for configurable product we use $parent_pro = $objectManager->create('...
0
votes
0answers
30 views

custom product tab not displayed in Magento 2 enterprise edition

I have created a custom tab in product detail page used the following code in layout file Vendor/Module/view/frontend/layout/catalog_product_view.xml <referenceBlock name="product.info.details&...
0
votes
0answers
7 views

getting error of 400 on creating shipment for an order magento 2.3.1p

showing error while sending this request [URL=https://.in/rest/V1 /order/330/ship, METHOD=POST, HEADERS={Authorization=Bearer *******************, Host=.in, Accept=application/json, Content-Type=...
0
votes
0answers
7 views

Magento 2 PWA Venia No definition MAGENTO_BACKEND_URL error

I install venia store and upward and all then start yarn build and all things looks good but when i try access website i get {"error":"No definition for env.MAGENTO_BACKEND_URL"}, ...
0
votes
0answers
10 views

How To Remove Select From Select Language from google translate in magento 2?

i used google translate for change the web site language in that how can remove the select text from select language full text
0
votes
0answers
6 views

Magento2 : Create custom REST POST api with raw data as application/xml

I need to create a custom REST POST API which will accept XML as like below XML, and we need to read those XML tags. <?xml version="1.0"?> <testparams>TEST</testparams>
1
vote
0answers
25 views

Magento:success page order details issue in magento 2?

When i go through cash on delivery process then success page get all order details on success page But when i go through paytm or other payment getway through its show error Is there any solution for ...
0
votes
0answers
6 views

Magento 2: Create REST POST webapi to read uploaded xml

I need quick help related to creating a POST web API which will accept XML(Multipart/form-data) and read the uploaded XML.
0
votes
0answers
10 views

Set exiting Coupon code In magento 2

I am using magento 2.3.4, i am trying to set exiting coupon code programatically by event/observer. $quotecoupon = $quote->setCouponCode($couponCode); Coupon code set successfully but now not able ...
0
votes
0answers
8 views

X-Frame-Options SAMEORIGIN not working after upgrade to 2.4.1

I just upgraded from 2.3.4 to 2.4.1 , before there is no issue when load content using iframe, but now there is always an error message: Refused to display 'http://test.m2.local/test/index/test/' in ...
0
votes
0answers
16 views

Magento 2 Ajax form key invalid request

I'm trying to send a form from a modal and also an image from that form. the form_data works fine with only serialize(), but I need to attach the image to data, so I did this: click: function (data)...
0
votes
0answers
6 views

I can't find the option to give X% off shipping costs in Magento 2

any way to give x% off shipping costs in Magento 2. its work fine in magento , but i cant find way to set this type of promo rule in Magento 2.