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,078 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
3answers
6k 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-...
8
votes
3answers
1k 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 ...
6
votes
2answers
2k 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 ...
6
votes
0answers
487 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 ...
6
votes
1answer
712 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.
6
votes
0answers
963 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....
6
votes
3answers
4k 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 ...
6
votes
1answer
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 ...
5
votes
1answer
156 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/...
5
votes
4answers
4k 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 ...
4
votes
2answers
144 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 ...
4
votes
0answers
118 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
4
votes
0answers
544 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 ...
4
votes
1answer
183 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 ?
4
votes
0answers
276 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?
4
votes
1answer
994 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 ...
4
votes
1answer
442 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 ...
4
votes
1answer
1k 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\...
3
votes
0answers
30 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 ...
3
votes
0answers
60 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\...
3
votes
0answers
30 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? ...
3
votes
0answers
45 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?
3
votes
0answers
363 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', ...
3
votes
0answers
23 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 ...
3
votes
0answers
39 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.
3
votes
0answers
67 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 <...
3
votes
0answers
42 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 ...
3
votes
0answers
29 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 ...
3
votes
0answers
193 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 ...
3
votes
1answer
382 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
1answer
132 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 . ...
3
votes
2answers
414 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%&...
3
votes
0answers
135 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($...
3
votes
1answer
273 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 ...
3
votes
0answers
465 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
452 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\...
3
votes
1answer
831 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 ...
3
votes
0answers
437 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
190 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....
3
votes
0answers
125 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
740 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
192 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
1answer
321 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" /> ...
3
votes
1answer
782 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 ...
3
votes
1answer
583 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/...
3
votes
0answers
174 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
385 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
2answers
2k 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 ...
3
votes
1answer
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:...
3
votes
2answers
890 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

1 2 3 4 5 22