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
1answer
10 views

customer/account and customer/address assistance. magento 2

I have scoured the git repository and my local copy, I am trying to find what files magento2 uses to create the edit section of the customer account dashboard for address. specifically for logged in ...
0
votes
0answers
9 views

Using Magento 2 Rest API To Filter On Enabled Products in a Certain Category

I'm having some issues using Magento 2 Rest API to filter on products in a certain category that are enabled. Right now I just get products in a category but the ones that are disabled or not visible ...
1
vote
2answers
21 views

DIFFERENCE BETWEEN ONLINE AND OFFLINE SHIPPING METHOD

I am working on a custom Magento module. I am facing some issues to debug the code and one question that comes into my mind is that what is the difference between offline and online shipping method. ...
0
votes
1answer
40 views

Image Uploader not working magento 1.8 due to Adobe flash outdated

Since end of 2020 adobe flash player going outdated because of that,Magneto 1.8 version image upload function not working. is there any solution to fix this issue. Here attached screenshot
0
votes
0answers
26 views

Admin page of magento 2.3.1 showing only Html [closed]

https://movantechonline.com/admin/admin/system_config/edit/section/yereone_testimonials/key/c6a0c01857e42f52ea402461fd6dfb98783d4905afa9f821a95eb703e146a7c4/ After making some changes from the admin ...
0
votes
1answer
23 views

How to add sku to related products on Magento 2.4?

I would like to add the sku to the related products. How can I do that? <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ use Magento\Catalog\...
0
votes
0answers
26 views

Notice: unserialize error

I am using an old unsupported module which gives an error since update to magento 2.2.11. Notice: unserialize error at offset 0 of 3150 bytes on line 81. protected function getUserExtra() { ...
0
votes
1answer
19 views

How to replace Category Name with Category custom attribute in breadcrumbs Magento 2?

I want to replace the category name with the category custom attribute in the breadcrumbs on the list and product details page.
0
votes
0answers
17 views

"Fatal Error: 'Out of memory' (allocated 202440704) (tried to allocate 20480 bytes) Magento 2.4.1

I'm using Magento version 2.4.1 hosted on AWS EC2 and using AWS ElastiCache for Redis (5.0.6) to store session bin/magento --version Magento CLI 2.4.1 We previously encountered issue with memory limit ...
0
votes
0answers
11 views

Magento 2 Minimum Order Amount per User Account

Does anybody know a extension or a way to apply a minimum order amount per user account? The default minimum order amount feature only works per the entire site and I alo found plenty of extensions ...
0
votes
1answer
15 views

How to add attribute to product grid?

I would like to add the sku attribute to my product widget. Here is the original Magento code- <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ ...
0
votes
0answers
7 views

How to create gzip file in magento2

i am creating sitemap http://dev.abc.com/sitemap/sitemap-1-2.xml 2021-01-19T01:08:41+00:00 here you can see in loc tag sitemap-1-2.xml its in xml format thats fine but i want convert this file in ...
1
vote
1answer
39 views

Header Tag <title>How can I change Product wise dynamically?

I want to Change my header title tag product wise dynamically.my Magento version is 2.3.4. how can I get SKU title to set header title tag? I want to solve this problem. I want to Dynamically change ...
0
votes
1answer
12 views

How to make function run even if getUsername() is null

How can I make this function run - also when getUsername() is null $authSession = $objectManager->get('Magento\Backend\Model\Auth\Session'); $UUsername = $authSession->getUser()->getUsername()...
0
votes
0answers
9 views

Magento 2 - custom option for coupon code

In the Marketing > Cart price rules rule section I would like to create a custom option for my coupon that allows me to apply the discount in money and not as a percentage. To make myself better ...
0
votes
1answer
16 views

PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento 2.3

When running php bin/magento setup:upgrade i see this error. {"messages":{"error":[{"code":500,"message":"Server internal error. See details in report api\/...
0
votes
1answer
43 views

how to get custom attributes in rest search api?

In order rest api http://127.0.0.1/mag/index.php/rest/V1/orders/1 it shows custom attributes "payment_additional_info": [ { "key": "method_title", ...
0
votes
3answers
23 views

Add a css class to the element in template

How can I add a CSS class to the element in the template? for example, I want to add a CSS class to this element <div class="page-wrapper example">
0
votes
0answers
12 views

Magento 2 Theme widgets for child theme not showing

Good Afternoon, I have my base theme "default" for my site and it contains 45 widgets and these work as expected. I need to make a change in terms of display and styles for one of my stores ...
0
votes
1answer
8 views

add class in Magic Slider

I want to add a class to theme, how can i fined the file path ? or is there another way to add class ? here is the class class="slide-home alo-magicslider" i want to add continer to this ...
0
votes
0answers
18 views

Script injection below body tag in Magento 2.4.1

I upgraded our Magento from 1.9 to 2.4.1 after we found malware that was trying to copy customer credit cards before allowing the customer to use PayPal. I used Magento's migration tools to copy data ...
0
votes
2answers
24 views

PHP: How to move an array element with an unknown key to end?

I have an array which contains list of color values. Consider below array: Array ( [value] => 4 [label] => red ) Array ( [value] => 5 [label] => ...
0
votes
0answers
26 views

Can't access Phpmyadmin page

I have installed Magento 2.4.1, Nginx, Mysql8, PHP 7.4 and PHPmyAdmin on Debian 10 on ec2. I have done all the steps from this guide: https://www.digitalocean.com/community/questions/how-to-install-...
0
votes
0answers
11 views

Magento 2.3 - Paypal express review not work

When I am on the paypal/express/review page after completed payment in website of paypal I see this type of error on Magento: "Fatal error: Call to a member function getPayment() on null in ...
0
votes
0answers
7 views

jQuery must click twice

I have moved my Yotpo reviews on the product page to be shown in the tabs. Everything works but i have to click twice on the star rating to open my review tab. I should only click once for the tab to ...
1
vote
1answer
21 views

How to know if my Magento 2 is in developer mode via PHP?

I'm using Magento 2.4 to develop a new module and I need to check if the store is running in developer mode or production mode. How could I get the Magento Mode via PHP?
0
votes
0answers
19 views

Add B2B Company Name in Sales Order create customer grid

I want to display B2B company name in customer grid while we create sales order from admin. For temporary changes I added my code in below class Magento\Sales\Model\ResourceModel\Order\Customer\...
0
votes
0answers
14 views

Magento 2 - Token for reset password form not generated

Sorry if i repeat this question but i prefer for a better explanation. The issue is when i try to submit reset password form return this error message: "Something went wrong while saving the new ...
0
votes
1answer
30 views

In Installer.php line 545: Missing following extensions: 'zip'

I am installing magento 2.4.1,it is giving zip extension is missing, but zip extension is already installed.
0
votes
0answers
16 views

Timezone conversion via \Magento\Framework\Stdlib\DateTime is broken in M2 (CE) - best practice?

Preface: I tested this in CE 2.3.6, but according to Github the relevant code is unchanged since years. Expected behaviour in M1 Consider this code and its output in M1 (1.9.4.5): $coreDate = Mage::...
1
vote
1answer
16 views

How to modify a protected variable $items in magento collection

for some reasons I need to alter the $_items array from the class Magento\Framework\Data\Collection That variable is set as protected, so as,if I try to do something like this $this->_collection-&...
1
vote
1answer
25 views

Magento 2 - How to get data from table customer_log?

I need to get the value for last_login_at for the current customer, but this seems to be impossible without the use of SQL. Current Solution (SQL): /** * @var \Magento\Framework\App\...
0
votes
0answers
10 views

How to make an artifact from a module instead of installing in app/code?

I have a module from a payment system. I added them to app/code. But now, to make a simple rewrite of the module template, I need to do more than just copy it if the module was in the vendor. Tell me ...
0
votes
1answer
35 views

When I am trying to run setup:upgrade its always gives below error,

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE 446 ...
1
vote
1answer
50 views

Magento2 - including THREE.js in custom module

I'm using a 3D model object in my Magento (2.4.0) site for which I need to use three.js lib along with GLTFLoader and OrbitControls. GLTFLoader and OrbitControls are THREE.js dependents. I kept the ...
0
votes
0answers
20 views

Recent Viewed Product

Recently working on Recent Viewed Product. As I have already figure out that I can get product Id from Local storage and can be achieve by using JS but I want to do it using block. How can I achieve? ...
0
votes
1answer
17 views

Magento 2 - Current url not work well in copyright section

I need to get the current url in the copyright.phtml section. This is my code: echo $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]); After clearing the cache it seems to ...
0
votes
0answers
7 views

How to allow user to apply a special discount base on quantity , three times

I have created from Cart Price Rules a new Rule. The rule says: if the user buys 3 of these products ( based on SKU ) will get 5$ off it's possible to allow the user if buy these products two times ( ...
0
votes
1answer
15 views

Notice: Undefined index after migration from magento 1.7.0.2 to magento 2.3.4

Notice: Undefined index: in /home/tbnet/public_html/m2.3/vendor/magento/module-developer/Model/View/Page/Config/RendererFactory.php on line 70 how to solve this error? cannot access m2.3.4 backend
0
votes
0answers
15 views

PWA Studio: Using a Different UPWARD Endpoint

It's been pointed out to me that it's not only possible to use Magento's PHP implementation of an UPWARD server, but that Magento themselves are using it for their own Cloud Servies. Given this is the ...
0
votes
1answer
11 views

Fetch data and arrange sequence in given format

This is my array: <?php $sku = ['HH017','HH018','HH005','HH010','20OZHHTUMBLER', '30OZTUMBLER2','HH006','HH-05']; $sequence = ['HH005','HH010','HH006','20OZHHTUMBLER',...]; print_r(sort($...
0
votes
1answer
20 views

Please suggest me on below description

Site_Link I have refer above link, I want to create this site in Magento 2, In this site it has main functionality name is Virtual Room. I want to create that kind of functionality. So is there any ...
0
votes
0answers
20 views

Why am I getting a DataProvider\Document instance in mass deletion?

I am using Magento 2.4 and I want to add a custom admin Grid for company products. The problem is that I get a an error when I want to perform a mass delete action. The problem appears in my action ...
0
votes
0answers
36 views

Am running the command setup:di:compile, I get this error:

php bin/magento setup:di:compile Compilation was started. Area configuration aggregation... 5/8 [========>-----] 62% 34 secs 348.0 MiB In ClassReader.php line 43: Class Magento\Catalog\Model\...
0
votes
0answers
14 views

Visitor data gets empty

I'm trying to get visitor customer data as following in my resolver to connect with my pwa frontend use Magento\Customer\Model\Visitor; public function __construct( Visitor $customerVisitor ){ $this-&...
0
votes
0answers
36 views

If I run setup:upgrade its giving below error

I have uploaded new module and trying to upgrade its giving below error. SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds ...
0
votes
1answer
12 views

Magento 2 get keys values in rest api response

{ "item_id": 191111111, "sku": "qqqqqqq", "qty": 1, "name":"asdasd", "price": 736.52, ...
1
vote
1answer
99 views

How to get review rating and stars in Magento 2.4?

I have this piece of code found on StackExchange, to show all the reviews from a store store view. And it works great! But how can I extend it to also show the rating and stars for each review? Thank ...
0
votes
0answers
17 views

no discount percentage on configurable products

We have a Magento 2.3 version online store. The discount percentage is only visible on simple products and not configurable. I assume this cos simple products have unique price, and config products ...

1
2 3 4 5
71