Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Add custom field in shipping address form of Checkout for Magento 2?

Below I have a shipping address form of checkout page and I would like to add another field (P.O. Box) in this form. I tried to look it up every forums and most of the answers were based on overriding....
0
votes
2answers
18 views

Magento 2 Observer class print event data

I want to preview all the details inside the object such as Order, Customers after saving the event. I tired below way but it not printing the object inside attributes.... Customer Object Magento\...
0
votes
0answers
12 views

PHP custom script can't check if Admin is logged in

I tried multiple different scripts to check if the admin is logged in. One of them is this one: require_once('app/Mage.php'); Mage::app('admin'); class AR { public function index() { ...
0
votes
1answer
22 views

Generate Search Issue when searching just few specific strings on Magento 2.3.2

When I am searching on Magento 2.3.2 website it is generating error as I have provided the image below. It generates results which looks like queries and generate on a specific string. Please help me ...
0
votes
0answers
22 views

Magento 2 : add PDF attachment to new order email

I would like to add a custom PDF to the new order email for Magento 2.2 (each PDF is different I can't use an existing module). I looked into the file : vendor/magento/module-sales/Model/Order/...
0
votes
2answers
20 views

Magento 2 : product is adding twice when disable add to cart ajax

When I disable the add to cart through ajax Stores > Configuration > Sales > Checkout > After Adding a Product Redirect to Shopping Cart the user can click multiple times on the add to cart button ...
0
votes
0answers
46 views

How to make Credit card payment in Magento 2 using Rest API?

I am working on Magento 2.3 REST API for a Roku application. Our client wants to give payment option on Roku device for his customers. I have followed these APIs step by step: http://10.1.1.5/demo/...
1
vote
2answers
33 views

Magento 2.3 - removing the login/Signin button on checkout page

I use magento 2.3.2 and i cant locate the SIGN IN button in the checkout page of my website.. i have tried to access magento\vendor\magento\module-checkout\view\frontend\templates\onepage\link.phtml ...
0
votes
1answer
24 views

Dark Overlay over my PDP (Product Description Page) Magento2

I am using Magento 2.3.2 for my Ecommerce and whenever i open a PDP in my magento 2.3.2, i get overlay on the screen, Please check attachment Image. I have tried with CSS to remove this or to disable ...
0
votes
2answers
52 views

Magento 2: How to add PHP code into CMS Block using .phtml file

I have followed the below links to try and get PHP code into CMS Block which links to a .phtml file, with no avail. Show content of phtml file on static block Magento 2 PHP code in Block Currently ...
0
votes
0answers
37 views

Empty additional_attributes Table Magento 2

Please, can someone let me know how I can empty the additional_attributes for all of the products on my site? Due to some import issue, wrong information has been imported and when I exported CSV it ...
0
votes
0answers
14 views

Magento 1.9 Banner click redirect

when i add a new banner from the admin page, it shows a small button in the banner from the front end view and when the button is clicked it redirects them to a certain link. i want to remove this ...
0
votes
0answers
31 views

Magento 1.9.4.3 item not added to basket when button clicked

I have just successfully updated to 1.9.4.3 from 1.9.4.2. However, in one of my custom blocks the add to basket doesn't work, item does not get added to the basket. Analysing the url from $this->...
0
votes
0answers
8 views

Magento 2 Custom module export via cron no products

I created a custom module that at regular intervals creates an XML file with selected product data. The process that generates the XML can also be run from Magento CLI via a custom command. Although ...
0
votes
1answer
29 views

Bypassing the different server PHP versions to install extensions

My SSH version is 5.4 but my server version is 7.1. i used composer install --ignore-platform-reqs to bypass the errors and install Magento 2.3 but now i want to install extensions using bin/...
2
votes
0answers
34 views

Magento 2 - Different billing and shipping address

I would like to force the user to use the default billing address he has in its account on checkout. So I set the quote billing address programatically and hide / uncheck the checkbox "My billing and ...
0
votes
0answers
23 views

Magento 2 how to get all shipping rates from CartTotalRepository

We already have table rate shipping wherein US shipping will be $13, Alaska and outside of the US will be $38. On top of it, we want to have rush shipping addition of $25. I was able to add custom ...
1
vote
1answer
45 views

Debug in Remote Server Configuration with PHP Storm unsuccessful on Breakpoints

Scenario: We have code on our local machine and are remotely handling the code and database on a Remote Server (Virtual Machine). Now we want to Debug our Code. This is how we have configured ...
0
votes
1answer
61 views

Dockerfile for php to install magento 1.9.x on docker

I need to install magenot 1.9 on docker. Now, I have to create Dockerfile for php 7.2 with extensions which need magento. Extensions: curl dom gd hash iconv mcrypt pcre pdo pdo_mysql simplexml How ...
0
votes
1answer
52 views

Error when trying to view order in admin panel

When trying to click to view a particular order in the Magento 2.3.2 back-end I get a blank page with the following message: Order View Information Changes have been made to this section that ...
0
votes
0answers
8 views

Magento 1.9 After merging CSS websites fonts getting changed

I have issue with magento 1.9.8. when i was enabled merge css from backend then frontend content font was changed.Custom css was not merge properly.
1
vote
0answers
46 views

Customer Logout using CURL request

I want to logout customer from external request based on the customer ID. For example, I have created custom controller action that accepts customer email in a GET request. I want to perform logout ...
1
vote
0answers
30 views

How to get all product data from oracle netsuite through php api

I have been created the connection between PHP and Netsuite but now I want to load all product data from NetSuite to my PHP API so how can I do this? is there any solution for that...
1
vote
0answers
34 views

magento 2.3.1 inventory:reservation missing commands

I have inventory_reservation inconsistencies that I need to clean up on M2 2.3.1 so following this wiki guide https://github.com/magento/inventory/wiki/CLI-Reference but when running it I get error '...
0
votes
0answers
21 views

Magento 2 - Prevent addresses to be saved when placing order

When a customer is placing an order its addresses are automatically saved, I would like to prevent this behavior but I'm not able to find in which file Magento is saving addresses ?
0
votes
2answers
35 views

How can I display customer group id on page?

I am trying to use a formula that looks at whether a customer is wholesale or not, and then discounts the price automatically for a product if they are, but on a custom priced product. (So I can't ...
0
votes
1answer
24 views

Magento2 - Change customer group programatically conditionally

I need to dynamically change logged in customer group ID to get products prices from another group. I tried : $this->session->setCustomerGroupId(NEWGROUPID); It's working great for product ...
3
votes
0answers
32 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\...
0
votes
1answer
84 views

How to solve the issue : Deprecated: __autoload() is deprecated?

Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in C:\wamp64\www\magepro\app\code\core\Mage\Core\functions.php on line My php version : 7.1.29
1
vote
0answers
10 views

How to filter collection and still keep the original collection in Magento 1

I've created a custom module that allows you to add custom labels on product page. So I have a collection of custom objects and I want to filter it but I want to keep the original collection too. ...
1
vote
1answer
53 views

Magento 1.9 installation error - PHP extension “mcrypt” must be loaded

I have configured php_mcrypt, still getting same error. How to solve the error? Note : phpinfo not showing details about mcrypt.
1
vote
0answers
14 views

Magento 2 get hidden image programmatically

I have a custom module for exporting links of my product images. With this code: public function getImageAttributes() { $attributes = [ 'thumbnail' => 'Thumbnail', ...
1
vote
1answer
64 views

Magento 2.3: Call to undefined method Magento\Framework\View\Result\Page\Interceptor::setPath()

I want to configure Nextopia Extension, i installed it properly after that when i go to this URL http://mysite.dev.us/nsearch, i get an error like this: And the file /app/code/Nextopia/Search/...
1
vote
1answer
27 views

PHP if statement not working - AB testing

I've been working on a new modal design to be AB tested against the old version. However, I don't want to dive into third party AB testing code/frameworks so I have opted for a simpler approach. ...
0
votes
2answers
49 views

Upgrade magento 2.2.2 to 2.3.2 getting error

We are trying to upgrade a Magento 2.2.2 site to Magento 2.3.2, when executing **php bin/magento indexer:reindex** we get the error... Design Config Grid index has been rebuilt successfully in 00:00:...
1
vote
1answer
33 views

Magento 2.3.1 Getting Incompatible argument type error

I'm getting the following error: Incompatible argument type: Required type: \Magento\Framework\Data\Helper\PostHelper. Actual type: array. I have tried changing the parent constructor, but I'm still ...
0
votes
1answer
27 views

Magento 2: Order Items in New Order Email not showing

When I get new order email after successful checkout, there is no information about order items. Need your help. order_new.phtml {{template config_path="design/email/header_template"}} <table>...
3
votes
0answers
48 views

Error when mass updating Attributes

Trying to mass update some attributes of products but when I try to open the update attributes form I get an error.. any ideas of the cause? 1 exception(s): Exception #0 (Exception): Notice: ...
1
vote
1answer
65 views

Magneto 2.2.2 upgrade to 2.3.2 Getting Error

We are trying to upgrade a Magento 2.2.2 site to Magento 2.3.2, when executing php bin/magento setup:di:compile we get the error... Repositories code generation... 1/7 [====>-----------------------]...
0
votes
1answer
28 views

Magneto 2.1.9 upgrade to 2.2.2 Getting Error

We are trying to upgrade a Magento 2.1.9 site to Magento 2.2.2 Getting Error .. " Can anyone help me " Upgrade Commands - composer require magento/product-community-edition 2.2.2 --no-update Then ...
3
votes
0answers
24 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? ...
0
votes
0answers
23 views

What is the replacement for 'require_once' in PHP for Magento2 to resolve CodeSniffer test issue in Magento store?

I'm a beginner at PHP and Magento have developed a Magento2 extension and used this line code in it: require_once '/../knownuserv3/KnownUser.php'; But when I tried to put my extension in Magento ...
1
vote
0answers
19 views

Arabic language is not showing in Invoice PDF its showing squares instead magento 2

I have a arabic store in magento 2. When I am trying to print invoice from magento admin it's not supporting Arabic language it's showing squares all over Arabic language. I do not want to add any ...
1
vote
1answer
23 views

UPS - Malformed XML on shipping rates request

inside the shipping.log file i can see this error: The XML document is not well formed After some digging I see that my Auth information are not well encoded. It works perfectly when I write them ...
1
vote
0answers
50 views

Error #410301 : Products not available between this origin and destination (network segment) for DHL in Magento 2.3.2

Error #410301 : Products not available between this origin and destination (network segment) for DHL in Magento 2.3.2 Hi everyone. I've a problem with DHL integration in Magento
0
votes
1answer
36 views

Magento 2: sort values in collection with unique flag

I have an array as collection and ordered it in ascending order with respect to expiry date as below: $creditDetails = $this->_creditFactory->create()->addFieldToFilter('customer_id', 1)->...
1
vote
2answers
46 views

Save stock data programmatically

You know how you've got; $tempProduct->setData('price', 9.99); $tempProduct->getResource()->saveAttribute($tempProduct,'price'); I want to do the same, except for stock; $stockData = $...
0
votes
1answer
33 views

Magento 2: PHP script exporting to csv will not export values for Backorders

I'm using Magento 2 as PIM for other shop solution. I need to export the backorders value once per hour until we have made an API. The script below works fine, but values for 'backorders' are not ...
0
votes
0answers
19 views

Magento 2.3 : backoffice wrong redirect to bad url index.php/admin/http://

Sometimes, in the back office, I get a completely wrong redirection. example: http://index.php/admin/http:/index/index/index.php/admin/admin/index/index/key/...
0
votes
0answers
17 views

Magento 2: Magento extension manager incorrectly report php memory limit

We have a new Magento 2.3.0 site in development. We're installing some required extensions using Magento extension manager. Extension manager 'readiness check' reports that we only have 512M available ...