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.

3
votes
1answer
26 views

Magento 2 : Search For Admin Menu Items

In magento2 admin dashboard , We have an option for Search. When we search for "rma" for example it is showing "rma in products" , "rma in pages" etc but I need to know if rma found in any of the ...
1
vote
1answer
59 views

Admin Product View Page Error on Sort Magento 2.3

I am attempting a simple task, to sort the product filter in the admin panel page but I am receiving the error: Something went wrong with processing the default view and we have restored the filter ...
-1
votes
1answer
38 views

Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in

Magento 2.2.5 version. Every time trying to go to product page I get error: Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in /var/www/html/app/code/MGS/Mpanel/Helper/...
2
votes
2answers
46 views

How can Select arrays from associate array in php on the basis on element [closed]

I have an array "$arrItems['items']" in which 5 more arrays(associate array) and each array contain 5 element(f_name,l_name,contact,address,seller_id). Actually I want to get all those arrays(from "$...
1
vote
0answers
20 views

Call to a member function getQuote() Error

Out of no where I am receiving this error within my one page checkout. When I went check the PHP file this file was not in the folder. I uploaded a new file and I am still getting this error. Does ...
1
vote
0answers
16 views

Magento 2.1.1 Check Component Dependency

I am getting Check Component Dependency which is showing many issues. See below. But.. my PHP version on the webhosting is 7.0 and in the Magento Setup Pgae showing 5.6.19. how it comes? Please ...
0
votes
0answers
70 views

Currency update error when updating with currency converter api

When I try to update the currency rates with the import service Currency Converter API in Magento 2.3.0, I get an error as follows: Notice: Undefined index: USD_BRL in vendor/magento/module-...
1
vote
0answers
23 views

Magento 2 - How to add a background image for each category from a category attribute

I am working with Magento2 2.2.7 CE I am Looking into the possibility of trying to set a page background image for each category. I am aware that I can setup category attributes through the setup ...
0
votes
2answers
54 views

Magento 2.3 - Product stock alert not display

I use Magento 2.3 and I create a custom theme based on Luma theme. I enable the Magento_ProductAlert module from backend but the message "notify me when this product is in stock" is not display in ...
0
votes
1answer
24 views

How to define constants or environment variables in Magento 2.2.6?

I want to define constants to use in all my project. How to define constant or environment variables to access all over the project without any special declaration ?
0
votes
2answers
35 views

Magento 2 - Get data attribute value and check if has value per product

I create one custom date attribute for my products in backend: I need to get the attribute value in the products list page and to check if the product have any data added for the product. I try ...
1
vote
0answers
16 views

How many ways are there to create a controller and what are they?

I have been developing with Magento 1.9 for the last two weeks. I have found several problems to develop each project (probably because my first project with magento had a high level...). I come ...
2
votes
0answers
23 views

How to create a custom payment method module

I was trying something new on the payment method where people can upload receipt and it will appear in backend I was thinking about editing the amazon pay and put my own code to it ,I am totally new ...
1
vote
1answer
96 views

Magento 2.3.0 - Can't login to admin

I can't login to admin panel on Magento 2.3.0 version. After I press Sign In button I have this message: "Invalid Form Key. Please refresh the page." and in the system.log file I have this: [2019-02-...
1
vote
2answers
113 views

Magento 2 - Get country name from country code

I want to get country name from country code, in Magento 1.9 I use the code like this to get country name: $countryCollection = Mage::getModel('directory/country_api')->items(); foreach($...
1
vote
2answers
49 views

Magento 2 run custom PHP script

I want to run a custom PHP script in Magento 2 webshop using a custom module. But I want it to run only when installing or during installation of my custom module. To be specific, during ...
0
votes
1answer
155 views

Magento 2.3 Very High PHP-FPM CPU Usage

Using Magento 2.3 and after some extensive digging, it seems that either fotorama or another that loads the images on product list and product page runs several instances of PHP-FPM all at high usage, ...
2
votes
0answers
52 views

PHP Fatal error: Cannot declare class Zend_Mail_Message after composer update Magento 2.2.7

Does anybody know how to fix this? When running the index PHP Fatal error: Cannot declare class Zend_Mail_Message I already tried Deletion of cache, redis, generated folder etc Setup upgrade and ...
1
vote
0answers
13 views

Cannot make transaction paypal magento

I am trying to check out through paypal, I have put all the details in the paypal configuration in magento like username password etc. The issue is when i login through paypal and then click continue ...
1
vote
1answer
42 views

Customer edit tab showing blank page

I am getting this error in my logs PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with ...
2
votes
1answer
21 views

CSS and JS Files Not Found Magento

Magento CSS and JS files are not found. I have just installed Magento 2.3, The issue is that the JS and CSS files are not located at what they are supposed to be and because of that i am getting not ...
0
votes
1answer
44 views

Contact Page URL Change: Magento 2

I have tried to changed the default URL of contact page in magento2 to my custom URL but it is not working at all. I have tried as follows: Put the following code in my custom module.xml <config ...
0
votes
1answer
52 views

How can I edit files like frontend/…/category/view.phtml?

I have been trying to edit some files from the frontend folder. On this folder I have the following folders: base, default, rwd and typologancee. I have to create a specific filter which is going ...
0
votes
0answers
30 views

Multi website languages switcher, how to show flags?

How to show flags in this code? <?php $stores = Mage::getModel('core/store')->getCollection()->addFieldToFilter('is_active', 1)->addFieldToFilter('store_id', array('neq'=>0));?> <...
0
votes
1answer
21 views

Invalid Argument Supplied for foreach() in /…/Importblock.php on Line 67

I am using a theme and trying to import blocks has this warning popup: Warning: Invalid argument supplied for foreach() in /home/pluslivi/public_html/app/code/Rokanthemes/RokanBase/Controller/...
0
votes
0answers
14 views

Intercept any exception

how are you? So, I've been work in integration between Magento 2 and Microsoft Azure Application Insights to log the errors. There is the possibility to listen to all the exception that can occur in ...
0
votes
0answers
35 views

How to get loggedin user session in magento

I created a module,that show list of user . I want to show that page to any user who is logged-in magento2 admin panel // world.php <?php namespace Pulsestorm\HelloWorldMVVM\Controller\Hello; use ...
1
vote
1answer
48 views

Magento 2 - looking for faster and better way to deploy static content

I am using a multi store setup with Arabic and English and everything is working well including building modules and template building. However, if I make a change to any less file or JS file (...
1
vote
0answers
45 views

Magento 2 - Event dispatched when user click “Proceed To Checkout”

What is the name of the event that is dispatched when a customer clicks on "Proceed To Checkout" after adding stuff to their cart? I want to register that a user started a checkout process for ...
3
votes
1answer
37 views

Memory limit set to -1 is the good approach?

In one of my custom script a memory exhaust issue showing.so i did set memory_limit to -1 now it is working fine.But is this the good approach to do this or need to increase the size of memory_limit ...
0
votes
0answers
18 views

What Is Use Of Update Wishlist Button in Magento 2?

I Have an issue in this functionality. When I have Click On It But No Effect on any Product of wishlist
0
votes
1answer
29 views

Why does this require “..path” is returning a fatal error (PHP)?

my question is simple but I have not found a form to solve it. I am trying to include a library located on the magento's module which I am developing. $simple_excel_path = Mage::getBaseDir('code')."/...
0
votes
2answers
60 views

Proper way to call a model constant in Magento 1

I have the class below: class Company_Module_Model_Somemodel extends Mage_Core_Model_Abstract { const SOME_CONST = 'constant_text'; } What is the proper and correct way to call the constant ...
1
vote
1answer
32 views

Invalid method Magento\Framework\View\Element\Template::showCaptcha

I am having problems to show my captcha in my form. I have my showCaptcha function declared in Block directory, but it keeps me showing the next error , can anyone please help me?: here is my block: ...
0
votes
0answers
36 views

How to remove /magento2/ parameter from URL?

Current URL : http://localhost/magento2/rest/V1/products/options/types I want to use without /magento2/ i.e. http://localhost/rest/V1/products/options/types I am using XAMPP server with ...
0
votes
0answers
8 views

Transfer Customer Data From Custom System to Magento2, possible?

I know there's a way to transfer data from Magento1 to Magento2 but I'm interested if there's a way to transfer data from custom system to Magento2?
0
votes
0answers
47 views

Export Category name in xml feed Magento 1.9.2

I have the script below for exporting product xml feed for magento 1.9.2 The problem is that I cannot export the category name for each product The scipt is: require 'app/Mage.php'; Mage::app(); $...
0
votes
0answers
71 views

Magento 2 - (Shipping Address) Custom city dropdown validation not working in checkout page

I followed this link. I created a custom shipping method and I need the city to be required for my shipping rates to be calculated. My problem is my shipping-rates-validation doesn't get trigger it ...
0
votes
0answers
29 views

Magento 2.2.5 Class 'IntlDateFormatter' not found

I'm running ubuntu 18.04, using php7.0 and i get this error even though i installed all the extensions while installing magento, is there anyway to fix this, php -i | grip intl shows /etc/php/7.0/...
0
votes
1answer
51 views

Magento 2 - Add subcategories images in Top Navigation Menu

I want to add subcategories images in Top Navigation Menu, I found this module but display only parents categories, I need to be on subcategories. I want to be like this:
7
votes
1answer
126 views

Why does adding constructor parameters require my to clear /generated

I'm using Magento 2.2 in development mode. I have a controller class class MyController { public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\...
0
votes
0answers
9 views

Magento 2 user field validation using an API

In a dedicated data table where we stored customer's privilege card number in order to validate them with users that they enter to a field called "privilege card no" On such an occasion I'll have to ...
0
votes
1answer
18 views

What are the preferred server resources needed to run a magento 2 ecommerce site? php memory limit, virtual and physical memory? ,

When updating magento to 2.3, warning was given to set php memory to a minimum of 2048. Wondering what the preferred settings/resources are and if hosting on a shared server is fine.
1
vote
0answers
43 views

How to create a custom discount “Gift card” in Magento 1.9 at cart page

The functionality will be = Enter Gift Card number(16 digit) Enter Gift Card Pin(6 digit) Enter Amount(amount entered by user) I have already created the above mentioned input fields in the cart ...
0
votes
1answer
29 views

Migration from 1 to magento 2

I am trying to migrate a magento 1 to magento 2. Both database are on my local system. When I run the migration tool I don't get any error messages but when I check the products in the magento 2 ...
0
votes
1answer
74 views

Magento 2.3.0 - Create Product Page H1 title with product name and attribute name

I have created two phtml files that can be called from within a CMS Block on a product page to echo the product name and an attribute name. As follows: Product Name {{block class="Vendor\...
0
votes
0answers
9 views

Magento 1.9.2. - foreach remove duplicate from options attribute value

I'm pulling out all the values ​​of the color attribute of the products associated with the product configurable with this foreach. foreach($simple_collection as $simple_product){ echo $...
0
votes
2answers
98 views

Magento 2.3.0 - Add custom block after product description tabs

I've created a CMS block called km_product_page_short_description I want to call this CMS block in a custom block below the product description tabs (where the blue line is) as shown in the ...
0
votes
2answers
109 views

How to use require_once in magento 2

I'm trying to include a PHP class in magento 2. I use a require_once and create a folder lib in the root of my module and there I put the folder that contains the class lib/Meli/Meli.php Also try in ...
1
vote
0answers
12 views

Sub Category - Load By Attribute (name) URL issue, how to resolve?

Mage::getModel('catalog/category')->loadByAttribute('name', $val)->getUrl(); The above code won't work correctly in my PHP code when I have multiple categories & sub-categories with the same ...