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

Magento 2: Show Checkout Agreement (Terms & Conditions) Based on Condition?

I'm using Magento 2.4 I added new Terms & Condition, but I want to display it based on some conditions, Is there's any way you know to do it please let me know. Thanks.
0
votes
0answers
10 views

Using Composer 1 despite showing Composer 2

I'm trying to add an extension on a shared server. When I look at the version of Composer at the root level for Magento 2.3.5, it tells me 2.0.8. When I view the free memory, it appears that I have ...
0
votes
2answers
29 views

Include js file script in php observer file

I am using Magento 2.3.5-p2 I am adding a new module to add an Observer that will trigger some js code during an event that happens below are the file and its content I have added File Name and Path : ...
0
votes
2answers
52 views

Price on product detail page changed to 0.00 magento 2.4.3-p1

I'm facing a weird issue with the product detail page on magento 2.4.3. The product price will be shown while loading the page and changed to 0.000 once the page is loaded completely. The price is ...
0
votes
0answers
16 views

How to get current category name in catalog view page(catalog_category_view.xml)?

I have a view model with a method for returning the category names from the current_product (Works in product view page). However it returns null when being used in the catalog view page (...
0
votes
0answers
10 views

How to move the attribute text into the select box label in magneto 2 product details page?

In Product page how to move all configure attribute title on dropdown label and replace with default label (Choose an Option...)? currant : https://prnt.sc/1zwviuh expected : https://prnt.sc/1zwv9ap ...
0
votes
0answers
19 views

how to add "Add to cart" button in catalog search using JS/AJAX in Magento

I want to add the "add to cart" button in catalog search using js. I am getting productname,image,sku. I need to add to a cart button there when I search for a product in the catalog search. ...
0
votes
0answers
19 views

Magento 2 Captcha image is not loading why?

when i click on the forget password in my Magento it is asking for enter email and captcha but captcha image is not loading. why its happening and which files are responsible for that ? Thanks..
0
votes
0answers
23 views

Magento 2.1 - Unable to execute SSH commands

I want to upgrade my Magento 2.1 store but I can't lunch any SSH command, this is the output: php bin/magento cache:flush Array ( [name] => envBatchSize [value] => Magento\Framework\DB\...
0
votes
0answers
11 views

Merge the Guest cart with login user

I need to merge the guest cart item in the login user with the help of the rest api in the Magento way. Please suggest me to do the perfect way to do this
0
votes
1answer
22 views

Magento 2 - Category url load very slow

I have a very strange problem in frontend when open a category after in the adminhtml change the Design Layout to 1 column. If the category have the Design Layout 2 columns-left for example everything ...
0
votes
0answers
29 views

Magento 2.4.0 upgrade to 2.4.3 error

I am getting error while upgrading Magento 2.4.0 CE to 2.4.3 while executing setup:upgrade command. Cannot instantiate interface Magento\MediaContentSynchronizationApi\Model\GetEntitiesInterface#0 /...
0
votes
1answer
34 views

how to add ADD TO CART button in catalog search

I want ADD TO CART button in [search entire store] search box, when we are searching for any product. I am getting only name and price when i am searching for a product, i want add to cart button with ...
0
votes
0answers
23 views

Magento 2.3 OOM command not allowed when used memory > 'maxmemory'

I am using Magento 2.3 Instance and many times I am getting OOM command not allowed when used memory > 'maxmemory' error message while applying product filters on my site category pages. Steps to ...
0
votes
2answers
40 views

Magento 2 Passing parameters to Content Blocks

I'm new to Magento I want to create a block in the admin panel (Content > Elements > Blocks) which contains HTML code, CSS style, and some dynamic parameters under its content box. Example: <...
0
votes
1answer
29 views

Magento 2 - Does magento work with short_open_tag turned off?

We are using the PHP feature short_open_tag . A colleague does not like them and wants to remove them and turn the feature off. Does magento work with short_open_tag turned off?
0
votes
0answers
16 views

Circular dependency in Authorization class

Magento 2.4.2-p1 PHP 7.4 I've noticed that I get a fatal error allowed memory when I hit any Magento's rest API like rest/default/V1/guest-carts/zg9WgsI6iTxvcA9YzPQnWqDNr7CLYVy2/estimate-shipping-...
0
votes
1answer
25 views

Import brand products with csv

I am using venus theme brands extension for brands management. Now I want to import the products using brands. There is an option for importing brands using the CSV but I am not able to find any demo ...
0
votes
0answers
18 views

Magento_2.3.0 Message queue topic "inventory.reservations.updateSalabilityStatus" is not configured

After clicking the place order button I'm getting this error msg. can anyone have solutions? Message queue topic "inventory.reservations.updateSalabilityStatus" is not configured.
0
votes
0answers
20 views

making product name as url in sales/order/view page

for making product name as url in admin/sales/order view page i done this. file: app\code\Manoj\Productlink\view\adminhtml\layout\sales_order_view.xml <?xml version="1.0"?> <page ...
0
votes
0answers
8 views

How to use NTLM Authentication while consuming SOAP API

$soapClient = $this->soapClientFactory->create($wsdl, $options); $options = array( 'http'=>array( 'header' => 'Content-Type: application/xml', 'Soapaction: "urn:microsoft-dynamics-...
0
votes
2answers
53 views

Issue: Magento import limited to 100 records

It's been two weeks since I'm facing Registry key "movement_data" already exists error while importing a CSV file greater than 100 records. My Entity type is Products and, import behavior is ...
0
votes
0answers
12 views

Add New Sales Rule Action Logic

I need to add logic to a new action that I have added to the dropdown of a sales rule. Essentially I need to change the Buy X get Y Free rule so that it works differently. So I have added a new action ...
0
votes
1answer
25 views

Magento 2 : Can We Add Data From Custom Module to Core Database?

If I want to insert form data in to the "customer_entity" table How can we achieve that? I have mentioned all fields in the form as "create an account", and rather than creating a ...
0
votes
2answers
30 views

Do a action before insert products by endpoint magento 2

I wanna make a verification before inserting products on my Magento 2.3 in the default endpoint. Here is a sample: I post a product on rest/default/V1/products endpoint, but I want to check if this ...
0
votes
0answers
47 views

How to override Magento 2 graphql resolver with custom plugin

Im trying to override the resolver by using a plugin in Magento 2 to change text. vendor/magento/module-quote/Model/CouponManagement.php - I need to change this class ApplyCouponToCart implements ...
0
votes
1answer
40 views

How to disable Mega Menu on Magento2 Porto theme

I have one CMS page and I would like to disable the mega menu on it, but not the other pages? How can I do this? and I want to disable the buttons that I mention in the picture attached. Many Thanks!
0
votes
0answers
19 views

Error 500 - module error

We get a strange issue with, for me, it looks like it might be a missing closing tag, however, I can't see any missing closing tags. PHPerror.log: PHP Fatal error: Uncaught TypeError: strpos() ...
0
votes
1answer
43 views

Magento 2.4.4: Register is deprecated

I recently noticed the line $this->registry->register with register striked through. Mouseover displayed a message saying Register is deprecated. Could you please direct me to what is the ...
0
votes
3answers
61 views

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)?

I installed Magento 2.4.3 in ubuntu, but when I run the below command it gave me errors like, SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) Command: php bin/...
0
votes
1answer
34 views

Detect IE11 browser and show cms block modal with phtml script tag

I have a modal that pops up when the site detects it's on IE11. The modal is in a cms block so that the client can edit it. I have created a reference container with a custom phtml and put the script ...
0
votes
0answers
16 views

Magento 2 : Error Message Debug how not to abbreviate / truncate paths with

Not sure if this is Magento 2 or a general PHP question but I will have stack traces and sometimes those stack traces will abbreviate the full path of the class or filename with ... but I want to see ...
0
votes
1answer
33 views

Magento 2 : Override the Shipping Method Managment Model

I need to override the shippingmethodmagament.php file which is in the model file in the magento this path vendor\magento\module-quote\Model\ShippingMethodManagement.php but the interfaces is applied ...
0
votes
1answer
24 views

array_search() PHP fucntion not working on array

I am unable to have the array_search() working. I have a string from an API call in a variable $myresp [{"name":"product 1","order_id":1,"product_type":"...
0
votes
0answers
14 views

Set country of origin

there is a task to create an attribute country of origin and fill it in in accordance with the attribute country of manufacture, for example (Germany -> DE), and the question arose where to get the ...
0
votes
0answers
17 views

install Magento2 enterprise cloud extension on local

I have our Magento2.3.4 enterprise all downloaded onto my local mac. I do not have the site actually running on my mac just the files downloaded so I can git pull and push it up to the staging. My ...
0
votes
0answers
26 views

Magento 2.4.3 admin redirect from observer

I'm using Magento 2.4.3 and I'm trying to redirect from admin page to other. Below is my code, <?php namespace Mycompany\Mymodule\Model\Observer; use \Magento\Framework\Event\Observer; use ...
0
votes
0answers
19 views

Magento 2 | Flush catalog images in production mode

I updated the photos of the products already existing on my site in Magento2 and they are in production mode. Unfortunately I don't see the updated photos, not even when I clear all the cache so I ...
0
votes
0answers
11 views

Magento2 Need to connect Magento with Oracle

I need to get the Oracle data in my Magento env. Can someone please guide me on this? I tried to do with PHP OCILogon() but it gives Fatal error: Uncaught Error: Call to undefined function OCILogon() ...
0
votes
1answer
49 views

Magento 2 API Order Items, convert Json to table using php

I am tring to create a table dinamically with the products of a Magento order using API result. I have the following PHP code to dinamically generate a table with Json content $data = json_decode($...
0
votes
0answers
12 views

Magento 2 disable X-Frame-Options and use CSP frame-ancestors instead

We need one of our website available in a iframe on a different domain. The problem is that X-Frame-Options blocks the request and you can not use the * or ALLOW-FROM uri anymore. Please see link for ...
0
votes
0answers
11 views

Getting 400 bad request with GuzzleHTTP when trying to POST new product

I'm trying to use the /product endpoint but keep getting `400 Bad Request` response: {"message":"\"%fieldName\" is required. Enter and try again.","parameters":{...
0
votes
1answer
20 views

How to execute clientside javascript from php plugin file

Is it possible to call a frontend javascript function from a plugin php file? The js function should be executed in the browser. view/frontend/web/js/send.js function send() { console.log("...
0
votes
1answer
66 views

Magento 2: Get Product Collection With Multiple SKUs Filter

I'm trying to get product collection with multiple skus filter, don't know what I'm missing or doing wrong: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $...
0
votes
1answer
22 views

How can I get the url of my new module?

This is a simple Hello World in a Block, I would like how can I get the URL of this, to check the website this HelloWorld. I don't know to check my exercises, because I don't know how to get the URL ...
0
votes
3answers
34 views

Magento 2 css from php

Who can tell me how to change the link from PHP. $this->pageConfig->addPageAsset('') I already tried but not working. $this->getUrl('https://...') Thank you!
0
votes
1answer
22 views

magento 2.3.6 - Error: cannot call methods on priceBox prior to initialization

I try to add configurable options in a custom modal page (quick view). But when I open that modal I have the following error: Error: cannot call methods on priceBox prior to initialization and the ...
0
votes
0answers
23 views

Magento 2.3.5: Creating a custom category bottom toolbar

I'm trying to create a custom category bottom toolbar without the h1 title. I've done the following. Created a module with the following structure /app/code/Vendor/ToolbarBottom /app/code/Vendor/...
0
votes
0answers
19 views

Magento 2 import special with scheduled update dates via CSV

Good afternoon everyone, Apologies if this has been asked before but I have a site that I would like to import special price via CSV import but with scheduled update dates. I am aware that the only ...
0
votes
0answers
151 views

get magento to use Composer 2

I'm actually having this issue but first I want to resolve why it's still looking at Composer 1. me@server:/.../magentoproject$ sudo ./bin/magento sampledata:deploy [sudo] password for me: <warning&...

1
2 3 4 5
73