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
8 views

How to get the checkbox value from the admin side and display it on the frontend in Magento2

I am new to Magento2 and I wanted to show the attribute values on the frontend, which are on the admin side.so I don't know where and how should I start this flow to implement my ideas in magento2 so ...
user avatar
0 votes
0 answers
7 views

Changing the order status from `cancelled` to `processing` is setting the status to `complete`

We have a payment gateway plugin. If a payment for the order is charged but for some technical reasons it gets marked as failed then our plugin marks the order as cancelled or expired. In these ...
user avatar
  • 101
0 votes
0 answers
6 views

Magento 1.9 - Remove TAX if customer set a VAT

i need to remove taxes for customers that set a VAT. I created a module in app/etc/modules/Easylife_Meta.xml <?xml version="1.0"?> <config> <modules> <...
user avatar
0 votes
0 answers
11 views

Magento2 checkout page gets broken if logged in?

I'm in Magento2, and I've build up a new theme for the checkout. I've added a new step: In app/code/Checkout/NewStep/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="...
user avatar
  • 3
0 votes
0 answers
25 views

Add a product attribute to a custom button on product pages, Magento 2.4.2

I am trying to add a product attribute to a custom button on product pages. I created a custom attribute called ebay_url. In custombutton.phtml I want to use the ebay_url product attribute to replace '...
user avatar
1 vote
1 answer
13 views

Update Magento ver. 2.2.4 to Magento ver. 2.3

If we update Magento ver. 2.2.4 (php 7.1) to Magento ver. 2.3 (php 7.3,8.0) we again need to buy plugins? Or plugin are system dependent. extensions (plugins) are ALGOLIA SEARCH. WEBKUL MAGEPLAZA and ...
user avatar
0 votes
1 answer
16 views

How to add link in shopping method in frontend side in magento 2?

how to can add link in frontend side in Shipping Methods ,and that link can show in only one method not for all
user avatar
0 votes
0 answers
14 views

If we move from Magento 2 to custom coding (Laravel) does it effect SEO

I have a website from 2018 and right now having many issues because didnt update Magento now company want to change to custom coding (laravel) need to know its affect the SEO or not as much i know we ...
user avatar
0 votes
2 answers
19 views

Is there any way to hide columns controls button in Magento2 admin UI component for specific user role

I have to hide "Columns" control button for specific user roles in admin UI grid. Looks like it's managed through xml <columnsControls name="columns_controls">. I tried to ...
user avatar
0 votes
2 answers
12 views

Can not add2cart grouped product when 1 input field is diabled

I need to disable the input field when customergroup = 0 or 1 and quantity is < 0 but when I add the argument 'disabled' to the input, the add2cart button does not put the other available items in ...
user avatar
1 vote
2 answers
41 views

How filter dropdown options based on another dropdown selection in Magento2 UI grid filters

I am struck in finding the solution for the below requirements Assume drop down#1 and drop down#2 selection box in the Magento2 admin UI grid filters. If we select option in one drop down#1 then we ...
user avatar
0 votes
0 answers
11 views

shipping method auto select

Below is the picture of click n collect shipping method. if store view selected how to auto select in this drop down.
user avatar
0 votes
3 answers
13 views

How to configure and setup Xdebug in phpstorm for Magento?

I want to use the debugger to debug my module but I don't know how to configure and set up debugger in phpstorm, any hints or solutions?
user avatar
0 votes
1 answer
11 views

xml to extract data in php

Her are my code. I can't able to get full data in array format. Only Url get this php code. Where am I wrong. $sitemap = 'videomap-1.xml'; $context = stream_context_create( array( "...
user avatar
0 votes
0 answers
19 views

$_SESSION that has been unset is saved back in magento with custom GTM (google tag manager) x GTM Weltpixel

I have some issue after add custom tag in GTM and setting configuration in magento by Weltpixel for GTM extension so, i have custom tag for tracking event login, logout, banner click, brand click, etc ...
user avatar
  • 101
0 votes
1 answer
24 views

Magento2, how to get all products images in Wishlist page?

I'm in Magento2, All I need to do is get all the images of the products in the Wishlist Page. This is my app/design/frontend/<Vendor>/<theme>/Magento_Wishlist/templates/item/list.phtml <...
user avatar
  • 3
0 votes
0 answers
15 views

Magento 2.4.4 - Module coupon return $object_or_class must be of type object|string, null given

I have updated the Magento 2.4.4 version and also the stripe payment module. I noticed that when I try to save or create a coupon from the Magento backend it comes back this error related to the ...
user avatar
  • 297
0 votes
0 answers
18 views

Is there any default php method to uses the deprecated end() function php8.1?

end() function is deprecated in php8.1 and have tried to find the default PHP method but seems for an end() method replacement there is no same working method anywhere. https://www.php.net/manual/en/...
user avatar
0 votes
1 answer
40 views

Magento 2 Category rule and override the cart file by plugin

how do I can set up a rule in Magento 2 by category, If need to do something like this: I one product that is from one category is added to the cart then the customer can't add any product from ...
user avatar
  • 2,066
0 votes
1 answer
19 views

Magento 2 : How To Get Configurable Product's Child Product Id Using Swatch-option?

I want to get the product id on selecting the swatch option. for that, I have used the code given below. I am getting the error of "Cannot read properties of undefined (reading 'options')" ...
user avatar
0 votes
1 answer
19 views

What methods do you use to optimize the work and performance of the backend part (.php)?

I want to try to optimize the performance of Magento 2. After searching this question, I see that for the most part everyone removes modules that are not used on the project or that are obsolete. But ...
user avatar
0 votes
0 answers
19 views

Add custom checkout button in specific places

I want to add a custom checkout button in minicart but not in product page. I followed Paypal in vendor/magento/module-paypal/Observer/AddPaypalShortcutsObserver.php $shortcut->...
user avatar
0 votes
1 answer
21 views

Will the same php and mySQL versions work for both Magento 2.4.2-p1 and Magento 2.4.4?

I have a Cloud VPS account which currently runs Magento 2.4.2-p1. I would like to install Magento 2.4.4 in a separate account in that Cloud VPS but I'm told we will have to upgrade php and mySQL for ...
user avatar
  • 306
1 vote
0 answers
16 views

Why is posted data lost when resubmitting Magento 2 Admin form?

Let's say I'm debugging an custom Admin form and in my save controller I print out the data: print_r($this->getRequest()->getPostValue()); exit; On the first submit this works fine and the ...
user avatar
0 votes
0 answers
22 views

Enable to receive the mail in magento 2

I have a custom form, when the customer submit the form i am sending mail to the customer. When i try to add specific mail id like addTo('mani@gmail.com') function i am receiving mail to mentioned ...
user avatar
  • 33
0 votes
0 answers
12 views

Warning: is_readable(): File name is longer than the maximum allowed path length on this platform (4096)

I've just mentionned the issue on the official repo : https://github.com/magento/magento2/issues/35515 To summarize the issue : when you use $this->sftp->write($filename, $content) and the file ...
user avatar
  • 772
0 votes
0 answers
12 views

overide third party module service class magento2

i'am using third party extension and i want to overide its service class resides in vendor/modulename/Services/ClassName into my custom module, iam trying to overide it with prefrence in di xml. ...
user avatar
1 vote
0 answers
17 views

Showing previous $_GET results when pressing back

I have a table controlled by a dropdown box. My dropdown for example has all animals, lion, crocodile, and wolf. When I press lion results show fine, I then click crocodile and again results are fine ...
user avatar
2 votes
1 answer
53 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,403
0 votes
1 answer
242 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
42 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
38 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
57 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
31 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
27 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
46 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
32 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
19 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
24 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
101 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
0 votes
1 answer
88 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
0 votes
0 answers
50 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
34 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
312 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
27 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
0 votes
1 answer
70 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

1
2 3 4 5
75