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.

0
votes
2answers
1k views

Product image not showing in Magento

I have a specific product and its image is not shown in the front-end. In the admin panel in Catalog->Manage Products->Images I can see all the images of its configurable product. So I don't ...
0
votes
1answer
1k 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 ...
3
votes
2answers
856 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
3
votes
1answer
39 views

Move block inside another block

I want to put the header.links into another block. this is the icon.phtml file: <div data-block="dropdown" class="minicart-wrapper"> <i class='fas fa-user-circle action' data-trigger='...
0
votes
1answer
179 views

How do I provide a valid OAuth/NLAuth authorization header for NetSuite?

Being new to NetSuite and Post Man, I wanted to get my very first RESTlet up and working using Token Based Authentication which I have already set up, therefore I have: Account ID Application ID ...
0
votes
0answers
12 views

magento 2 getting error on update product action in admin panel

I am getting the below error in the magento admin panel while editing the product options from the action dropdown. Catalog - products. Select a product or 2. Then actions menu select change attribute ...
0
votes
1answer
671 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, ...
1
vote
1answer
37 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->...
1
vote
1answer
1k 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. ...
-1
votes
1answer
26 views

Array Get Value in magento2

i want to get profile id from this array [2019-05-21 07:30:24] main.DEBUG: array ( 'url' => 'https://api-3t.sandbox.paypal.com/nvp', 'CreateRecurringPaymentsProfile' => array ( '...
0
votes
3answers
286 views

Magento 2 - Categories not display when Page Cache is on

I have a very strange issue on Magento 2.2.2, if I enable the Page Cache (Full page caching - FPC) the top navigation is not display anymore. What I can do? Thank you
0
votes
0answers
5 views

Need to get unique values in array [migrated]

Array ( ) Array ( ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 [1] => 12 ) ...
1
vote
0answers
37 views

Magento2.3 : How do I programmatically submit a form generated via a UIComponent?

I created a UI Component form, but I am unable to find the element in the source. I would like to click a button and then inspect a field in the form and dependent on what value is selected submit ...
0
votes
1answer
16 views

Assign related products from categories (Magento 1)

We have a magento store and we have over 1000 products listed. We want to assign random related products, but they should be within the category. For example, if a product is listed under Men >> T-...
24
votes
11answers
39k views

Magento 2 Allowed Memory exhausted error when compile code

I have error when i add module.. Please re-run Magento compile command so i run below command but also display error that below when run command from root, php magento setup:di:compile Compilation ...
2
votes
2answers
967 views

PHP requirement incompatible with your PHP version | Composer module installation error

I try to install an extension using the composer: composer require magenest/module-worldpay-and-subscriptions:2.0.0 And get this: [InvalidArgumentException] Package magenest/module-worldpay-and-...
0
votes
1answer
29 views

Need to change the `signin` name in header links in Magento 2

I am building a custom theme and I need to change the signin link name which is not contained in the layout file nor in the phtml file but only in the block class file. So should I build a module in ...
0
votes
0answers
11 views

Get delivery time for UPS on Magento 2 shipping methods

we have our custom UPS prices configured through the UPS api on our Magento 2 website. It is working well, but we would like to add the delivery time (in days?) for our clients. What are the files ...
1
vote
2answers
19 views

Magento 2.3 How to override the custom theme's etc/layouts.xml file in recommended way?

There is, in a theme that I bought a layout.xml file that is used in the backoffice to hydrat a select element (that allows you to switch between 5 layouts). app/code/CompanyTheme/LayoutSwitcher/etc/...
4
votes
2answers
859 views

Magento 2 - After adding to cart, cart page showing empty

I have a magento 2 website and I am facing an issue where After you add to cart, cart page is showing empty. It's not happening all the time but most of the customers are facing this issue. Thanks
3
votes
4answers
16k views

Call a PHP file with AJAX in Magento

Seems like I can't make Ajax to call the PHP file and I can't figure out what or where the problem is. I`m trying to make a module that reads from database and it should display a form with options to ...
5
votes
2answers
2k views

How to get customer address with address id

Can i get customer address like picture below with address id? If i can, how should i do it?
18
votes
7answers
6k views

Magento 2: “Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider”

My Magento 2 development environment has started poking me with the following error message Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact ...
1
vote
0answers
13 views

UI Components - pass ids selection to listing selection

How do i pass a selection of ids to an insert-listing component to preselect certain rows. I have a dynamic rows component with entries related to the current product I'm editing. When click on a ...
2
votes
1answer
42 views

OR condition in magento 2

I am using Magento 2.1.5, and I created 4 customer attribute. I need to set the condition like if any one of the fields is filled, customer session will start. for one field I am getting the result, ...
1
vote
1answer
25 views

Find the block class instantiated into a phtml file

I need to modify a block class called in a phtml file, this is the customer.phtml file: <?php // @codingStandardsIgnoreFile ?> <?php if($block->customerLoggedIn()): ?> <li ...
2
votes
1answer
24 views

Magento 2.1 EE upgrade issues

I am trying to upgrade my magento 2.1 EE to latest version 2.3.1 EE. But I am getting two issues- 1. PHP memory limit issues. It shows current limit is 512 M and needs to be 756 M or more. But ...
0
votes
1answer
18 views

Multiple For each loop value to Json string

$data= array(); foreach($itfdatas as $key=>$itfdata){ $checkemps = explode(',',$itfdata['employee_id']); $data[] = array( 'id'=>mysql_real_escape_string($itfdata['P_id']), ...
0
votes
0answers
16 views

Set custom Record Count to Collection pagination in Report Grid

How we can set count of collection size before setting for the grid. Main Sales collection: $collection=Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('created_at', ...
0
votes
1answer
1k 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
0answers
7 views

How to send custom form total value to CCAvenue Payment Page?

I have form which is get details form customer and also calculate amount of the product, how can i pass total value which is get form and pass to CCAvenue payment page. My form : <html> &...
0
votes
0answers
10 views

Incrementing cart total price with ajax but total price is not displaying at correct place

When trying to update cart......total price is not showing at right place. I am using below mentioned code : <script> function postStuff(){ // Create our XMLHttpRequest object var hr = new ...
5
votes
3answers
7k views

Magento 2 : print_r or var_dump is not working

Why print_r and var_dump is not working in magento 2 ? I have check with category object in my custom module block and .phtml files. This does not show anything.
1
vote
0answers
23 views

How to make new column through foreach loop in html table

I want to make one column with three rows after that second and third column should be made. With this code, only one column is being created. $i = 1; foreach($array as $a => $v) { if(empty($...
0
votes
1answer
19 views

Hiding products with £0.00

Magento 2.3, how can I hide products automatically via cron for products that have a £0.00 price? I use a 3rd party to calculate prices across my store and when some products cannot be matched in ...
1
vote
5answers
229 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" ...
0
votes
1answer
13 views

Magento 2 - Hide Products with no Images via PHP SQL Query

I have an SQL query that i run on the database manually which checks the catalogue for products that do not have an image and hides them, i want to run this via cron so have created a php with the ...
2
votes
1answer
1k 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 (...
5
votes
4answers
3k views

Magento 2 - Backend custom module 404 error

I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu ...
0
votes
2answers
1k views

Get Wishlist product collection in Controller of Custom module Magento2

I am trying to get Wishlist product collection in Custom module controller for the new functionality. I searched in google and I got this: Inject this class in your constructor: protected $...
1
vote
0answers
7 views

Magento 1.9 Colour Swatch handling code -

Please can someone help me with some PHP code: Our magento server hosts have identified this section of code as being very resource hungry, is there an alternative route we can take? a module that ...
0
votes
1answer
934 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 ...
1
vote
0answers
23 views

magento2 - windows php-cgi process not killed

Being new to magento2, I've installed it upon my windows machine ( along with limited resources, please don't ask me to have a docker setup then .. ). There's a weird thing happening for each static ...
1
vote
4answers
2k 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
1answer
16 views

Apply Date Filter With “not qual to” Condition in Magento 2

i need to filter with a date column with not current month records i tried : $start = date('Y-m-d'.' 23:59:59',strtotime('-45 days')); $end = date('Y-m-d'.' 00:00:00'); $collection =...
0
votes
0answers
25 views

How can submit my form through mail?

I have automated mail sending function in Magento 1.9 code. I have used mail template for sending mail (using default magento functionality) but now i want to add one form in that mail which ...
1
vote
1answer
2k views

Get plain value from custom variable in php with objectManager

I want to get a plain value from custom variable (defined on admin) in php with objectManager. storeID is in $order->getStore()->getId() Custom Variable Code is 'mycustomvar' why does ...
2
votes
2answers
298 views

Magento 2 - Track order button not work

I have Magento 2.2 and the Track Order button is not working, when I open any order and I press Track Order button I have this error: Shipment #000000013 Fatal error: Uncaught Error: Call to ...
0
votes
2answers
187 views

How to disable add to cart in magento 2

I feel like i've read and tried every solution i possibly could and nothing works. I removed from product page by overiding .phtml files in custom theme, easy. I then successfully removed from the ...
4
votes
2answers
2k views

magento 2 / can't set addImageToMediaGallery path

i created php file in root folder and trying to create simple product programatically in magento 2. testimg folder locating in root. I always thow the error: The image does not exist. Here is code: $...