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
2 votes
1 answer
94 views

Magento 2: Add class to body from PHP

I need to create a extension which adds a class to the body tag. The class should be defined in the magento 2 backend in the extension settings. How can I do this?
user avatar
  • 2,461
0 votes
2 answers
558 views

Magento 2.4.4 - issue with setup:di:compile

I recently upgraded my site to Magento 2.4.4 with PHP 8.1 and noticed that when I try to run the command '$ php bin / magento setup: di: compile' the process stops at 1/9 with this error message : 1/...
user avatar
  • 297
0 votes
2 answers
49 views

Magento 2.4.2: observer class not getting invoked on event layout_load_before

My objective is to set NO INDEX, NO FOLLOW to a specific category page in an observer class. Below is my event.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/...
user avatar
0 votes
1 answer
66 views

Magento 2.4.2: How to find out if it is category page in the observer class?

My objective is to set a specific category to NO INDEX, NO FOLLOW in an observer class. Below is my event.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
user avatar
0 votes
0 answers
117 views

How to save custom shipping address on quote?

I am trying to save custom shipping address to quote. I've made a plugin for Magento\Checkout\Api\ShippingInformationManagementInterface on before saveAddressInformation method, and the new values ...
user avatar
  • 1
0 votes
2 answers
44 views

There has been an error processing your request: Error log record number: d11d948cb3596b359566fa162df65dbf6baef2446fe384f4476057675f3dd95f

Exception printing is disabled by default for security reasons. Error log record number: d11d948cb3596b359566fa162df65dbf6baef2446fe384f4476057675f3dd95f i run the record log number in putty this what ...
user avatar
0 votes
1 answer
20 views

How to hide my custome shipment method based on custom product attributes in Magento2?

I'm a very new to Magento2. I'm stuck with display the new shipment option show/hide. I have created a new shipment method programmatically and name it "Same Day Delivery" and also I have ...
user avatar
0 votes
1 answer
38 views

PHP and MYSQL versions for Magento 1.9.4.0, 2.4.2-p1 and 2.4.4

I have 3 websites: Website 1 still runs on Magento 1.9.4. Websites 2 and 3 run on Magento 2.4.2-p1 which we are having terrible problems which I believe are because the Magento Migration Tool messed ...
user avatar
  • 306
0 votes
0 answers
85 views

Virtual category products using Smile Elasticsuite

I need all virtual category products using Smile \ Elasticsuite. I have searched on other sites but cannot find a working solution or similar example. Below I am attaching the code as I tried but it ...
user avatar
0 votes
1 answer
45 views

Add registration form during checkout

Magento provides a registration step at checkout only if Guest checkout is disabled. Is there a way to show the registration form with Guest checkout enabled?
user avatar
  • 101
0 votes
0 answers
22 views

Replacement for GuzzleHttp\UriTemplateFactory?

I have a plugin (for Magento 2.4.4), it is using the following class "GuzzleHttp\UriTemplateFactory" but "UriTemplateFactory" is deprecated and removed from Guzzle. Looking for a ...
user avatar
  • 3
0 votes
0 answers
12 views

How do I allow users to unsave certain events from the wishlist page using PHP?

I have uploaded the images for my wishlist.php, I need to implement a way to unsave an event from the wishlist page.
user avatar
  • 1
0 votes
1 answer
25 views

your session has expired 2.3

Hello I am trying to install magento 2.3.5 p1 on my mac with mamp pro. My base url looks as follows http://magmono:8888/ After I add a product to a card I get an error that session has expired. The ...
user avatar
0 votes
2 answers
193 views

how to delete media image after we delete product in magento2?

As image plays an important role in page load time,Need to delete image too after delete of product from admin panel in Magento 2
user avatar
  • 60
0 votes
2 answers
172 views

How to set special price for specific customer group Programmatically

Guys I'm wondering how to add a special price for a specific customer group? For example, I have a group called "Special Customers", I want to set 10% price increase on every product for ...
user avatar
  • 174
0 votes
0 answers
98 views

add to cart success message shows up only one time

the problem is client wants to fadeout the success message after few seconds by clicking add to cart button. i have made a change in addCartSuccessMessage.phtml file like this: <?php /** * ...
user avatar
  • 1
0 votes
0 answers
3 views

Magento2 - what does the "getDisableAutoGroupChange()" function refer to?

I'm inside the AfterAddressSaveObserver.php file and I found this function that prints the success message as soon as I save the address... protected function addValidMessage($customerAddress, $...
user avatar
  • 297
1 vote
0 answers
37 views

How do I retrieve data from Conditions

I have a problem. I created a widget where inside <parameters> I have a field with conditions. <parameter name="products" xsi:type="conditions" visible="true" ...
user avatar
  • 27
0 votes
2 answers
660 views

Magento 2 PHP Fatal error during setup:di:compile at 33%

Currently running Magento 2.4.1-p1. When I run setup:di:compile I've got this output: Interface 'Laminas\ServiceManager\Factory\FactoryInterface' not found in /chroot/home/af5d329a/851f14efb2.nxcli....
user avatar
0 votes
0 answers
43 views

Magento 2 MiBPHP fatal Error

I am working on my Magento 2 and when i run the setup:di:compile commant i am running into the following message ( see screenshot ) I have opened this directory to open the file and check line 20 for ...
user avatar
1 vote
2 answers
132 views

How to create new tax classes programmatically in Magento 2?

I want to create the new tax classes programmatically and assign products in the shop. So can anyone tell me about the process?
user avatar
0 votes
0 answers
5 views

Magento 2 add to cart product with customizable option(file)

$product = $this->productFactory->create()->load($id); foreach ($product->getOptions() as $o) { $values = $o->getValues(); if (in_array($o->getTitle(), $valuesArr)...
user avatar
0 votes
1 answer
73 views

Magent 2.3.4 Installation error

I was do setup the magento 2.3.4 version in Php 7.3 version But Frontend throw error Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">...
user avatar
0 votes
1 answer
97 views

API stopped working with 2fa since 2.4 upgrade

We have used the same PHP script since magento 2 upgrade (around 4 years) to integrate magento with our warehouse management software. Since we upgraded to 2.4 we are getting this message resulted in ...
user avatar
  • 77
0 votes
0 answers
27 views

Error with magento site running on AWS Auto Scaling ec2

I have a site in magento that receives a lot of traffic, due to this an autoscaling was configured within aws, the site is in an ec2. Due to this, when one of the instances does not support the ...
user avatar
1 vote
1 answer
78 views

How to magento1 compatible with php 7.4?

Please Help me guyz can we run magento1 using php 7.4? Please let me know (magento expert*). Thanks,
user avatar
  • 332
0 votes
0 answers
38 views

How to show thanku popup only, if user alredy submitted the form in magento 2 untill user leaves page

I have custom popup form, when the user click on 'get in touch' button i am showing popup to fill the form, once user submitted the form i am showing thanku popup.So if the user again click on 'get in ...
user avatar
  • 33
0 votes
0 answers
13 views

pending payment to complete

It's possible to change order status from pending payment to complete ? sometimes online payment failed and order status still pending payment I need to change complete.
user avatar
  • 29
0 votes
0 answers
32 views

2 Way SSL for Magento API

Checked many blogs for 2 way ssl(Mutual Authentication) for magento api's or PHP but did not get end to end implementation details. Below is my understanding. Lets consider client (sslclient.com) and ...
user avatar
0 votes
1 answer
28 views

How to send custom form deatils to admin mail in Magento 2

I have created a custom form in my custom module where can the user enter details like name, email, postcode, etc. Once the user submits the form I need to send the user entered details to admin@gmail....
user avatar
  • 33
0 votes
1 answer
119 views

How to add text editor in the admin form and save data to the database in Magento 2

<fieldset name="content"> <settings> <label>Wysiwyg Content</label> </settings> <field name="wysiwyg_example" ...
user avatar
  • 33
0 votes
2 answers
199 views

Docker magento 2 setup issues with Mysql (markshust/docker-magento)

Facing a MySQL connection issue while Magento2 setup with docker at local I have followed the steps mentioned in the existing project in the below link markshust/docker-magento: Mark Shust's Docker ...
user avatar
  • 1
0 votes
1 answer
320 views

Magento 2.4: Unable to unserialize value

When i launch a REST API call to see all orders on my site i get this error: main.CRITICAL: Report ID: webapi-62432e964b1e4; Message: Unable to unserialize value. {"exception":"[object] ...
user avatar
0 votes
0 answers
23 views

How to hide this +$0.00 price from product bundle options on checkout if the price is 0?

i am new to magento and dont know which file to override to hide this
user avatar
  • 1
0 votes
0 answers
10 views

Magento: editing products without finishing loading

I have an e-commerce site developed in magento, it is a site that is currently running on two instances of ec2 due to the traffic it receives. At the time of loading in the administration menu, the ...
user avatar
0 votes
0 answers
137 views

Magento 2: How To Create Product Progamatically Using Custom Rest API

I need to create a product using a custom Rest API. (this is my first time working on API). So to check API whether it's working or not I wrote the code below, API is working, now I need to give ...
user avatar
0 votes
1 answer
27 views

How to add "Where did you hear about us ?" dropdown in Magento 2

I want to add the "How did you hear about us?" drop-down in the order confirmation page for first-time users to my store. And add values like Facebook, from friends etc.. How can I achieve ...
user avatar
  • 33
0 votes
1 answer
55 views

Magento 2.4 - Add class for decimals in the price

I'm use Magento 2.4 and I need to change the format of the final price. I need to add a class for decimals. I want to add some css style to the decimals in the price. For example decimals must be much ...
user avatar
  • 2,096
0 votes
1 answer
66 views

How to implement reCAPTCH V3 in custom form in Magento 2

By using Magento default functionality i am able to implement reCAPTCHA V3 in login form and registration form.But i also need that in one of my custom form. Is there any way to implement reCAPTCHA v3 ...
user avatar
  • 33
1 vote
1 answer
31 views

Custom attribute created programmatically not working properly - Magento 1.9

I'm developing a module that creates configurable products, it's simple products and the attributes used to create this configurable (if not exists). All seems fine, products are created, associated ...
user avatar
0 votes
0 answers
12 views

Preventing todays date in datepicker when existing date is null

I have added a date attribute to magento in a custom product import module, if the value is null in the db, which is what i am looking for the frontend date picker defaults to todays date on null ...
user avatar
0 votes
2 answers
31 views

Magento 2 - How to get product attribute options value

I am trying to get product attribute options. Please anyone know, show me step by step. Thanks
user avatar
0 votes
1 answer
37 views

How can i remove items from the basket automatically if the customer added product is out of stock in Magento 2

scenario - the customer added products to the basket and logged out. After sometime he again logged in, now when he checked his minicart or cart i need to remove the products which are out of stock ...
user avatar
  • 33
0 votes
1 answer
194 views

Magento 2.4.3-p1 upgrade - Setup:upgrade stuck at Magento_Customer

I am trying to upgrade Magento 2.4.3 to Magento 2.4.3-p1 using composer and successfully new version upgrade but when run upgrade command but process stuck not progress process of from Data install/...
user avatar
0 votes
0 answers
14 views

get all orders whose products contain specific attribute in Admin - Custom module

I want to create a module magento that contains a table to display orders and in that order there is a product containing a specific attribute. I have looked up the solution but there is no concrete ...
user avatar
  • 30
0 votes
0 answers
29 views

Add name to input field in the checkout

Hi I use this module EaDesgin/Magento2-City-Dropdown and I observe that the "name" for the input is missing. the value name="" is blank. How I can add the name for the city or a ...
user avatar
  • 2,096
0 votes
2 answers
118 views

How to get system.xml config values?

I am trying to get the value of system.xml from a plugin I am developing. <field id="Moduleposition" translate="Module" type="multiselect" sortOrder="30" ...
user avatar
0 votes
0 answers
25 views

How to get information of a field from a magento module?

I am developing a shipping restriction plugin for magento 2, looking at the documentation I found the detailed information of the initial creation process. One of the validations I need is: Depending ...
user avatar
0 votes
1 answer
319 views

Magento 2 Page builder product attribute cannot render html

In Magento 2.4.3 I have created a page builder product attribute labeled "Before Content" which the admin will populate with html and I want to show in product page. Under child theme I have ...
user avatar
0 votes
1 answer
38 views

Grouped products, how to config childrens + increase and - decrease qty function correctly?

I have a problem with + increase and - decrease qty function. On 1 single click it goes up +2 or -2. It also do so on other children products qty inputs. How can I fix this correcly? \...
user avatar
  • 3

1
2
3 4 5
75