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
0answers
6 views

How detect mobile in Magento 2?

I can't find the correct code to check if my Magento 2 site is visited by Mobile. These are the two codes that I tried in the header.phtml file in my custom theme but they don't work: $userAgent = $...
0
votes
0answers
5 views

AWS Elastic Beanstalk - Wordpress SEO friendly URL's not working ( with Nginx )

we deployed application with ElastiC Beanstalk ( wordpress ) home page working fine but internal SEO friendly URL not working i pushed .htaccess but then i found its NGINX. any one has any idea why ...
0
votes
0answers
13 views

Extending Error handler using plugin method is not working

I need to save errors in my database. So I am trying to extend Error Handler in my custom module using plugin method. But it is not working. Here is my code di.xml <?xml version="1.0"?> <...
0
votes
0answers
13 views

Duplicate block content

I would like to duplicate the filters block content on layered category pages. I'm using this code : <referenceContainer name="category.product.list.additional"> <action method="append"&...
0
votes
0answers
13 views

Magento 2, export data from magento 2 into a csv file using PHP

I need to export data from magento 2 into a csv file. Data needs to be like this: You see, i want to know what customer ordered what and how much. [Customer];<Id>=10447;<KDemail>=kerstin....
0
votes
0answers
20 views

How to get the deployed version number via PHP?

I need to use the updated deployed version of static files in my module. How could I get it?
0
votes
0answers
9 views

languages switcher redirect random page on mobile

Hi i've a problem on Magento 2. Language switcher only on mobile in production redirect on random page or in 404. In languages.phtml all work fine and urls in browser inspect are correct. In local i ...
0
votes
0answers
14 views

how can i show the textbox value entered on product page to checkout and cart page

In Magento 1 On product page https://prnt.sc/smp14a when someone enters the description I wanted to show the same description on cart page https://prnt.sc/smp8l7 and checkout page how can I do that ...
0
votes
1answer
15 views

Retrieving a Sales Order programatically using OrderRepositoryInterface->getList($searchCriteria)

Unfortunately I find myself in a bit of difficulty. The company I work for has developed a Magento 2 extension that reads data from our proprietary software on a schedule and updates Products/...
0
votes
1answer
35 views

Magento 2 website crash always

Hi today i have noticed my website crashes always . so i have seen many kind of errors in website (An error has happened during application run. See exception log for details. Could not write error ...
0
votes
0answers
12 views

Get product data from Magento2 and push it to googlesheets

Tell me a way how to automatically upload data to google sheets from a CSV file that Magento 2 will create by cron. I have implemented functionality for exporting data from Magento 2 about products, ...
0
votes
0answers
9 views

How to save exception errors in db magento 2

How to save exception errors and syntax errors into database instead of log file in magento 2?
0
votes
0answers
9 views

magento2 Mobie View add submenu in Account menu [closed]

output like account menu inside * my account *whistlish * my order *sing out *reward point
0
votes
1answer
10 views

How to improve the php memory limit in Magento Cloud?

I've installed a Magento Cloud 2.3.5 and I don't have access to the server configuration. How can I configure a new PHP Memory Limit?
0
votes
0answers
5 views

Folder and file structure for state restriction module in Magento 2.3

I am new to Magento and am using the following "how to" guide to create a state restriction module in my Magento 2.3.3 instance: https://www.dckap.com/blog/how-to-restrict-specific-us-states-in-...
0
votes
2answers
14 views

Which method is suitable for showing errors in custom module admin grid magento 2

I need to show syntax errors and unexpected exceptions in my custom module admin grid. Which method is suitable for this in Magento 2. EDIT Instead of save into exception.log file, I need to save to ...
1
vote
1answer
34 views

Magento 2.3.4: Exception #0 Recoverable Error: Object of class Magento\Framework\App\State\Interceptor could not be converted to string

I am employing the code below to check what deployment mode server is on. This is throwing the error. Please point out the issue with the usage of the object $this->_appState to get the the mode. ...
1
vote
1answer
29 views

How to eliminate the decimal point in the product price and add zeros based on the number of digits post period operator?

I need to ensure the product price either gets 0 appended to it with decimal point removed if there is only one digit after the decimal point or 00 appended if there is no decimal point. The logic I ...
0
votes
0answers
10 views

Multible Gift Cards in check out page

I want to give provision for applying multiple gift vouchers to customers. i have this KO template file to apply only one gift voucher code. Now i want to make it to do multiple gift vouchers. I don'...
0
votes
0answers
8 views

Magento 2.3 Catalog Product List widget not pulling user defined field for Number of Products to Display

I have set the number of products to display to 5, however the Catalog Product List widget is displaying all products in the selected category. The "Number of Products to Display" is the only user ...
0
votes
0answers
20 views

Wishlist page layout Magento 2

How would I change the customer wishlist page layout? It's currently in grid, how would I make it a list? Thanks in advance.
1
vote
2answers
64 views

How to find class by function name in PHP class?

For example I have a class A which extends class B and B extends C and so on. Now I can get all the function which is accessible in class A by php function getClassMethods($this); But if I found a ...
0
votes
1answer
27 views

Magento 2.3.4: How to reverse admin configuration settings

In the Magento admin, I had to remove {{depend fax}}<br/>F: {{varfax}}{{/depend}} from all the text boxes under Address Templates under Store->Configuration->Customer->Customer ...
0
votes
0answers
12 views

Programmatically massing create bundle products in Magento 1

1) I try to make bundle products throw php in magento 1 and I dont know how to make it to several or more bundle products(in my code only one bundle product) in one script 2) and can u tell me about ...
0
votes
1answer
20 views

Why is PHP function file_exist() doesn't return FALSE when passed empty file name?

I have a piece of code shown in the screenshot that should check for the existence of a file. I am not sure why file_exists() doesn't return FALSE in case of non-existing files. I passed an empty ...
0
votes
0answers
11 views

Magento 1 does not generate cache in the subdomain

I moved the media, skin and js folders to the subdomain of my site. So now the resources in magento are called with this address: subdomain.mysite.com Everything works and the addresses are taken ...
0
votes
1answer
20 views

What's the advantage of factory classes?

I figured out that magento 2 uses a proxy class which then creates an instance of a class. I don't understand why this proxy class is used, whats the advantage of it? Why not just creating the ...
0
votes
1answer
20 views

Add Notification to Magento 2.3 Customer Registration About Shipping Restriction to California

I want to add a notification that appears on the registration page - only when California is selected as a state. Otherwise it will not display. I am unsure of the parameters. I am using Magento 2.3 ...
0
votes
0answers
12 views

Website showing blank page. PHP Fatal Error: Cannot redeclare pallets()

My magento store was working but suddenly only shows a blank page. Cannot access back-end either. I'm receiving the following error: Fatal error: Cannot redeclare pallete() (previously declared in /...
0
votes
1answer
27 views

How to Use Cookie-free Domains and Expire Headers in Magento Site

Hallow Guys ! I did run speed test on my sites and most of the results shows that "Add Expire Headers" and "Defer parsing of Javascript" "Use Cookie-free Domains " If anyone know kindly help me ! ...
0
votes
0answers
10 views

Override class and inject dependecys

I have following problem. I am overriding \Magento\GroupedProduct\Block\Product\View\Type\Grouped with this way: First i override it in the di.xml <preference for="Custom\Class\Block\Grouped\...
0
votes
0answers
19 views

Where can I find information on product attribute input types

I'm relatively new to web development, I've been using Javascript, html and css for about 80 or so hours, and I'm getting my feet wet with PHP now, so I'm sorry if this seems like a stupid question. ...
0
votes
1answer
48 views

Smartwave porto cart icon need to change

I have tried to change the code in _mincart_lesss but cart is not changed in website.Any one can help me on this?
0
votes
0answers
31 views

Magento 2 In Stock Out of Stock not changing CSV

I am really stuck on this issue - I have a Magento 2.2.2 store and trying to use default import/export and also other extensions for importing and updating stock and qty. However I have found that ...
0
votes
1answer
21 views

How to set color to a Smarty variable?

I got a piece of code as seen in the image below in a Smarty template outputting the payment method. Please help me a find a way to set color "red" only to the value of "{$search_results_list[...
0
votes
2answers
417 views

Wrong file in vendor/magento/framework/Image/Adapter/Gd2.php:64 when i install magento 2.3

Please help me. It's displayed below error when I have cloned and installed Magento 2.
0
votes
1answer
26 views

How to convert array values to string format

I have the input array in following format: "123,46,78,000"; But I need it in this format: '123','46','78','000'; can any one help me?
0
votes
1answer
29 views

Custom Creditmemo Plugin not getting called in magento 2

I have created extension attributes which i would like to use in my custom plugin.I want to call this plugin when after credit memo item is saved which happens when credit memo is saved(refund) But my ...
0
votes
1answer
21 views

Adding slick carousel to Magento 2 homepage

I'm having an issue with what I think should be a basic thing but I'm obviously doing something wrong, all I want to do is have a basic banner slider using slick slider jquery plugin. I have a custom ...
0
votes
1answer
24 views

Magento module stopped working after PHP update

A Magento 1.9 website worked perfectly with PHP 5.6.40, but the server (which I don't have access to) was upgraded to PHP 7.1 and the custom contact forms stopped working. It does not give any error, ...
0
votes
2answers
32 views

Magento 2.3 - Error related to Amasty shopby while RUNNING setup di:compile

MiBPHP Fatal error: Declaration of Amasty\Shopby\Model\Source\Attribute\Extended::toOptionArray() must be compatible with Amasty\Shopby\Model\Source\Attribute::toOptionArray($boolean = 1) in /...
0
votes
0answers
24 views

Fetch products from category using elasticsearch

<?php namespace Magento\FetchProductsFromCategory\Model; use \Magento\FetchProductsFromCategory\Api\ProductInterface; use \Magento\Framework\Exception\NoSuchEntityException; class Product ...
0
votes
0answers
29 views

How to redirect from payment gateway to success page using the callback URL in Magento 2.x

I had integrated the Razorpay payment gateway in my Magento site. It's working absolutely fine on the web and mobile browser. But when I try to make the payment using in-app browsers (from Instagram, ...
0
votes
1answer
35 views

Cron Jobs and Cron Group Misunderstand

I am a newbie in Magento and I want to understand the Cron Jobs, please. If I want to create new cron job inside default cron group, but I want to set different schedules time for it, is it possible ...
0
votes
0answers
12 views

After updated magento1 to magento 2.3 having product link with category suffix

Recently i have upgraded magento1.9 to magento 2.3.1 everything is working fine no problem at all. But now when i try to add a product and open in frontend i am having category suffix in product url. ...
0
votes
0answers
18 views

Configurable product does not change the price at the front when choosing a product

My pricing template: /vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml My custom js file: /app/design/frontend/[Vendor]/[Module]/Magento_Catalog/web/js/...
0
votes
0answers
11 views

how to display subcategories on a mobile device

On the desktop menu, there is the opportunity, when hovering, to see subcategories for this written custom mega-menu, but the dropdown functionality has disappeared on the mobile, I have a new ...
0
votes
1answer
20 views

Get the Email response after send an email using php

Can anyone help me how to get the sent email response of shared content. $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $from = 'From: yoursite.com'; $to = '...
0
votes
0answers
9 views

Show shipping rates on product page - strange behavior using table rates

I use table rates shipping method based on product weight. Magento 2.2.8. I need to print the available shipping rates for the current product on product page. The following is the table rate: The ...
0
votes
1answer
23 views

Magento2.3 Hide new address form button on checkout page based on customer groups

I want to hide this new address button based on customer group. I want to use conditions for hiding that button. If anyone knows please let me know. Check this still loadind and console.

1
2 3 4 5
67