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
1 answer
34 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
170 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
34 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
38 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
0 votes
1 answer
35 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
  • 1
0 votes
0 answers
27 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,078
0 votes
2 answers
84 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,526
0 votes
0 answers
24 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
  • 421
0 votes
0 answers
18 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
  • 421
0 votes
1 answer
34 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
50 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,216
0 votes
0 answers
30 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
0 votes
0 answers
28 views

Magento API Bulk Update fails due to known bug, but fix doesn't work. PHP

Details are here: https://github.com/magento/magento2/pull/35347 To summarize - when using the rest/default/async/bulk/V1/products in Magento version 2.4.4 and 2.4.3-p2 to update or delete records in ...
user2029890's user avatar
0 votes
1 answer
23 views

I want to add custom model pop up for buy a subscription

I want to add custom model pop up with some message. I am creating three category A, B and C when I click on C category a model pop up will show with message please buy a subscription to product under ...
tehwain99's user avatar
0 votes
0 answers
17 views

Category collection returns a different results

I have a category where is_active = 0, include_in_menu = 0 and url = test. But the category has Url Rewrite Rule and final url = test_new. If I get category data from observer (event - after save ...
WhoYou's user avatar
  • 47
0 votes
0 answers
18 views

Update query for products on category grid

on Magento 2.4.5, I've created a store view where only some users can log-in and the category products listed will be different for each user. But it's not working properly because the pagination is ...
Alguve's user avatar
  • 23
1 vote
2 answers
37 views

How to add a new rule after getting an attribute?

I'm a beginner in PHP and magento and facing a little problem. After getting an attribute in the catalog list, I want to add a new rule. But the new rule only needs to show after the attribute is &...
Nick Reijrink's user avatar
0 votes
1 answer
29 views

Magento 2: how to call phtml form using iframe in cms page

i have created form in phtml file, now instead of calling the phtml file on CMS page i wan t call it using iframe. is it possible?. How we can crate and show form using iframe in magento 2
Mani's user avatar
  • 173
0 votes
0 answers
45 views

unable to login to magento2 admin panel

I'm trying to develop a new plugin for Magento2. I have tried to follow this article in order to install Magento2 on my local machine. The problem is after installing it, I couldn't login to the admin ...
TaherAlsabagh's user avatar
0 votes
1 answer
27 views

Product Attribute not display under Catalog Product List conditions

I created attribute for configurable products. I want to create a page using that attribute. I selected the Catalog Product List option in widget. But i can not see added attribute in the dropdown. ...
Daga's user avatar
  • 11
0 votes
2 answers
52 views

Error updating Magento 2.3.0 to 2.4.6 using Composer - Command 'require-commerce' not defined

I am trying to update my Magento 2.3.0 installation to the latest version Magento 2.4.6 using Composer. However, when running the command: composer require-commerce magento/product-community-edition 2....
Aniket Singh's user avatar
0 votes
1 answer
37 views

Show simple products URL in bundle summary

We want to make product name clickable in bundle summary. When user click on product it should be redirected to simple product page. Anyone knows if it possible?
Petacchi's user avatar
0 votes
2 answers
78 views

Magento2.4 enterprise cloud programatically create gift card

I have a phtml file in our magento2.4.4 enterprise cloud which I call via url and want to when the page is loaded programmatically generate a gift card. My phtml file which is embedded in a cms page ...
Jayreis's user avatar
  • 685
0 votes
0 answers
25 views

magento 2 sort by name is not showing full products

Magento 2.4 on the category page when sort by selected is name then products are not showing all products sort by position is working fine sort by price is working fine Example Total 31 products in X ...
sumeet bajaj's user avatar
  • 1,225
1 vote
1 answer
19 views

Why new products take so long to show on frontend

The products we add in Magento 2 take too long to show on frontend, specifically 24 hours give or take before they start to show. Is this a php or index issue?
sarmad95's user avatar
0 votes
1 answer
95 views

I'm using Magento 2.4.6 and want to allow customers to log in permanently as long as I don't hit the logout button

I am trying to achieve a login duration of 2 days or (a period of time) for customers in Magento 2.4.6. I tried adjusting the "Online Session Lifetime" value to control the duration of ...
abd qam's user avatar
0 votes
1 answer
28 views

Display array when button in clicked in PHP

I have an array as such: Array([0]=>1001 [1]=>1002 [2]=>1003 [3]=>1004) Array([0]=>2001 [1]=>2002 [2]=>2003) I am trying to display the array in a table like below: Location ...
philtatos's user avatar
0 votes
2 answers
82 views

In Adminpanel di.xml for graphql [closed]

Autosmart\CategoryAttributes\Model\Resolver\CategoryAttribute resolve
Noor Mohamed's user avatar
0 votes
0 answers
44 views

Goomento is not displayed in react theme ScandiPWA Magento 2

When using a react ScandiPWA theme and goomento page builder and appears an error when switching to my theme in consturcto. Styles does not apear when switching to the react ScandiPWA theme, but ...
Tech Danil's user avatar
0 votes
3 answers
451 views

magento 2.4.5-p2 to 2.4.6 composer update error

magento 2.4.5-p2 to 2.4.6 composer update error Problem 1 - symfony/config[v4.0.0, ..., v4.4.8] require php ^7.1.3 -> your php version (8.1.18) does not satisfy that requirement. - Root composer....
matinict's user avatar
  • 1,500
0 votes
0 answers
36 views

How Add PO Number Field for All Payment methods

On checkout, there should be an input field for the PO number Input needs to be available for all payment types and must be required. Hide the default PO number in the Payment on Account payment ...
Nabeel shahbaz's user avatar
0 votes
0 answers
33 views

When a simple product is removed from grouped product in admin panel in Mage 2.4.5. Here comes issue

In Magento 2.4.5 vanilla when creating a new grouped product, let's suppose this grouped product already has 20 simple products. Step # 1: Add the 21th product in grouped product table in product edit ...
HamzaKhalid273's user avatar
0 votes
2 answers
242 views

TypeError: str_replace(): Argument must be of type array|string, null given

I am getting the below error: main.CRITICAL: TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, null given In the following code: public function beforeSendResponse(Http $...
G. G.'s user avatar
  • 1,078
0 votes
0 answers
19 views

Magento 2 Grunt Install Error on Ubuntu LEMP

npm install -g grunt-cli Showing Error on Grunt Install Error on Ubuntu LEMP: npm notice npm notice New major version of npm available! 8.5.5 -> 9.6.7 npm notice Changelog: https://github.com/npm/...
matinict's user avatar
  • 1,500
1 vote
1 answer
152 views

How to Solve 404 error on frontend?

Getting 404 error on frontend page backend Admin panel is perfectly working frontend page only through error what is the reason behind that
user avatar
0 votes
3 answers
85 views

How can I add custom fields in checkout page?

I want add two fields in checkout page (text type). How can I do this in Magento 2.4.2?
WhoYou's user avatar
  • 47
0 votes
2 answers
45 views

sudo php bin/magento module:status didn't run?

I was trying to run this command but the error raised like this PHP Warning: require(/var/www/medical/bin/../app/bootstrap.php): Failed to open stream: No such file or directory in /var/www/medical/...
Ansari's user avatar
  • 435
0 votes
1 answer
43 views

How can I set default zip code for checkout page and refresh shipping methods?

I created module for set default zip code in checkout page by this answer - https://magento.stackexchange.com/a/293818/102895. It's work - the ZIP code is set when the page loads by this plugin. But ...
WhoYou's user avatar
  • 47
1 vote
0 answers
162 views

Magento2 alternative class of Zend_Filter_BaseName in magento 2.4.6 [closed]

when i download log file from admin then this error occur Error: Class "Zend_Filter_BaseName" not found in app/code/vendor/module/Controller/adminhtml/Download/GetLog.php Here is that file. &...
Ekta's user avatar
  • 111
0 votes
0 answers
31 views

Missing required field in Magento 2 checkout process

I am using Magento 2.1.8 and I am experiencing an issue where a required field in the checkout process is sometimes not appearing. The field in question is called "Comuna". The field header ...
Pablo Muoz Enexum's user avatar
0 votes
1 answer
32 views

Custom sql to get Magento2 EE reward point data

I am trying to write a custom sql that will provide to me data related to the Magento2 EE reward points. My issue is that my queries seem to be showing 0 as the result which can not be because when I ...
Jayreis's user avatar
  • 685
0 votes
0 answers
40 views

Check if database address value is empty in $collection?

How can I check if the field "company" contains a value or not, and set another value ("not a company" for instance) if empty? class OrdersGrid { public function afterGetReport($...
Aknot's user avatar
  • 314
0 votes
1 answer
140 views

Will Magento 2.4.2-p1 run with PHP 8.1?

I have an 'older' site running Magento 2.4.2-p1 on the same server as my new site I'm working on which is running Magento 2.4.5-p1. I have previously reached out to our hosting asking about PHP ...
Allysin's user avatar
  • 128
0 votes
1 answer
82 views

In Magento2 How do i solve this JsonSerializable error

When we open frontend at that time below error is generated. During inheritance of JsonSerializable: Uncaught Exception: Deprecated Functionality: Return type of GeoIp2\Model\AbstractModel::...
Sutariya Parth's user avatar
0 votes
1 answer
54 views

Magento 2 How to get td value using script and assign that value to php variable in same phml file?

I have php variable called itemId in same phtml file and i got td value using js. now i need to assign that var id value to $itemId variable. <?php $itemId = null; ?> <table class=&...
Nihal Shantha's user avatar
0 votes
1 answer
95 views

what does $this->_coreRegistry->registry('current_category') return in magento 2?

what does $this->_coreRegistry->registry('current_category') return in magento 2 ?
duies's user avatar
  • 3
1 vote
1 answer
43 views

Magento Server Response Time Very High - Custom/Magento\Framework\App\Http\Interceptor

Our Mangeto 2 site is loading very slowly. Server response time is 2-4s. We started using new relic to debug the issue. We found the following loading very slowly . Custom/Magento\Framework\App\...
Azzez's user avatar
  • 11
0 votes
1 answer
24 views

How can i pass product attribute manufacturer and SKU to javascript?

I have the following script which i need to add the product brand/manufacturer and SKU <script> window.addEventListener('liveload', function() { IcecatLive.getDatasheet( {...
just_testing_magento's user avatar
0 votes
0 answers
25 views

Unable to add tracking #

Is there anyone available for the help please. I was trying to add tracking # into the order but I'm giving an error. Complete process is here: https://drive.google.com/file/d/...
Sufyan Ahmed's user avatar
0 votes
0 answers
21 views

Change the delivery service during the loading of the checkout page

How can I change delivery method in Magento 2.4.X during the loading of the checkout page?
WhoYou's user avatar
  • 47

1
2 3 4 5
77