Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [php]

This tag is used for questions which 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.

1
vote
3answers
66 views

How to make a Field only accept Numbers in Magento 2

I am new to Magento 2. I am trying to make a field that can only accept numbers for Sort Order field on UI Component Form I need help
0
votes
1answer
33 views

Change Email Template On Specific Order Status:Magento2

I am trying to use different e-mail template for one of my custom order status when the status is changed from the admin. I have used the event sales_order_save_after <observer name="...
0
votes
1answer
20 views

Fatal error: Class 'GT_Speed_Helper_Data' not found

I am trying to install the GT speed extension in magento 1.9.3. It is working fine on staging server but on live it is giving : Fatal error: Class 'GT_Speed_Helper_Data' not found in I have ...
0
votes
0answers
31 views

Php Mysql one table username where password length is 60 what md5 or function don't know [on hold]

Php Mysql one table username where password length is 60 but i dont know what is function length is 60 . and i forgot my password. so my question is like i have created new user but which function ...
0
votes
1answer
29 views

How do I send the data from a form to my company mail?

I want to make a form for users and in that form i want to be name, tel and email. And i want to make a script that should take the name, tel and email and sent to my emai. But i don t know how and ...
1
vote
1answer
22 views

magento 1.10 unable to upload image

I have tried to save the image in product page in Magento 1.10, but give me this type of error: jquery this.images.toJson() not a function. Please See this screenshot Please help me find the ...
1
vote
0answers
23 views

AJAX call returns the same page html

I have a module that I need to do a php GET action and get some informations from php file. The problem is that the returned value is the Dashboard html. Faturamento/Controller/Adminhtml/Ac/Index....
1
vote
1answer
36 views

Mageplaza menu does not shown on Sidebar [closed]

I just started to learn how to use Magento 2, I have just installed it on my local laptop. The instalation has been successfully completed and then I decide to install SMTP support for email ...
0
votes
0answers
8 views

How to remove search filter if table empty in datatable

I am using Datatable to show my data. But sometime in the resultant table don't have rows then it is showing No data available in table, but also showing "Search filter & paging" but if there is ...
3
votes
1answer
19 views

Magento 2 Warning imagecreatefromjpeg error

I am getting issue regarding Magento 2 Installation and still don't get any solution about it. I am installing Magento 2 using docker-compose but I keep getting following warning: [Progress: 419 / ...
4
votes
2answers
48 views

Menu that open by itself after clicking on the link of a parent category

When I click on parent category, the page load but the menu re-open if the pointer of the mouse is still present. What do you recommend so that the menu does not re-open immediately ? I found PHP of ...
0
votes
1answer
21 views

magento 2 print array in block function

I am using Magento 2. I made a small mistake unfortunately i am unable to find Index.php public function getBannerCollection(){ $collection = $this->_bannerModel->getCollection() ...
1
vote
0answers
37 views

Wrong image path after migration from 1.9.4 to 2.3

I have an issue about the image URL after a migration from Magento 1.9.4 to 2.3. I have some products images which are displayed and some which are not. Then I found out the reason which is due to ...
1
vote
0answers
16 views

Magento 2 : How can we identify phpexecutable or not?

I'm working on creating custom console in which i have to add code that will check php is executable using below class. If PHP executable then which PHP version is executable. SyncCommand.php ...
2
votes
1answer
23 views

Magento 2 - Order best sellers products by period

For now, I'm getting my best sales like this. I would like to be able to influence the order of my products in the collection. In my Block : use Magento\Sales\Model\ResourceModel\Report\Bestsellers\...
1
vote
1answer
33 views

How can I add custom product link in Magento 1?

Let's suppose I want to add a custom link to my product in M1, is there a way to do that? These products would be linked to an external site. I have two buttons on my website - Buy Now And Add to Cart....
2
votes
2answers
78 views

How do i create a shipment class object in magento 2?

i am trying to get tracking from csv and save to magento 2 order programmatically. i grabbed the create shipment & add tracking code from here https://www.scommerce-mage.com/blog/magento-2-how-to-...
2
votes
1answer
36 views

Add custom block under selected shipping methode magento 2 not working

I am creating a magento2 module and I want to add an html block to selected shipping method: I am using jQuery to achieve this but I will accept other workarounds all I want is to make this work. I ...
0
votes
1answer
37 views

I want to use php scandir in a phtml

I want to use this in a phtml: <?php $kataloge_dir = '../media/downloads/dlbereich/kataloge/'; $kataloge = array_diff(scandir($kataloge_dir), array('..', '.')); $kataloge_thumb_dir = '../...
1
vote
2answers
38 views

Parsing Shipping API Data in Magento2

I am implementing my own shipping API integration in magento2. I am able to get all the details finely. But all of sudden it is giving an error as follows. Exception #0 (Exception): Notice: Undefined ...
1
vote
2answers
25 views

magento 2 add unique key on multiple columns using installschema

Here i am trying to create unique key using installSchema . Array of column names is defined here on which columns combinedly i want to apply unique key $arrayOfColumnsName = array('column1', '...
0
votes
0answers
6 views

Mysqldump return empty file .sql [migrated]

I'm try to do a dump of my db in this way: $output = NULL; $command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql'; passthru($command, $output); I've tried in this way too: ...
0
votes
0answers
15 views

Magento 2 custom indexer (update by schedule) does nothing?

On the admin UI it says that it last updated the last minute (every minute). So it's updating every minute, but, the execute method is not called and I don't see my table in the database changing. ...
0
votes
2answers
73 views

How to get data from custom shipping method in javascript Magento 2

I am making a magento 2 module, and I had to create a custom shipping method but I am not able to get the data of fields in the checkout page : This is a part of my system.xml file <...
1
vote
0answers
24 views

Adding/Remove 1 Hour from a line that references date (PHP)

I'm attempting to debug a Timezone issue in a custom Magento module. One of the tests I would like to try is to ADD/REMOVE 1hr from whatever is output from this line of code. I suspect ADDING 1hr ...
0
votes
0answers
16 views

image get hide behind content in mpdf8 [migrated]

I am adding image on existing pdf overlay on one box. here is my code $sign .= '<img style="height:'.$coordinates_eqv[4].'px;width:'.$coordinates_eqv[3].'px;margin-left:'.$coordinates_eqv[1].'px;...
0
votes
0answers
10 views

M1 unexpected T_RETURN, expecting T_FUNCTION

a have a problem after installing an extension. I get this error: Parse error: syntax error, unexpected T_RETURN, expecting T_FUNCTION in blablalbala/Autoloader.php the code in that file is this: ...
1
vote
0answers
38 views

Magento 2: Column is exists but throwing Column not found: 1054 Unknown column 'so.event_id' in 'where clause' while inserting into sales_order

I have event_id column in my sales_order table. I want to place an order & I am not sending event_id because its zero by default. When am trying to place an order, Its throwing me the error Column ...
0
votes
0answers
27 views

magento 1.9: stop newsletter spam with CURL

I have added this module in Magento 1.9 for stop spam in newsletters. https://magecomp.com/magento-google-recaptcha.html This worked fine but, when I try to sign up for the newsletter via curl it ...
1
vote
1answer
49 views

How do i get category ID in final_price.phtml and hide price accordingly in magento 2

this is my current final_price.phtml file. the line $category = $product->getCategoryIds(); is causing error I'm trying to get the category_id of the current product, and check if it's in $...
1
vote
1answer
26 views

Magento2.3 display images of a category in .phtml

I have a block that returns a category by its ID. I loop on the category's children and I would like to be able to display their respective images and names. for the moment I can display their names ...
1
vote
0answers
13 views

Magento2 error while extension installation in create backup step

In my magento2 store I want to install the extension. I have tried this via composer as well as admin extension manager. Every time the process failed in Backup stage after generating the 4Gb of data ...
1
vote
1answer
22 views

Magento 2.3: How to Create Order Using Braintree Vaulted Card

I'm trying to create an order programmatically using braintree payment method and the customer's saved credit card. // prepare adresses, products in quote, shipping method - skipped $quote->...
2
votes
1answer
25 views

Increase number of shown related products in the administration (Magento 2)

When you edit a product in the magento administration the number of items listed in the related products, up-sells and cross-sells list is limited to 20. Also there is no possibility to change this ...
1
vote
1answer
22 views

How to load all products with certain type - e.g. all configurable products?

How can I get a collection of all products from a specific type example given: "configurable" ? I want to show the name of all products of type configurable for example.
1
vote
0answers
23 views

Magento2 : Undefined Index amount in Order/Totals/Tax.phtml file

I installed one GST module on my local instance. after installing that module i am unable to create invoice for sales order. Getting the attached error message.I disabled all my third party extensions ...
0
votes
0answers
50 views

Save Button Not Working in Admin Form Custum Module Magento 2

I am Working on A magento 2 custom Module i have a Form as well a Product Grid in my form so i created tabs using block but Whenever i click on save button gives me Javascript Error TypeError: $....
2
votes
1answer
40 views

Getting a CLI error when trying to compile

I am getting this error on terminal: PHP Fatal error: Class 'Cli' not found in /opt/bitnami/apache2/htdocs/bin/magento on line 31 when trying to run these commands: sudo php bin/magento setup:...
2
votes
2answers
33 views

Magento2 Shipping City For Shipping Amount Caluculations

I need to apply table rate shipping based on following conditions City to City Metro to City Metro to Metro City to Other City to Special Locations I written my own module but ...
0
votes
0answers
11 views

How can I return custom products to catalog search result in Magento 2?

I am developing a custom search engine for my Magento 2 store. How can override the products returned in catalog search result with a custom plugin ?, and Can I override the result without changing ...
0
votes
0answers
18 views

Getting error after adding config in Magento 1.9.3.6

I did not work with Magento before. For the purpose of a new task(migrate data from Magento to some other system), I created a new fresh installation of Magento. Following docs, I installed sample ...
1
vote
1answer
31 views

Magento 2 in default newsletter subscribe not working?

I will attached the phtml and php block code but client side mail does not send? subscribe.phtml <div class="block newsletter"> <div class="title"><strong>Newsletter</...
2
votes
0answers
87 views

Magento EE: session_start(): Unable to clear session lock record

Magento Enterprise Edition 1.14.0.1 PHP 7.2.15 PECL memcached extension 3.1.3 We encountered this problem upgrading Magento EE from PHP 5.6 to PHP 7.2. We do not see the problem using the memcached ...
0
votes
0answers
17 views

Magento 2: Wrong product thumbnail image on search results page

I've noticed in both the backend catalog search and frontend search that incorrect product thumbnail images are being displayed for certain products if they do not have an image associated with them. ...
0
votes
1answer
29 views

Layered Navigation accordion not working

I have created a custom theme. Which is extended from blank theme. In the catalog page, there is no accordion. All filter fields expanded automatically. I am using Magento 2.3
1
vote
1answer
27 views

magento 1.9 soap api error

When I try to connect to magenento api through soap with this code: //soap call test $client = new SoapClient('https://magentohost/api/soap/?wsdl'); // If somestuff requires API authentication, /...
2
votes
0answers
23 views

File Upload Error in Magento 2

I written custom module to upload bulk import of products with error report. Here is the code I am using to move CSV file to particular location. I am getting error always saying that "Uploaded ...
0
votes
1answer
21 views

How to pad string before other string in php?

I am using magento 2.2.6. I am showing the amount in particular column. of my custom page. E.g CASE - A I have amount say, $100.50, I want to display amount in the following format: 00010050 (here ...
0
votes
1answer
43 views

Clearing database logs in Magento 2

We've recently migrated from Magento 1 to Magento 2 and it seems that there is a large amount of information in our database files. We'd like to try to mitigate this by clearing the log files but ...
0
votes
0answers
21 views

How to use CMS and Category Tree Multiselect Fields in Block Form Magento 2?

I want to Use All CMS pages and All categories Multiselect in My Block Form. I have already created form.php in Vendor\Module\Block\AdminHtml\Grid\Edit protected function _prepareForm() { $...