Stack Exchange Network

Stack Exchange network consists of 174 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
Make your voice heard. Take the 2019 Developer Survey now

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
2answers
3k views

Magento 1.9 : Getting customer information on magento success page

How can i get the both guest and registered customer details such as Firstname and Telephone number on success page ? I am having order# on that page, So can i get the customer information from ...
3
votes
1answer
834 views

Magento2 site is not loading properly

I have Magento2 site. When I load first time in the browser it's not loading. Complete and show javascript error in the console but when I refresh, it shows correct? What is the issue in Magento 2
0
votes
1answer
776 views

Custom extension not displaying additional fee in admin order view page

Hello there dear community. I am using Magento 1.9.0.1 and i'm currently developing a custom extension and i am stucked at the admin order view page. Let me describe my problem with images so you ...
0
votes
0answers
22 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
12 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
2answers
48 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 ...
2
votes
2answers
2k views

Widget Frontend Display

I managed to develop a custom widget, the problem is that its not displaying in the frontend. The goal is to add the widget to a static block and then display the block in frontend. I created the ...
1
vote
3answers
1k views

Custom cron job status always pending

I created a custom cron job in my custom module. But, when I check the cron schedule, it's all in pending and don't work at all like in the picture below. Does that mean there's error on my cron job? ...
0
votes
0answers
8 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/...
2
votes
2answers
1k views

Warning: strlen() expects parameter 1

Im constantly seeing the following error in system.log I've gone into the file but cant see anything wrong can any one help me? Warning: strlen() expects parameter 1 to be string, array given in /...
-1
votes
0answers
15 views

How to pass the shipping and order data to another url after payment [on hold]

We are using Magento 1.9.2 in our website. How to pass the order data to another url after placing the order?
1
vote
1answer
805 views

How to get Product Target Path programmatically in product edit page

I'm trying to get the latest Target Path to show up in the backend of Magento in the product edit page. I've tried everything I can think of to try to get it but I usually get NULL. I've managed to ...
0
votes
0answers
40 views

Quantity not getting validated (the way it should) for numbers between 1 - 9

I have problem with quantity increments, unable to increase the quantity for a product in the cart by increasing the quantity number in the input field, the input field for quantity does not seem to ...
1
vote
1answer
821 views

get category image

I am trying to fetch category images next to product title. Problem is that below code works weird. I am able to get url of image, but sometimes url is not reachable therefore img will not show up. ...
0
votes
1answer
41 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:
1
vote
4answers
933 views

how to fix php curl extension error while installing magento 2

How to fix php curl extension error while installing magento 2? I attached the Screenshot
0
votes
3answers
110 views

Display a custom attribute below product name in the front-end Magento 1.9.3.8

I need to display a custom attribute bellow the product name and I don't know how can I call this attribute. I am editing the file /app/design/frontend/templatemela/MAG100219_1/template/catalog/...
6
votes
10answers
25k views

Magento Redirects to Old Website regardless of what changes are made!

We are having the strangest Redirection problem on a Magento site. We copied the sites contents from another Magento site to a new URL. We have done this in the past with no problems but for some ...
5
votes
1answer
89 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
7 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 ...
2
votes
2answers
924 views

Php max_input_vars prevents attribute options saving in M2

Magento 2.2.1. PHP 7.0.26 Nginx After 2 days struggling around with attribute options in M2, I found out where the problem was. I have several custom dropdown attributes with hundreds of options. I ...
0
votes
1answer
14 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.
0
votes
1answer
87 views

Magento 2.2.6: Error after upgrading to Magento 2.3.0

Just updated from M2.2.6 to M2.3.0, everything seemed to go without a hitch, but after loading the front-end of the website I'm seeing the following error: Exception #0 (BadMethodCallException): ...
1
vote
2answers
812 views

magento 2 Error: cannot call methods on priceBox prior to initialization; attempted to call method 'option'

I am having an issue on my website the issue Error: cannot call methods on priceBox prior to initialization; attempted to call method 'option' My website https://www.cartaroo.com.cy/?...
0
votes
1answer
832 views

Magento 2 - invalid form key (add/delete from cart)

I have serious problems with custom Magento 2 theme and (probably) formkey cashing. I have 2 views of exactly same e-shop. - View 1: Luma Theme - View 2: Custom Theme (Luma child) - overriding ...
0
votes
0answers
27 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
21 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
26 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\...
1
vote
2answers
55 views

Magento 2.3.0 Get product attribute name in phtml in CMS Block

I have a attribute called Artist It has several artist names XYZ ABC RST I need to be get the artist name associated to the current product page via a call to a phtml in a CMS Block. What do ...
0
votes
2answers
38 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
0answers
8 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 $...
1
vote
2answers
940 views

How to get Custom HTTP header in Magento2 controller?

I'm accessing my controller via postman tool (Postman) I've passed custom header as shown in image and trying to access it in controller through this code: $this->_response->getHeader('APP_ID'...
0
votes
1answer
13 views

How to catch exeption in unit test and check it

I have a model class, that throw exception if some value is null. How I can test, that it condition is ok. $contact = $this->contactFactory->create() ->setEmail('testdelete@...
1
vote
4answers
142 views

Magento 2.2: Weird $_files array after image upload

currently I'm trying to develop an image upload in the Magento admin area with ui components. My fieldset declarations looks like this: <fieldset name="slide"> <argument name="data" ...
2
votes
0answers
406 views

Magento related products get category

I want to edit my /catalog/product/list/related.phtml file. I want to define all related products based on their main category. So for example that all mices are displayed in their category "Mices" ...
1
vote
0answers
9 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 ...
0
votes
1answer
19 views

How to get products from wishlist using customer id

Magento 2.3 PHP 7.1 I trying to get products from customer wishlist in Model but $products array is empty. $products = []; $items = $this->wishlist->loadByCustomerId(1, true)-&...
0
votes
1answer
33 views

Magento 2: Get Order Info From Invoice

Using Magento 2.3, I'm trying to get a custom attribute from the order and save it to the invoice when the invoice is first created. I already have the custom attributes setup and saving to the ...
1
vote
2answers
94 views

Magento 2: Custom Customer Attributes Showing in Customer Grid but Not Admin Account

I'm currently on Magento 2.2.6 and I created a multiple select attribute as well as a yes/no attribute for customers in the admin page, however I'm not seeing them show up and not sure where I went ...
0
votes
0answers
11 views

How to edit category in Magento 1 using PHP using path (Not ID)

I need to be able to revise Magento 1 categories externally. When products are created using Magmi it creates the category, during the process, I store the path used to create the category. I want to ...
0
votes
1answer
953 views

Slick JS dose not work on magento 2 when loaded from require JS

There is no error in console and when I tried to put the log "Slick is on "on the on-init function, it displayed correctly. My theme require-config js : var config = { deps: [ "js/mainsite", ...
0
votes
1answer
893 views

Allowed memory size of 536870912 bytes exhausted

Got a php error, Allowed memory size of 536870912 bytes exhausted. It is quite strange, because I created a php info file to check the settings. The setting of the server is memory_limit 12288M (...
1
vote
3answers
50 views

Fatal error: Uncaught TypeError: Argument 1 passed to

I just cloned a project from git, everyting ok, when i enter to a module name kardex i found this error, the thing is that this error only appears to me in my project, not happen in another cloned ...
1
vote
2answers
623 views

Magento 2 get and set Qty of product with observer

I tried my code below to get Qty from observer when a page loaded : Observer : public function execute(\Magento\Framework\Event\Observer $observer) { $collections = $observer->getEvent()->...
5
votes
0answers
531 views

How to add custom customer attribute in custom tab in customer edit page of admin in magento2

I have created custom customer attribute successfully. Which are showing under account information tab of customer edit in admin. I want to show them in my custom tab.
1
vote
1answer
16 views

Magento 2: Admin user with restricted access can access everything via API?

I have created an admin user to manage my orders and granted the access for order view action only. (as below) But the user can generate token via API and access all order i.e view, delete, etc ...
0
votes
1answer
904 views

Magento - How to restrict customer can buy only one product for specific category

I am trying to add free product for specific category, Customer can add only one free product in the cart for specific category. I tried to add shopping cart price rule as Condition: If total ...
3
votes
1answer
475 views

Not able to place the order using paypal in magento 2 rest

I am developing an e-commerce mobile application using Magento 2 rest APIs only. This is the flow for making the REST API calls for order placement. 1.Create a cart api -->{{url}}/index.php/rest/...
0
votes
3answers
183 views

How to get some store information in my Magento 1?

I got the following two statements for my dutch store (Magento 1.9.3.4), with the following issues: <?php $_BaseUrl=Mage::app()->getStore()->getHomeUrl() ; ?> With this statement I am ...
5
votes
5answers
5k views

Fatal error: Uncaught Error: Class 'Cli' not found

Someone changed my php version for my magento 2 website to 5.6 and I changed it back to 7.0 and now I'm getting this error when I try to run the major magento commands such as compile and system:...