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.

6
votes
0answers
707 views

Magento 2 Admin- Invalid data provided for linked products

Getting an error " Invalid data provided for linked products " when adding related products to a product from the admin panel and saving Indexer crons, already setup Magento CLI version is : 2.1....
5
votes
0answers
463 views

How to apply custom validation in Magento 2 checkout Shipping Address form?

I want to apply some custom validation on shipping address form of Magento 2 Checkout. Normally i do it with JQuery but don't know how to apply it in Magento 2. The validation i want to implement are ...
4
votes
0answers
97 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
3
votes
0answers
113 views

Magento 2.3: Customer ID from Session Returning NULL with Cache Enabled

I'm calling the following helper but getCustomerId is returning NULL when I have cache enabled. If I disable all cache, then I can return the customer's ID. <?php namespace Company\Module\Helper; ...
3
votes
0answers
410 views

Could not install B2B extension for magento 2.2.0-EE

I have installed Magento-EE-2.2.0 with sample data. After installation, i tried to install B2B extension using composer composer require magento/extension-b2b Used the following reference site ...
3
votes
0answers
376 views

Magento 2 Optimize memory leak perfomance

I have a problem with the import data process. First: I have used the factory creator to create a Model set data and save but the problem when I have 400k Item to save. --- Constructor \Magento\...
3
votes
0answers
371 views

Headers already send Magento 2 multistore addon domain

Multiple websites are working on Magento 2.2 with the addon domain method and symlinks. The theme is visible, etc. Only thing is that at the bottom I see the following message. Looking for advice. ...
3
votes
0answers
200 views

Automatic Login in Magento 2

I have an application where the user logs in, and I have a web service where I can send the data. How can I get the user logged in automatically to the e-commerce with the data received?
3
votes
0answers
94 views

Check if Magento cart is empty using Javascript?

So I need to check if the cart on my magento site is empty or not. I can do this using php like this: <?php $count = $this->helper('checkout/cart')->getSummaryCount(); if($count==0){ ...
3
votes
0answers
512 views

magento 2 Error: cannot call methods on modal prior to initialization; attempted to call method 'openModal'

Getting error magento 2 Error: cannot call methods on modal prior to initialization; attempted to call method 'openModal' First time it work fine but when I click on button to change area then it ...
3
votes
0answers
178 views

Magento1.9 Connect to External Mssql Database using Pdo_dblib

I am trying to connect an external database to get few data into Magento. I am using pdo_dblib to connect to the database. try { $hostname = "hostname"; $port = port; $dbname = "dbname"; $username = "...
3
votes
0answers
367 views

Magento 2: Include header and footer in external php

I want to include header and footer layout of Magento 2 to external PHP file, I am using my own code(external PHP) to make a frontend page. how to add header and footer layout theme in Magento 2 to my ...
3
votes
0answers
156 views

Magento 2.1.2 problem with instantiating TotalsItemExtensionInterface

I have a problem with instantiating \Magento\Quote\Api\Data\TotalsItemExtensionInterface Below is my code <?php namespace Vendor\Module\Model\Checkout; class ShippingInformationManagement ...
3
votes
0answers
357 views

Fedex API. Shipping rates request for Multiple-Package Shipment rates

I am looking for fedex shipping rates (shipping estimate quotes), how to add multiple package(box) shipping rates after certain weight limit. I know there is option in magento admin panel weight ...
3
votes
0answers
567 views

How to display shipping estimate and auto add this to grand total on cart page?

I am currently working on a magento website and trying to get the estimated shipping charge auto added to the grand total on the cart page. By doing this on the cart page I am trying to remove one of ...
3
votes
0answers
247 views

Magento only shows 9 search results per page

I am developing in magento When I perform a search, I 'm getting 9 search results per page. But in the top bar it shows "12" http://overpic.net/viewer.php?file=x12x90jyind7m6rjvabsx.png I need to ...
2
votes
0answers
35 views

why deployVeniaSampleData.sh runs out of memory

Trying to run the Venia sample data deploy script bash deployVeniaSampleData.sh --yes but keeps getting mmap() failed: [12] Cannot allocate memory PHP Fatal error: Out of memory (allocated ...
2
votes
0answers
121 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 ...
2
votes
0answers
27 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 ...
2
votes
0answers
24 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 ...
2
votes
0answers
74 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 ...
2
votes
0answers
24 views

Why 2 classes Magento\Framework\HTTP\Client\Curl and Magento\Framework\HTTP\Adapter\Curl for same purpose?

Magento Framework has 2 classes for Curl operations: \Magento\Framework\HTTP\Adapter\Curl and \Magento\Framework\HTTP\Client\Curl What is specific use-case for each as both are capable of doing ...
2
votes
0answers
53 views

“mcrypt_module_open is deprecated” exception in cron in Magento 2.2.6 on PHP7.1 ?

The method is silenced in core still cron throws exception if debbug mode is enabled. mcrypt_module_open is deprecated // @codingStandardsIgnoreStart $this->_handle = @mcrypt_module_open($...
2
votes
0answers
61 views

How to add a Block Grid with Mass Action in an UI form in Magento 2?

I have UI form with a Block grid. <fieldset name="profile_products"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item ...
2
votes
0answers
45 views

Magento 2 is only displaying some products on catalog page

I have 17 products added to my magento store all of which are enabled to display on Catalog and Search, but on the catalog page, only 10 products are being displayed and there isn't any pagination ...
2
votes
0answers
35 views

Magento 1.9.2 - Encrypt the password from the php file

I created a file for sending the email from my site in php via SMTP. To do this I followed a guide where he said that you had to write as text in the sending file (MailSMTP.php) both the email address ...
2
votes
0answers
67 views

Remove file of downloadable product in directory

in my magento web site i have many Sample of downloadable product. I would like that when i click the red "X" to remove the sample and i save it also the file in the magento directory is deleted Do ...
2
votes
0answers
126 views

Magento2.2 PHP Fatar Error in config:show

I casually run php bin/magento config:show and it showed me the following PHP Fatal Error, but I don't have a clue, because the site works ok. ........ analytics/subscription/enabled - 1 PHP Fatal ...
2
votes
0answers
172 views

Magento 2 REST API - Error with custom plugin when adding bundle product to cart

My requirement is that certain kind of bundle products are not allowed to be added more than once in an order. I am trying to do so by intercepting the Add To Cart API method using a Plugin. Here's ...
2
votes
0answers
121 views

How to create an order using mock object in phpunit in Magento?

I am preparing phpunit tests. I need to create an order using mocking and that order i need to pass in my function. Please suggest, How can i achieve this ?
2
votes
0answers
302 views

Magento 2.2 deprecated module \Magento\Backend\Block\

As far as I read about magento's documentation I can't find how all that deprecated content will be replaced. The only information is also displayed in each deprecated class of this module ( \Magento\...
2
votes
0answers
204 views

Magento 2 Cart Memory Exhaustion issue, with customer

Running Magento 2.1.10 CE, with multiple stores. Client requires login to access the site Running into an issue where one of the client is having a problem with cart. They have added 53 products in ...
2
votes
0answers
421 views

Magento 2 : Sort By block is missing after override the toolbar for search page?

I want to add custom sort by options , I have override the toolbar block as follows My di.xml file as <preference for="\Magento\Catalog\Block\Product\ProductList\Toolbar" type="Custom\Product\...
2
votes
0answers
146 views

How to get the user's password and insert it into a new bank

I have the hash passwords of my magento clients, I am migrating to a new bank all the data of the old bank, I would like to know how to enter the passwords in the users. I use this to re-create the ...
2
votes
0answers
124 views

Can't get customerId when magento tried to retrieve

I found this error in var/log exception main.CRITICAL:Magento\Framework\Exception\NoSuchEntityException: No such entity with customerId = in /var/www/html/test.com/public_html/vendor/magento/...
2
votes
0answers
125 views

change lastname as optional in Magento-2?

I want to change last name as optional. so Vendor\magento\module-customer\view\frontend\templates\widget\name.phtml override into mycompany\custommodule\view\frontend\templates\widget\name....
2
votes
0answers
359 views

Programmatically create a category in Magento 2

I am not able to create a category using below code, Also I can't get website id, Anyone knows explain me use \Magento\Framework\App\Bootstrap; include('../app/bootstrap.php'); $bootstrap = ...
2
votes
0answers
225 views

Magento2 add order ID in custom UI Component button link

I want to add a view order button in form UI component of my custom module. I've created a custom template for UI component link button but can't get the order id within URL. The simple field for ...
2
votes
0answers
362 views

Mailchimp 2 for Magento 2 not sync users - permissions?

I have upgraded my mailchimp extension from ebizmarts to mailchimp 2 for magento 2. And quess what? It stopped working. 1. The plugin is installed. 2. The api key returns follwing mailchimp list ...
2
votes
0answers
574 views

Magento 2 name attribute shows empty when creating custom fields on product page

When i try to add new fields to product creationg form in Magento 2 the html name attribute shows up empty, I tried more or less everything and by everything i mean: 1) Adding the custom field i ...
2
votes
0answers
125 views

Magento ver. 1.9.3.2 not logging anything at all

I have noticed magento all of a sudden has stopped logging things, nothing gets logged anymore. Why could this be happening ? I would like to debug log paypal standard orders but nothing gets logged. ...
2
votes
0answers
806 views

Magento : How to Add Quantity Box in Custom Option for Simple Product

I have a attribute "size" which have drop down option in custom option admin panel, and i want to show quantity box for this option, our all products are simple products. I have tried below link it ...
2
votes
0answers
60 views

Create Attributes and Attributesets using AVS-FastSimpleImport

Is there a way to create Attributes and AttributeSets for products using the Avs FastSimpleImport module? I want to use an empty shop and need to import (and update) products which almost all of them ...
2
votes
0answers
345 views

Magento 2 customer dashboard, custom block, sub-navigation

I understand how to remove or add a navigation link in customer dashboard on magento2 Need to know how can i create submenus, or add a static text in the sidebar navigations eg. Following is the ...
2
votes
0answers
197 views

PHP Fatal error: Class 'Magento\Update\Status' not found

My cron job is running but i am still getting these errors in error_log file. PHP Fatal error: Class 'Magento\Update\Status' not found in /update/cron.php on line 15 and when i am installing any ...
2
votes
0answers
549 views

Magento 2, display gift options in checkout page

In magento 2, when you switch on the gift option from the backend. It gets displayed on the Cart page. I need to display this on cart page and checkout page as well, under cart items. How can i ...
2
votes
0answers
139 views

Error while creating shipment with FedEx

I've configured FedEx in magento and when I'm going to create shipment with create shipment label it's giving error like this RequestedShipment shippingChargesPayment - Payor is required How can I ...
2
votes
0answers
817 views

Programmatically Create configurable product in Magento 2.1 Issue

I facing issue while creating configurable product in Magento 2.1 programmatically. I'm reading products from xml and save. The issue is when i associate simple product with configurable product. ...
2
votes
0answers
286 views

Magento Check out Problem

During the check out process after filling the billing section, and trying to go to the Shipping section with the option "Ship to this address" I can not proceed, as I am able to go to the shipping ...
2
votes
0answers
44 views

Error when three fields are hidden on checkout page

<?xml version="1.0"?> <!-- /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...