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.

1,311 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
2 answers
7k views

Magento 2 No such entity with cartid =

I'm experiencing this error on my site quite often: Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with cartId = It's not using multiple stores, so the entity_ids ...
Howliee's user avatar
  • 153
8 votes
1 answer
2k 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\...
user avatar
8 votes
1 answer
1k 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.
Mohit chauhan's user avatar
8 votes
3 answers
2k views

SSL Installed Checkout and Account Area Still Using HTTP and not HTTPS

I am running magento 2 ver 2.0.7 I have an HTTPS issue. I'm not quite sure why this is happening but in Stores -> Config -> Web. I have my secure base url set to https://mystore.com/ but when I ...
steve's user avatar
  • 81
7 votes
1 answer
1k 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; ...
AJK's user avatar
  • 751
7 votes
3 answers
7k views

Magento 2 bin/magento not working as it should

I've just installed a fresh copy of Magento 2.1.2 from composer. I've previously installed Magento 2 in a different directory completely fine and the commands all run as they should. This has only ...
TheOnlyOne's user avatar
6 votes
3 answers
2k views

Facing issue when running the command php bin/magento setup:upgrade

Facing issue when running the command php bin/magento setup:upgrade The XML in file "D:/wamp64/www/porto/vendor/magento/module-inventory-catalog/etc/communication.xml" is invalid: Element 'topic', ...
Ali Sultan Khan's user avatar
6 votes
1 answer
182 views

Problem with CLI

Hello i have an error of every command i press in CLI. Following this Error Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /var/...
darkattack's user avatar
6 votes
0 answers
611 views

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

In Magento2 - 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 ...
Mr.farhan's user avatar
  • 172
6 votes
0 answers
2k 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....
Hammad Khalid's user avatar
6 votes
1 answer
1k views

Magento SOAP API call limit?

Is there a limit on API calls using Magento's SOAP API (V1)? The product page for a store I'm working on requires several calls to the "cataloginventory_stock_item.list" method, once for every "simple ...
jGaiser's user avatar
  • 61
5 votes
1 answer
2k views

cannot get extension attributes value

The value can post However,I cannot get Extension attributes on my plugin which intercept Checkout success controller code. getExtensionAttributes always return null <?php namespace Genning\...
Billy VG's user avatar
  • 205
5 votes
4 answers
5k 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 ...
3tech - Alessandro Staffolani's user avatar
4 votes
0 answers
45 views

Magento 2 Marketplace Extension Submission Issue

I want to submit one of my extension in marketplace. I submitted and they give me one error while submitting one ajax form. But I am Following the same steps they gave me to reproduce the error. But I ...
Krupa Popat's user avatar
4 votes
0 answers
300 views

How to Remove a Block From layout Programatically in magento 2

i am trying to remove a Crossell from cart page in my phtml file how i can do this when i researched i found crosssell products are viewed in checkout_cart_index.xml file as <...
Waqar Ali's user avatar
  • 2,319
4 votes
2 answers
799 views

Menu that open by itself after clicking on the link of a parent category

When I click on parent category, the page load but the menu re-open if the pointer of the mouse is still present. What do you recommend so that the menu does not re-open immediately ? I found PHP of ...
Thomas's user avatar
  • 83
4 votes
1 answer
6k 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, ...
Mehdi Rafiai's user avatar
4 votes
0 answers
290 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
Divya M's user avatar
  • 79
4 votes
0 answers
753 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 ...
Mageshwaran's user avatar
4 votes
1 answer
482 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 ?
Tehmina Ansari's user avatar
4 votes
0 answers
375 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?
Jose's user avatar
  • 41
4 votes
2 answers
1k 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
imtiaz's user avatar
  • 117
4 votes
3 answers
3k views

Magento 2.1 update special price dates programmatically

I have a problem updating the special price dates of a simple product. I've tried 2 versions of code, but without results. In both cases the special price will be update, but no affect to the start ...
fmineo's user avatar
  • 219
3 votes
0 answers
392 views

How to add "httponly" attribute set on existing cookie ? (Magento 1)

In Magento 1 I can see many of the cookie are without Secure flag and HttpOnly set on website. Is their any way to set Secure flag and HttpOnly set on all server Cookie ? I need to make all server ...
Hamendra Sunthwal's user avatar
3 votes
1 answer
1k views

Magento2 controller_action_predispatch not working with Varnish enabled

I am using Magento version 2.3 Varnish 6 enabled Docker setup I am implementing force login on event 'controller_action_predispatch'. Below is my code: app/code/Vendor/Module/etc/frontend/events.xml ...
anujeet's user avatar
  • 195
3 votes
0 answers
53 views

Magento 2 - PHP Vulnerabilities message

I am getting PHP Vulnerabilities notification and it is showing critical. Reminder on PHP VulnerabilitiesMS-ISAC has issued an alert related to multiple vulnerabilities that could allow for ...
Shoaib Munir's user avatar
  • 9,434
3 votes
0 answers
379 views

Magento 2 : Get cookie just next after set it

let's say we have executes below magento-2 code at one single request, namespace namespace\CookieDemo\Model; /** * Class Cookie */ class Cookie { /** * @var \Magento\Framework\Stdlib\...
Jigar7521's user avatar
  • 131
3 votes
0 answers
43 views

Error: The same url in all products Magento 1.9

I've tried to show the related products under the images of products. Until here all is ok, but the URL of the products is showing always the same of the first related product How can I solve this? ...
Raphael Cordeiro's user avatar
3 votes
0 answers
139 views

Reindex a single category in magento 1

I want to re-index a single category in Magento 1. The method given in this post is not working for reindexing categories Is there a way to do it through code?
Shankar Thyagarajan's user avatar
3 votes
0 answers
34 views

Redirect old page to new html page using .htaccess

We have a static HTML website having MicrosoftDynamics.html page recently we changed to MicrosoftDynamicsNav.html. But when we searched in google the page URL is showing old one, If we clicked the ...
Bojjaiah's user avatar
  • 4,002
3 votes
0 answers
224 views

Magento 2 admin in invoice total section grand total not get reduced

When creating an invoice for the order from Magento 2 admin panel, the grand total not get reduced with my store credit value.
Arul's user avatar
  • 309
3 votes
0 answers
106 views

How to get the applied custom discount amount in observer?

I followed the steps in the below link to apply custom discount [https://magento.stackexchange.com/a/93349/21007][1]. But I need to get the applied custom discount amount in the observer event of ...
Arul's user avatar
  • 309
3 votes
0 answers
46 views

magento 1.9 special offer timer for first time user

For my Magento 1.9 website, I want to set the special offer timer. In which I want to display this timer to first time user (new visitor) only and it will use this offer within an hour only. After an ...
Narayan's user avatar
  • 119
3 votes
0 answers
823 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 ...
Dinesh's user avatar
  • 552
3 votes
1 answer
344 views

Magento2 : How to Translate words of order pdf like subtotal,grand total

Magento,How to Translate words of order pdf like subtotal,grand total,shipping & Handling etc... Where i have to work php files or phtml files or CSV ? i need to translate that words in arabic . ...
sumeet bajaj's user avatar
  • 1,296
3 votes
2 answers
2k views

Magento2 API Filtering Multiple categories

In Magento2 API, how would I filter by multiple categories? V1/products?searchCriteria[filterGroups][0][filters][0][field]=name&searchCriteria[filterGroups][0][filters][0][value]=%test%&...
Dinesh's user avatar
  • 552
3 votes
0 answers
595 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 ...
Muhammad Hasham's user avatar
3 votes
0 answers
2k views

Magento2 - Add Custom fields block after shipping method

Want to add custom fields after shipping method at Magento 2 checkout page. I have created custom module with checkout_index_index.xml and able to add custom fields block at after shipping address ...
Pravin's user avatar
  • 106
3 votes
0 answers
237 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($...
Milind Singh's user avatar
  • 1,584
3 votes
0 answers
211 views

Magento 2.1.7 Upgrade to 2.2.x - Error converting field `value` in table `dgtl_quote_item_option`

I'm trying to update Magento 2.1.7 to Magento 2.2.x but I keep coming across this error when I run the upgrade command in the CLI. Upgrading data.. Error converting field `value` in table `...
mjcoder's user avatar
  • 131
3 votes
1 answer
412 views

Display fedex shipping rate in product page magento 1.9

I read the similar question but no luck. I am working in magento 1.9. I want to display shipping rate in product view page. I have zipcode textbox in product page. After enter zipcode I want to ...
David Coder's user avatar
3 votes
0 answers
756 views

Magento 2 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\...
HoangHieu's user avatar
  • 1,348
3 votes
1 answer
2k views

Magento 2 Update product additional option added in add to cart

I have configurable product in my website and I added the product additional option in add to cart to hold the custom value, Now on cart page I want to allow the user to update those additional option ...
Irfan.gwb's user avatar
  • 131
3 votes
0 answers
544 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. ...
Emile's user avatar
  • 101
3 votes
0 answers
242 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....
Mahi M's user avatar
  • 2,540
3 votes
0 answers
374 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){ ...
hello123's user avatar
3 votes
0 answers
1k 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 ...
Peter's user avatar
  • 189
3 votes
0 answers
231 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 = "...
Asheem Patro's user avatar
  • 1,070
3 votes
1 answer
450 views

Serve merged CSS from one url

When I merge CSS it creates 3 merged files, and they are served separately as such <link rel="stylesheet" type="text/css" href="xyz.com/media/css_secure/32733c3332436554dae7e8f320cd2308.css" /> ...
user2240778's user avatar
3 votes
1 answer
2k 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 ...
Hammad Khalid's user avatar

1
2 3 4 5
27