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.

968 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
4answers
5k views

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-...
7
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
701 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
1answer
589 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
765 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
1answer
134 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
0answers
466 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 ...
5
votes
2answers
3k 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 ...
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 ...
5
votes
1answer
975 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 ...
4
votes
2answers
75 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
99 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
1answer
573 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
871 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
20 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
25 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
23 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
172 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
79 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
1answer
119 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
1answer
240 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
439 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
397 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
1answer
669 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
389 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
236 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
149 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
102 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
563 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
182 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
382 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
1answer
242 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
533 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
162 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
362 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
1k 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
864 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
3answers
722 views

problem adding items to cart from outside magento

I'm having this problem and getting pretty annoyed by it. here's the situation. I was running a website on the codeigniter framework, and our customer wanted to add a shop to sell a couple of ...
3
votes
1answer
1k views

Magento 2 call table stock_item from database

I working to Magento 2.0.2 and i trying to call the table stock_item of the product. When i worked in Magento 1.9 i used this code: loadByProduct($_product)->getQty();?> But now the class Mage is ...
3
votes
0answers
572 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
1answer
1k views

Issue with Product Flat

The issue happen when i enable the flat product, and i need this feature to reduce the load/response time. Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Product_Flat::...
3
votes
0answers
251 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 ...
3
votes
2answers
2k views

How can we add/update a image path with own code without using addImageToMediaGallery()

Can we update a own defined product image path to database, I am adding products with own custom code.I want to add image database without help of ->addImageToMediaGallery() Is it doable?? ...
2
votes
0answers
42 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 <...
2
votes
0answers
23 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 ...
2
votes
1answer
46 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, ...
2
votes
1answer
28 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 ...
2
votes
2answers
27 views

find the ul tag inside header

I need to find the template or layout file that contains this ul tag: <ul class="header links"> <li class="greet welcome" data-bind="scope: 'customer'"> <!-- ko if: ...
2
votes
0answers
43 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 ...