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
3answers
33 views

Call to a member function get() on null

I am new to magento 2 and i have tried to get the store id. Here is my code simplifyed: class Mage{ private static $_objectManger; public function __construct( \Magento\Framework\...
0
votes
1answer
26 views

Convert HTML Into Array In Magento2 Controller [closed]

How to convert HTML data into Php Array in magento2 Controller? <!DOCTYPE html> </HEAD> <BODY> <FORM action="***" method="POST" id="**" name="***"> <input type="...
0
votes
0answers
19 views

I want to override magento2-base module in magento 2.3

I want to override vendor/magento2-base/pub/errors/processor.php file but didn't find any solution. If anyone knows how it can be possible then let me know.
0
votes
0answers
14 views

M2 - Foreach only count attributes with value

I have a foreach loop and a array that counts the total attributes from a attribute group. What I need that the array only counts the attributes that have a value. This is the code: <?php ...
2
votes
1answer
50 views

Magento 2 - Understanding text/x-magento-init

I try to better understand the concept of text/x-magento-init. I understand that it allows us to define script components that do a certain task, which we then can use as often as we like in any ...
0
votes
0answers
8 views

unnecessary api calls to external site disadvantages

I worked in a website before 3 years at that time I wrote a code to update 2 fields in database. I got the value of fields from an external api. I had to pass company_id for that api to get the ...
2
votes
0answers
23 views

How to add a text on Homepage using module (code) [closed]

Need help writing a code for adding text on Homepage. I'm running Magento 2 on localhost
2
votes
0answers
27 views

Magento 2.3 - How to call html file instead of exception?

I want to call the HTML file in this function. Currently, it is showing exception but I want custom HTML design to display. Magento/vendor/magento/framework/app/bootstrap.php if ($isOn && ...
0
votes
1answer
60 views

What is Difference Between Configurable Product & Simple Product In Magento?

I Can't find any difference in the product types
0
votes
1answer
38 views

Static content deploy in magneto 2 [closed]

why we use in general static content deploy command in Magento 2? php bin/magento setup:static-content:deploy -f
0
votes
0answers
25 views

How to record voice message via headphones using php or jquery? [closed]

I want to record user's voice message for the suggestion. I am trying to achieve this using jQuery or html but it is not working for voice recording via headphones. if any song or voice is plying ...
0
votes
0answers
37 views

How to export Orders details programmatically in Magento 2?

Recently install fresh Magento2.3.3 with sample order and products, Note I did this installation several times to check may the problem remove after re-installations. There are some issues i) When I ...
0
votes
0answers
26 views

Magento1.9 Out of Stock Products in Search Results

One of my customers wants to search for products which are out of stock. Is this somehow possible without using any search extension like elastic search or something like that? Maybe with a ...
1
vote
1answer
55 views

Magento 2.3.3 - Add file upload field to Contact Page

what is the best way to add a File Upload field in the Contact Page? I want to give users option to upload a file. I try this module but is not work on my 2.3.3 Magento version. Thank you
0
votes
2answers
27 views

Magento 2.3.3 - Contact Form PDF Attachment Not Working [closed]

I want to add in my Contact Form a field for file upload, I try to use this but the attachment is not in the email. Can anyone help? Thank you in advance.
0
votes
1answer
27 views

Magento2 - How to enlarge the catalog single product image?

How to Enlarge the catalog single product image in Magento2
0
votes
0answers
13 views

Magento2 Custom Report How to Add New Filed?

How to change default Filter Value In this Image Magento2.
0
votes
3answers
25 views

Cache Types are Invalid. How can i resolve this permanently?

Error: One or more of the Cache Types are invalidated: Configuration, Page Cache. Please go to Cache Management and refresh cache types. How can i resolve this permanently?
0
votes
0answers
13 views

Magento2 - How to create this type of report? [closed]

How to create this type of report In Magento2 Admin Grid?
1
vote
1answer
23 views

Magento 2: How to disable module programmatically on mode change to production?

I've created a custom module for developer mode only. So, I want to create functionality that disables module automatically when mode change from developer to production.
1
vote
1answer
35 views

Magento 2.3 - Change the Contact page success message

I want to change the Success Message in the Contact Page. After someone press the submit button the Success page is like this: How I can to change the Success Page to display a static block for ...
1
vote
1answer
32 views

How to create an event in magento 2 mailchimp programmatically?

Basically I have successfully connected mailchimp with magento 2 and I am able to see my magento store data in mailchimp backend. Also I can see mailchimp in magento 2 backend and I have pulled the ...
1
vote
3answers
24 views

Magento2 - How to make custom module for customize maintenance mode?

I want to customize maintenance mode in Magento2. Magento2 error message will be hide and my custom message will be visible. If you know anything related to this then share with me.
0
votes
1answer
45 views

Magento 2.3.4 - Missing records in the Content->Design->Configuration

Magento 2.3.4 - Missing records in the Content->Design->Configuration Can't add favicon in the Magento2. In Admin panel -> Content -> Design -> Configuration. Shows We couldn't ...
0
votes
1answer
43 views

Problem with installing mcrypt on PHP 7.3.13 Ubuntu

I have moved my magento 2 project from one vps server to another. So im currently setting up all the PHP modules. But there seem to be some problem with the mcrypt module. This is what I have been ...
0
votes
1answer
35 views

Display a message if cash on delivery is not available on Checkout page

I just want to show the message on the checkout page, when COD is not applicable. for Eg: if we are adding the minimum order total 500 for COD. Then any user tries to purchase below 500 then they ...
2
votes
1answer
29 views

Magento 2.3 Product Images are not showing on HomePage?

Product images are not showing on home page. I am using porto theme in magento 2. Product images are not showing but when i open detailed page then it will show product images.
0
votes
0answers
21 views

The file was not uploaded in categories

I have this error when I am in the category then I upload an image. My php.ini is fine, the permission on pub/ is set to 0777 then the correct user:group. What I forgot? Tech details: PHP 7.0.33 ...
0
votes
0answers
25 views

How to apply or add store credit balance to customer account programmatically?

Basically I am trying to add or apply store credit balance into customer credit account programmatically. As you can see I have added a couple of images in a particular way to add store credit from ...
0
votes
1answer
39 views

How to hide the category block in navigation on all pages if the user is not a login

How to hide the category block in navigation on all pages if the user is not a login? Also, if a user tries to navigate to a category via a link, it should be redirected to the login page.
0
votes
0answers
22 views

Magento-2 Custom product price not working for multi-shipping checkout

Custom product price not working for multi shipping checkout. Here is my code for the custom product price app\code\Custom\Module\etc\frontend\events.xml <?xml version="1.0"?> <config ...
0
votes
0answers
28 views

Upgrading to Magento 2.3.3 gives a php version error

When I access my website I get the php v error Magento supports PHP 7.1.3 or later. Please read Magento System Requirements. But I have php 7.3.13 What am I missing? I have checked these ...
0
votes
1answer
31 views

Json array element access [closed]

Actually I have an array. that array convert to JSON encodes format. but I can't access all the names from JSON array. now I want to access all the names. Is it possible? [{"name":"JANETS","count":2},...
0
votes
2answers
27 views

Convert php array with indexed format [closed]

This is my array Array ( [JANETS] => 2 [ROYR] => 2 ) I want to convert this format. Array ( [0] => Array ( [name] => JANETS [count] => 2 ...
0
votes
0answers
16 views

Possible that minicart, order summary html file fetch out value by using php?

I need help, I want to make change of this file & the other one for "Order Summary". since I am not family with knockout.js, I am thinking using php to fetch the value that I want. app/design/ABC/...
0
votes
0answers
18 views

M2 - Create function in module

I have a piece of code that I need to use multiple times, but I don't want to get a very long page with a lot of the same code. I have this piece of code: <div class="av-product-specs-list-...
0
votes
1answer
16 views

Load Magento 2 static Block content in external website php file

I have a requirement like below. There is a website which is running in production mode in one server. That has some static blocks. A block is created with some content(Ex:Block_Id: sample_block). ...
0
votes
0answers
7 views

Creating user account programmatically but address form not showing up in Magento 2

Basically I just created an user as showed in an attached image in customers table but the issue is when I click on edit it doesn't show me address form. But I can see Account information which I ...
0
votes
0answers
11 views

Can't find devel package required for Magento installation

I'm trying to install Magento Open from this link. In "Verify installed extensions" it tells me I need to have devel extension to be installed. Here's what I get: sudo apt-get install php7.2-devel ...
0
votes
0answers
6 views

Implementation of the transition to the selected photo in fotorama thumb by link

How to add a checkbox to photos in the admin panel. if the checkbox is selected then on the product page, when click on the link, the gallery with photos will go to the selected photo. How to ...
0
votes
0answers
18 views

How to write an observer with verification of existing id

I have bundle products on which I display selects with some data <?php /* @var $block \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Select */ ?> <?php $_option = $block->...
2
votes
1answer
17 views

How to display subcategory list in static blocks of Magento 2

I am making static block and listing products like this {{block class="Magento\Catalog\Block\Product\ListProduct" template="Magento_Catalog::product/list.phtml"}} but i want to display subcategory ...
0
votes
0answers
17 views

Magento 1.9.4.3 - Print in foreach the columns titles of a table of database

I recreated this question in this section because this is an operation that I am trying to do from the Magento database. So, in my database table "sales_flat_order" I have created 5 columns which are ...
0
votes
0answers
19 views

Magento 2.2.3 List all configurable's childs prices when the configurable's childs are out of stock

For a configurable product, the following code will list the configurable's childs prices only for the childs that are in stock: if ($_product->getTypeId() == 'configurable') { $_children = $...
0
votes
0answers
14 views

Magento 2 - Custom fields save order by admin

I have a custom module in wich I put 2 custom fields in admin using a template. My problem is I can't read the value of this two input fields when the admin presses the button in order to save the ...
0
votes
0answers
16 views

Limit Quantity For the Products With Specific Attribute Magento2

Trying to Limit all the products with having a specific attribute (Yes/No) and others will behave normal. I have used the event in my module my event.xml <event name="...
0
votes
0answers
10 views

Programming fixed product tax (FPT)

I have a PHP script for bulk product upload that parses an excel sheet and uploads products to the Magento database. There's a section to add CRV, but it's not working. I don't get any error messages ...
1
vote
1answer
18 views

Advise on index.php page taking to much resources

Question that I asked the hosting company: admin and website is moving to slow again Reply from them: What hosting has stated: [ We have checked and found that the following page is utilizing ...
0
votes
1answer
19 views

setData does not set attributes values

I am creating simple products and try to set some attribute values $attributeSetId = $product->getDefaultAttributeSetId(); $product->setSku($sku); // Set your sku here $product->setName($...
0
votes
0answers
10 views

Data scaling in magento 2 like integration nosql to load product data from nosql

How we can integrate nosql with magento to load pages data faster than mysql

1 2 3 4 5 66