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,269 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
3 answers
7k views

How to get Captcha in customer registration form?

Lately, we have been having trouble with spammers on our website, we want to resolve this using a captcha function. I enabled the captcha function in System->Configuration->Customer->Customer-...
user avatar
  • 167
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 ...
user avatar
  • 81
7 votes
1 answer
5k views

Magento 2 No such entity with cartid = help!

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 ...
user avatar
  • 143
7 votes
1 answer
1k 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
7 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.
user avatar
6 votes
0 answers
546 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 ...
user avatar
  • 172
6 votes
0 answers
1k 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....
user avatar
6 votes
3 answers
6k 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 ...
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 ...
user avatar
  • 61
5 votes
3 answers
1k 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', ...
user avatar
5 votes
0 answers
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; ...
user avatar
  • 650
5 votes
1 answer
177 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/...
user avatar
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 ...
user avatar
4 votes
0 answers
154 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 <...
user avatar
  • 2,029
4 votes
2 answers
445 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 ...
user avatar
  • 83
4 votes
0 answers
159 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
user avatar
  • 79
4 votes
0 answers
740 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 ...
user avatar
4 votes
1 answer
313 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 ?
user avatar
4 votes
0 answers
298 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?
user avatar
  • 41
4 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\...
user avatar
  • 185
3 votes
0 answers
203 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 ...
user avatar
3 votes
0 answers
41 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 ...
user avatar
  • 8,795
3 votes
0 answers
270 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\...
user avatar
  • 131
3 votes
0 answers
36 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? ...
user avatar
3 votes
0 answers
101 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?
user avatar
3 votes
0 answers
29 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 ...
user avatar
  • 3,886
3 votes
0 answers
121 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.
user avatar
  • 309
3 votes
0 answers
54 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 ...
user avatar
  • 309
3 votes
0 answers
44 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 ...
user avatar
  • 119
3 votes
0 answers
620 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 ...
user avatar
  • 482
3 votes
1 answer
265 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 . ...
user avatar
  • 1,123
3 votes
2 answers
1k 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%&...
user avatar
  • 482
3 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, ...
user avatar
3 votes
0 answers
1k 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 ...
user avatar
  • 106
3 votes
0 answers
211 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($...
user avatar
  • 1,474
3 votes
1 answer
401 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 ...
user avatar
3 votes
0 answers
635 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\...
user avatar
  • 1,172
3 votes
1 answer
1k 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 ...
user avatar
  • 131
3 votes
0 answers
534 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. ...
user avatar
  • 101
3 votes
0 answers
225 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....
user avatar
  • 2,460
3 votes
0 answers
254 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){ ...
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 ...
user avatar
  • 189
3 votes
0 answers
223 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 = "...
user avatar
  • 1,020
3 votes
1 answer
409 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" /> ...
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 ...
user avatar
3 votes
1 answer
721 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/...
user avatar
  • 343
3 votes
0 answers
192 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 ...
user avatar
  • 231
3 votes
0 answers
428 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 ...
user avatar
  • 451
3 votes
2 answers
3k views

Magento 2 - Remove video from gallery in product page

I'm trying to remove the video from the gallery in product page and I saw that the method getGalleryImages() in the Magento\Catalog\Block\Product\View\Gallery block gets all types of media (image and ...
user avatar
3 votes
1 answer
1k views

Readiness check ignores memory limit

CentOs 7 with php 5.6.26 and Plesk 12.2 [php.ini] Memory_limit 2G phpinfo() shows memory_limit of 2G. Readyness check still says limit is set to 128M, so I did a reboot and performed an cache:...
user avatar

1
2 3 4 5
26