Questions tagged [php]

This tag is used for questions that involve PHP code in any way. So as soon there is a PHP Exception returned or error report generated, this question qualifies to be tagged with PHP.

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

Magento 2.4.6 calling createOrder() causes exception with elasticsearch

In one of my scripts, calling createOrder() ( from vendor/magento/module-sales/Model/AdminOrder/Create.php ) causes an exception: {"error":{"root_cause":[{"type":"...
jonny5556's user avatar
0 votes
1 answer
18 views

Uncaught Error: Call to a member function getEndpointUrl() on null in /home/magento/backend/app/code/Wac/InstagramFeed/Model/Api/AbstractApi.php:124

the above image The getendpointUrl getting null public function getEndpointUrl(): string { return $this->getStoreConfigValue(self::XML_PATH_INSTAGRAM_API_ENDPOINT_URL); } ...
Alan Biju's user avatar
0 votes
1 answer
26 views

Get SKUs of all bundled product items Magento 2.4.6

Get SKUs of all bundled product items Magento 2.4.6 I have a bundled product, let's call the sku BundledProduct. I have 3 products that can be selected to be bundled with BundledProduct. Let's call ...
user115044's user avatar
0 votes
0 answers
29 views

Magento2 How to get Use auto generated coupon by website wise.?

// For all websites $websites = $this->_storeManager->getWebsites(); foreach ($websites as $website) { $websiteUrl = $website->getDefaultStore()->getBaseUrl(); $url = $websiteUrl . ...
Magecomp Product Team's user avatar
0 votes
1 answer
34 views

An error with Magento 2 Admin panel page/Unable to access the admin page

When logging into my admin panel it's throwing the error below, causing me to be unable to access the admin panel. 1 exception(s): Exception #0 (InvalidArgumentException): Item with identifier ...
David Gupta's user avatar
0 votes
0 answers
31 views

create a reslover and graphql query for city and area

my current resolver is my current graphql schema is Iam looking for a graphql schema and resolver that if i select a city then all the area will display can you give me graphql query also and what ...
Alan Biju's user avatar
0 votes
0 answers
41 views

Magento2 how to get two tables data in my custom grid.?

I want to get data as name from salesrule table code from salesrule_coupontable. Here I attached the salesrule and salesrule_coupon table in which I want to get code column data. In the salesrule ...
Ekta's user avatar
  • 101
0 votes
1 answer
31 views

How to get absolute path from category in megamenu?

i'm using the MageDelight Megamenu extension for a website with different stores in different countries, ex: mystore.com/en_uk/ mystore.com/en_us/ While creating the menu in admin i put the ...
media.queeries's user avatar
1 vote
1 answer
33 views

Magento 2.4.6: $_isFixed must not be defined error in custom shipping module

I have coded a custom shipping module for Magento 2.4.6 according to Adobe's documentation here: https://developer.adobe.com/commerce/php/tutorials/frontend/custom-checkout/add-shipping-carrier/ I am ...
user86226's user avatar
0 votes
3 answers
91 views

How to hide admin product form tabs for specific admin user?

I want to have an admin user who would only be able to view the 'Images And Videos' and 'Search Engine Optimiation' in the admin product edit form. I tried the following. Created app/code/Vendor/...
Aniruddha Ray's user avatar
1 vote
1 answer
30 views

Magento2: I'm getting empty data from the product attribute

I am receiving empty data from the product attribute "product_types" & getting a null value when fetching the data from this attribute.
Alan Biju's user avatar
0 votes
0 answers
8 views

In magento, how can we bring the swatch options of a configurable product and it's corresponding image url's in an array?

I need to bring the swatch options of a configurable product and its corresponding image url's stored in an array in PLP page in magento. How can I do that? I got an empty image url array while trying....
Farseen's user avatar
0 votes
1 answer
40 views

How can I sort is not saleable products in the end of category

I need products that are out of stock (!$_product->isSaleable()) to be displayed at the end of the category list in the catalog (frontend part) Magento v 2.4.2
WhoYou's user avatar
  • 53
0 votes
0 answers
43 views

In Store Delivery sources show regardless of product stock status

I have come across an issue in Magento 2.4.6 p3 that appears to be a bug, https://github.com/magento/magento2/issues/37992 When using the In Store Delivery option if a product is out of stock you ...
miller75's user avatar
  • 409
0 votes
1 answer
43 views

Magento\SwatchesGraphQl\Model\Resolver\Product\Options\DataProvider\SwatchDataProvider does not exist

Magento\SwatchesGraphQl\Model\Resolver\Product\Options\DataProvider\SwatchDataProvider does not exist the error while i using php bin/magento s:d:c
Alan Biju's user avatar
0 votes
1 answer
76 views

when creating database showing error The default website isn't defined. Set the website and try again

sudo php bin/magento setup:install --base-url=http://oxygen.local --db-host=localhost --db-name=oxygen –db-user=root --db-password=Root@123 --admin-firstname=admin --admin-lastname=web --admin-email=...
Alan Biju's user avatar
0 votes
1 answer
65 views

Magento 2.4.6 Localhost Install Windows 11

I am having issues installing Magento2 on my local machine. I have been following this tutorial but I run into the same issue where my localhost/magento2/pub/ page doesn't display content. I have been ...
Kage Dev's user avatar
0 votes
1 answer
31 views

unable to update custom attributes to product using rest API

I have created the custom attribute through rest API and it is also reflected in magento admin, after which when I tried to update the product with the attribute code.it won't worked. Below is my ...
manikandan.p's user avatar
0 votes
1 answer
30 views

Update custom attributes to product using rest

$data = [ "product" => [ "sku"=> $productsku, // "attribute_set_id"=> 4, //"attribute_set_id" => $mage_attr_set_id, ...
manikandan.p's user avatar
0 votes
1 answer
28 views

Magento2: We have unassigned an attribute from the attribute set but it is still showing on the frontend

I have different Attribute Set Name they are tv,laptop and watch I have unassigned Ram in attribute in watch and Tv and assigned attribute in Laptop but it showing Ram in Watch(attribute) and Tv and ...
Alan Biju's user avatar
0 votes
2 answers
57 views

I'm getting empty array without using session object. How we can get cart data without using session object

I'm getting empty array without using session object. How we can get cart data without using session object. Here is the screenshot: Here is the code: $cartItems = $this->cart->...
Alan Biju's user avatar
0 votes
0 answers
32 views

Broken reference: the 'product.reviews' element cannot be added as child to 'product_tabs', because the latter doesn't exist

Broken reference: the 'product.reviews' element cannot be added as child to 'product_tabs', because the latter doesn't exist
Alan Biju's user avatar
1 vote
2 answers
140 views

Magento2: Experiencing a problem with currency loading on PDP page

We are experiencing an issue with one of the store PDP page, where the currency sign is not showing after the page loads. During PDP page loading, the currency symbol is displayed, but after ...
Deepak MageDivine's user avatar
0 votes
1 answer
39 views

Magento 2.4.6: Order confirmation email configurable product custom attribute returns parent value instead of child

I'm trying to add a custom product attribute 'renewal' to the order confirmation email. I have several configurable products and they are returning the parent product attribute value rather than the ...
Michael Meyer's user avatar
2 votes
1 answer
104 views

How can I "debug" my Magento website to find out why some text is there/not there?

first, a picture with some explanations. Then some questions... The question is, can I somehow find out why the Text "Ab" is missing in some cases (when I initially load the website). With ...
Kai Mechel's user avatar
0 votes
1 answer
69 views

Invalid entity_type specified: customer

sudo php bin/magento setup:install --base-url=http://vstar.local --db-host=localhost --db-name=vstar --db-user=root --db-password=Root@123 --admin-firstname=alan --admin-lastname=wac --admin-email=...
Alan Biju's user avatar
1 vote
1 answer
89 views

Using if statement in phtml

Would like to put an if statement in the below code as follows. If saleable qty <=0 (equals 0 or under), add CSS. Otherwise, add different CSS <div class="left-stock"> <...
Shaun's user avatar
  • 99
0 votes
2 answers
57 views

Difficulty Overriding Magento 2 File

I am new to coding in Magento 2. I am trying to override a file using this guide https://webkul.com/blog/overriding-rewriting-classes-magento2/, and my file compiles without error, but changes don't ...
Jack's user avatar
  • 3
0 votes
0 answers
18 views

Upgrading Old Installation and Server. Magento 2.3.4 to 2.4.6

I have an old Ubuntu server that I need to update along with everything else as its been neglected for many years. Some Server Details are: Ubuntu 16.04.4 LTS PHP is 7.2.24 Magento version is 2.3.4 I'...
07lodgeT's user avatar
1 vote
1 answer
76 views

Magento 2 Command Not working

Earlier My site was working properly but suddenly it threw the below error. Also, When I tried to run the command it threw the below error. Can anyone give us a solution on How to fix it? and run ...
Keval Chauhan's user avatar
1 vote
1 answer
45 views

Not Display Product Name in the Email template?

module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/...
Thoubik's user avatar
  • 128
0 votes
0 answers
17 views

Custom Variable get dynamic value based on Realtime condition magento2

I have Create the custom variable programmatically like below. updating custom variable value programatically Ex. I have created the current_time variable now I insert the variable in the email ...
Jigar Jansari's user avatar
0 votes
1 answer
42 views

main.CRITICAL: Error: Call to a member function isVirtual() on null

I am having this strange error filling my cron logs: main.CRITICAL: Error: Call to a member function isVirtual() on null from file magento/module-sales-rule/Model/Rule/Condition/Address.php line 177 ...
G. G.'s user avatar
  • 1,132
1 vote
2 answers
450 views

Argument #1 ($storeId) must be of type int, string given error

I am having a feed which is run every night with crons. My instance is magento 2.4.6-p2. I am using this function to get store id: public function execute() { foreach ($this->...
G. G.'s user avatar
  • 1,132
0 votes
0 answers
32 views

how we can get custom product grid in magento 2

I have tried to create a product grid custom extension but product grid filter is not working and I am not able to save data this is my code: <?php namespace Magebees\Artists\Block\Adminhtml\Slide\...
Arun Suryavanshi's user avatar
0 votes
0 answers
26 views

Adding additional price to product

I want to add additional prices to a specific product such as courier charges. How do i do that in Magento 2 when I only have Flat Rate, Free Shipping and Table Rate? Without needing a plugin I mean. ...
sarmad95's user avatar
-1 votes
2 answers
156 views

Getting mcrypt error while upgrading Magento 2

While upgrading Magento 2 I'm getting the following error: Deprecated: Return type of phpseclib_mcrypt_filter::filter($in, $out, &$consumed, $closing) should either be compatible with ...
Sunil Sharma's user avatar
0 votes
1 answer
241 views

Encountering a phpseclib_mcrypt_filter error while upgrading Magento 2

I'm in the process of upgrading Magento and encountering the following error. I'm unsure how to resolve it. Here's the error message. Deprecated: Return type of phpseclib_mcrypt_filter::filter($in, $...
user avatar
0 votes
1 answer
58 views

How to prevent user sending requests frequently?

I believe it can be done with a PHP controller or JS cookie manipulation. Help me with logic. For example, I want a user to send a request once every 2 minutes. Let's pretend I've implemented some ...
Dramorian's user avatar
0 votes
3 answers
329 views

Rejecting mapping update to [magento2_product_1_v2] as the final mapping would have more than 1 type

I've recently upgraded my Magento 2 store from version 2.4.1 to 2.4.3. However, I'm encountering issues when running the catalog search, And I'm receiving the following error message: main.CRITICAL: {...
Zeck's user avatar
  • 3
0 votes
1 answer
67 views

How to Use Customer Address template (set address in Customer Address Template )?

Thank you in Advance I want to use customer address template to show customer template in format but I don't know how to do this ? You can find this configuration :- Store > Configuration > ...
Bhagyesh Bhalodiya's user avatar
0 votes
1 answer
331 views

Class Zend Not Found in Magento 2 – Fix All Zend Errors

Class Zend not found in magento now. So for that, we have fixes for those classes which is currently using the same but we want to upgrade in latest magento 2.4.X versions. common errors of Zend: ...
RONTECH DEFTH's user avatar
1 vote
1 answer
41 views

Hi, I am new to magento. I am trying to place a CSS/javascript popup in the Products/Specification page, data from the static blocks

I am trying to place a CSS/Javascript popup onhover in the Products/Specification Section. Please refer the image. Onhover on the yellow circles. I have created some static blocks, which I want to ...
Biju's user avatar
  • 11
1 vote
0 answers
130 views

Function to get final price of products Magento 2.4.6

I am using the following code to get from magento 2.4.6 product's final price, simple or configurable, to a feed json file. Final price I mean that I need the lower discounted price in product, either ...
G. G.'s user avatar
  • 1,132
0 votes
2 answers
835 views

PHP Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in

PHP Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in "PREPAID_TAXABLE_AMOUNT"=> (($item->getDiscountAmount()) ? abs( round($item->...
Arjun's user avatar
  • 3,576
0 votes
0 answers
28 views

Magento 2 - Payment methods not work

When I conclude the order to the checkout, the current order is always saved in the pending status. Also when I go to the success page of the order I go back the error 500. The same mistake is ...
Jackom's user avatar
  • 473
0 votes
0 answers
29 views

Magento 2.4.4 - Magento modules inside the vendor folder don't work

I'm trying to run the "setup:upgrade" command to register all magento modules but this error is presented: "PHP Fatal error: Uncaught Error: Class Magento\Framework\Component\...
Jackom's user avatar
  • 473
0 votes
1 answer
169 views

Magento2.4.6 issue: During inheritance of JsonSerializable

I run php bin/magento setup:upgrade command in magento2.4.6. But I got error like this. Ced\PwaNotifications\Ui\Component\Listing\Massaction\Templates.php <?php namespace Ced\PwaNotifications\Ui\...
Bohdan V.'s user avatar
0 votes
3 answers
66 views

Sort Multidimensional Array by Alphanumeric value in Magento 2.4.6

For Example, my Array is something like this : $testArray = [ "01-01A" => [ 'name' => "test1", 'test' => "01-01A" ], "01-06B&...
Ronak Rathod's user avatar
  • 6,309
0 votes
0 answers
36 views

How to add simple php or java function result into page or block?

How to add simple php or java function result into page or block using the page builder? If not possible please advise on other ways. I'm new with Magento. I am writing a description of services ...
Mikauskas's user avatar

1
2 3 4 5
77