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
1answer
11 views

Error with file to bring magento site to local

I am working on a magento site that I brought to local. I have already created my virtualhost, but when I run my code I get the following error. Warning: require(C:\xampp7.3\htdocs\euro\vendor\...
0
votes
1answer
20 views

How to save uploaded images in a custom folder of pub media in magneto 2?

I want to provide a provision for uploading an image the image, should move/save to the custom folder which I have created in pub/media please be specific while explaining the code it will help me a ...
0
votes
0answers
8 views

I have to get the value '77203' of the attribute code 'country flag' in magento2 .The code I have written is given below Can anyone help

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $entityAttribute = $objectManager->get('Magento\Eav\Model\ResourceModel\Entity\Attribute'); $val= $entityAttribute->...
0
votes
0answers
8 views

Magento 2 filter products collection by category and other attributes using filterBuilder

I'm trying to use a product repository to fetch a list of products. I want to fetch based on multiple filters (category_id, name, description and short description), combined with an OR criteria, but ...
0
votes
1answer
8 views

How can I get the value '77203' using the attribute code 'country_flag' using php

getAttribute('country_flag'); ?> getData('value'); ?> getViewFileUrl('images/flags/usa.jpeg'); ?>" /> getViewFileUrl('images/flags/vu.png'); ?>" /> getViewFileUrl('images/flags/AU....
0
votes
0answers
6 views

Update attribute value by Magento curl in observer

Hii. I want to update attribute value by magento curl in observer of product save after event in Magento 2.3 But now with my code, i am getting an decoding error message, while print the response in ...
0
votes
1answer
22 views

How can I make an order as paid after order status complete

I'm facing a problem with the payment gateway after the order is paid by the gateway most of the time the order status will be complete and no invoice is created and not registered as paid. Is it ...
0
votes
0answers
12 views

PREVENTING USING STOLEN CREDIT CARDS

Is there any way to prevent stolen credit cards on my website Magento 2.4. I use authorize.net for cards payment, I had received a $400 payment for my products to ship in the USA. But after I shipped ...
0
votes
1answer
18 views

Magento 2: Create order without cart

I have a requirement to implement Google Pay in PDP. Like Buy with GPay in PDP. So once user click Buy Now with GPay button then we are adding that product to cart and once payment is done then we are ...
0
votes
1answer
21 views

Pulling product price to new block

I have added a new block to my product page. In the block i want to display the product price so I can then take that price and divide it by 3 to show monthly payments. I have tried to get the price ...
0
votes
2answers
36 views

How to Store html value in PHP variable?

<?php $test = '<div> <form class="form-outofstock-notify" id="product-notify-form" method="post" data-mage-init='{"validation":{}}'> <input ...
0
votes
2answers
34 views

Magento 2.4: What is the alternative to storing order object in custom code as 'registry' is deprecated.?

Our Magento store is running community version 2.4.2. I noticed 'registry' is deprecated.intelephense(1007) notice at several lines in many files. Below is a screenshot of a part of a file that has ...
0
votes
1answer
20 views

Magento2.4: https://search.google.com/test/rich-results tool doesn't validate the breadcrumbs properly

the results of testing the URL https://www.perfectmakeupmirrors.com/aamsco-unico-3-with-double-vertical-bands-of-led-lighting.html with the tool https://search.google.com/test/rich-results don't seem ...
0
votes
1answer
50 views

Problems with images in frontend

We have problems with images in frontend side. PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Block\Product\ImageFactory::create() must be an instance of Magento\Catalog\...
0
votes
0answers
43 views

Magento 2 GraphQL How to update custom row

Using Magento 2.4.3 Graphql Able to get, insert and delete a row from the custom table but unable to update(edit) custom row... custom endpoints - mutation { updateCustomMedia(id:7, input: { ...
0
votes
1answer
22 views

Assign the guest quote when customer login into the checkout page

I want to remove the customer quote when the guest customer login into the checkout page then guest quote is assigned to the customer. Please suggest me how can I delete the customer quote and assign ...
0
votes
0answers
19 views

Magento 2: Problem with plugin for Magento\Framework\App\Response\Http

i am trying to create a plugin for class Magento\Framework\App\Response\Http for beforeSendResponse and do some actions like session setter.. but it did not work as expected. The code run several ...
0
votes
1answer
50 views

Call to a member function getResponse() on null in observer while generating the shipment in magento2.4.3

<event name="sales_order_shipment_save_before"> <observer name="test_beforeshipment" instance="Module\ModuleName\Observer\BeforeShipment" /> </event>...
0
votes
0answers
13 views

Magento 1.9 core seesion message vanishing on home page

I'm setting a message to the core session from the controller and redirecting to the home page Ex - $session = Mage::getSingleton('core/session'); $session->addError('This is test message'); $this-&...
0
votes
0answers
28 views

Magento 2.4.3 | TypeError | While Making Shipment & Tracking

I'm using Magento 2.4.3, my code works fine on Magento 2.3.5, after the upgrade I got this error when I try to make shipment & tracking: [2021-12-15 11:11:34] report.CRITICAL: TypeError: Argument ...
0
votes
1answer
23 views

PHP Array Unique on exploded Keywords from MySQL problem

I'm trying to echo keywords from a MySQL database, separated by colon, and remove (don't show) duplicates. This is what I got. Keywords in DB Love:Sorrow:Death Happiness:Love:Excitement Excitement:...
0
votes
0answers
16 views

Magento 2 - Submit form to current page

I'm trying to launch a form with an action pointing to the same page. The form can be found on the details page of the customer's order: www.mysite.com/sales/order/view/order_id/255/ This is my code ...
0
votes
1answer
19 views

Magento 2 Array to string conversion in lib/internal/Magento/Framework/Data/Form/Element/Select.php on line 135

I am running Magento 2 CE 2.4.2 and I am facing issue each time I am deleting a product, I cannot access the product catalog from admin backend and I get this error : Exception #0 (Exception): Notice: ...
0
votes
1answer
25 views

Magento 2.4 - Send email with attachments

I am trying to send the emails with the attached files but I am not succeeding. For the moment this is my code: <?php namespace PHPCuong\CustomerAccount\Helper; use Magento\Framework\App\Helper\...
0
votes
1answer
23 views

Magento 2.4.2: How to add Yotpo reviews carousel code in specific category pages?

We've been able to display Yotpo reviews carousel on the homepage of our Magento store. But I need to display that also on a few specific category pages. I'm not sure where to add the following code ...
0
votes
1answer
17 views

magento2 add address to customer via cli

Using Create new customer using CLI like admin approved method as a base I have been pulling my hair out on how to extend it so I can also add an address to the created user via CLI. any assistance is ...
0
votes
1answer
22 views

Magento 2: Custom Checkout Field Validation

I have a module already built for ExtraFee, I just want to add the checkbox below for terms & conditions so I found a template and added a checkbox like this: <div class="field amexfee-...
0
votes
0answers
20 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
13 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
33 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
3answers
126 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
17 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
11 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
22 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
23 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
16 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
34 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
35 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
31 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
47 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
32 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
21 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
26 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
29 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
26 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
19 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
81 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
13 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 ...

1
2 3 4 5
74