Skip to main content

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
2 answers
29 views

after upgrade magnento 2 version 2.3.4 to 2.4.6-p6

recently i was upgrade magento 2.4.3 to 2.4.6-p6 for upgrade i fired below cmd composer require magento/product-community-edition 2.4.6-p5 --no-update composer update --ignore-platform-reqs after ...
Bhagyesh Bhalodiya's user avatar
0 votes
0 answers
25 views

Display Stock on product widget

I am using magento 2.4.6 with martfury theme. I want to display stock level on product that's displayed via widget. Also, I have MSI enabled for the store. I am using the below code to display the ...
Yukti Dogra's user avatar
0 votes
1 answer
28 views

How to get from_date and to_date of cart_rule and catelog_rule in magento 2?

I'm writing a before plugin and i need to get from_date and to_date of cart_rule and catelog_rule in my plugin code namespace Vendor\CouponBeforePlugin\Plugin; use Magento\Quote\Model\Quote\Item\...
Midhun M's user avatar
0 votes
0 answers
8 views

how to customise sorter.phtml in magento2?

i need to customise the magento2 component sorter.phtml so that it displays all available options in a list (instead of a select element) and each element in the list has its own asc and desc arrows. ...
media.queeries's user avatar
0 votes
1 answer
29 views

Call to an undefined method Magento\Quote\Model\Quote\Address\Rate::setCost()

<?php namespace Ravedigital\Custom\Model; use Magento\Shipping\Model\Rate\Result; /** * Class Checker * * @category Ravedigital * @package Ravedigital_Custom */ class Carrier extends \...
Shubham Nigam's user avatar
0 votes
1 answer
27 views

Magetno 2 how to send the request of place order when user checked on the check box of terms and condtion

I have changed the checkout process into 4 steps Adress Shipping Payment methods and agreement Summary and place order button everything is working fine accept the terms and condition. I have put ...
Harris's user avatar
  • 1
0 votes
1 answer
20 views

pre order on the category page

How to change the label of add to cart to pre order on all magento 2.4.5 based on the below conditions: if(qty<0 , product is salable and getBackorders()/true ) to show pre order else add to cart. ...
L.A's user avatar
  • 1
0 votes
1 answer
20 views

Magento2 - How to customization of the invoice pdf deign using php not using phtml

example for this // Add "INVOICE" text above the barcode $font = \Zend_Pdf_Font::fontWithName(\Zend_Pdf_Font::FONT_HELVETICA); $page->setFont($font, 26); $page->setFillColor(new \...
Alan Biju's user avatar
0 votes
2 answers
31 views

Single store vs Multi store in Magento 2?

We already have a website built using magento 2.0. where in we have an existing product category.Now we have a new requirement where we plan to add a new product type , very different from existing ...
user3653787's user avatar
0 votes
1 answer
21 views

How to create a cron job for out of stock

How to create a cron job for out of stock that must daily run and check how many products are out of stock
Alan Biju's user avatar
0 votes
1 answer
23 views

Magento 2 How to create order on user demand

Hi I have one requirement where user visit on the website and upload their product image(Like some tool image, Some kind of machinery part etc.) and select some attribute like size,colour,material etc ...
Ajay Tiwari's user avatar
0 votes
1 answer
32 views

Error: Call to a member function setActive() on bool in /var/www/html/project.local/vendor/magento/module-backend/Model/View/Result/Page.php:26

showing this error while clicking on a menu item created for a grid, the code below is my controller <?php namespace Vendor\Grid\Controller\Adminhtml\Grid; class index extends \Magento\Backend\...
Midhun M's user avatar
0 votes
1 answer
51 views

How to add a PhoneNumber field in Minicart in magento2

I need to save this phonenumber on quote_item table in phoneno coloumn (I add the extra coloumn through upgradeschema.php). I want to update this phonenumber as how the Quantity of a product is ...
Thoubik's user avatar
  • 128
0 votes
0 answers
16 views

Get product attributes values for out of stock products in elastic search without changing 'display out of stock' configuration setting to yes

So I want to get product's attribute value to work on if it is set to yes but product is out of stock so it is not shown on the frontend. One solution is to change 'display out of stock' configuration ...
Raj Pawan Shukla's user avatar
0 votes
0 answers
18 views

Magento 2.4.6 calling createOrder() causes exception with elasticsearch

In one of my scripts, calling createOrder() ( from vendor/magento/module-sales/Model/AdminOrder/Create.php ) causes an exception: {"error":{"root_cause":[{"type":"...
jonny5556's user avatar
0 votes
1 answer
19 views

Uncaught Error: Call to a member function getEndpointUrl() on null in /home/magento/backend/app/code/Wac/InstagramFeed/Model/Api/AbstractApi.php:124

the above image The getendpointUrl getting null public function getEndpointUrl(): string { return $this->getStoreConfigValue(self::XML_PATH_INSTAGRAM_API_ENDPOINT_URL); } ...
Alan Biju's user avatar
0 votes
1 answer
31 views

Get SKUs of all bundled product items Magento 2.4.6

Get SKUs of all bundled product items Magento 2.4.6 I have a bundled product, let's call the sku BundledProduct. I have 3 products that can be selected to be bundled with BundledProduct. Let's call ...
user115044's user avatar
0 votes
0 answers
38 views

Magento2 How to get Use auto generated coupon by website wise.?

// For all websites $websites = $this->_storeManager->getWebsites(); foreach ($websites as $website) { $websiteUrl = $website->getDefaultStore()->getBaseUrl(); $url = $websiteUrl . ...
Magecomp Product Team's user avatar
0 votes
1 answer
34 views

An error with Magento 2 Admin panel page/Unable to access the admin page

When logging into my admin panel it's throwing the error below, causing me to be unable to access the admin panel. 1 exception(s): Exception #0 (InvalidArgumentException): Item with identifier ...
David Gupta's user avatar
0 votes
0 answers
32 views

create a reslover and graphql query for city and area

my current resolver is my current graphql schema is Iam looking for a graphql schema and resolver that if i select a city then all the area will display can you give me graphql query also and what ...
Alan Biju's user avatar
0 votes
0 answers
42 views

Magento2 how to get two tables data in my custom grid.?

I want to get data as name from salesrule table code from salesrule_coupontable. Here I attached the salesrule and salesrule_coupon table in which I want to get code column data. In the salesrule ...
Ekta's user avatar
  • 101
0 votes
1 answer
36 views

How to get absolute path from category in megamenu?

i'm using the MageDelight Megamenu extension for a website with different stores in different countries, ex: mystore.com/en_uk/ mystore.com/en_us/ While creating the menu in admin i put the ...
media.queeries's user avatar
1 vote
1 answer
37 views

Magento 2.4.6: $_isFixed must not be defined error in custom shipping module

I have coded a custom shipping module for Magento 2.4.6 according to Adobe's documentation here: https://developer.adobe.com/commerce/php/tutorials/frontend/custom-checkout/add-shipping-carrier/ I am ...
user86226's user avatar
0 votes
3 answers
97 views

How to hide admin product form tabs for specific admin user?

I want to have an admin user who would only be able to view the 'Images And Videos' and 'Search Engine Optimiation' in the admin product edit form. I tried the following. Created app/code/Vendor/...
Aniruddha Ray's user avatar
1 vote
1 answer
35 views

Magento2: I'm getting empty data from the product attribute

I am receiving empty data from the product attribute "product_types" & getting a null value when fetching the data from this attribute.
Alan Biju's user avatar
0 votes
0 answers
9 views

In magento, how can we bring the swatch options of a configurable product and it's corresponding image url's in an array?

I need to bring the swatch options of a configurable product and its corresponding image url's stored in an array in PLP page in magento. How can I do that? I got an empty image url array while trying....
Farseen's user avatar
0 votes
1 answer
42 views

How can I sort is not saleable products in the end of category

I need products that are out of stock (!$_product->isSaleable()) to be displayed at the end of the category list in the catalog (frontend part) Magento v 2.4.2
WhoYou's user avatar
  • 53
0 votes
0 answers
48 views

In Store Delivery sources show regardless of product stock status

I have come across an issue in Magento 2.4.6 p3 that appears to be a bug, https://github.com/magento/magento2/issues/37992 When using the In Store Delivery option if a product is out of stock you ...
miller75's user avatar
  • 409
0 votes
1 answer
44 views

Magento\SwatchesGraphQl\Model\Resolver\Product\Options\DataProvider\SwatchDataProvider does not exist

Magento\SwatchesGraphQl\Model\Resolver\Product\Options\DataProvider\SwatchDataProvider does not exist the error while i using php bin/magento s:d:c
Alan Biju's user avatar
0 votes
1 answer
117 views

when creating database showing error The default website isn't defined. Set the website and try again

sudo php bin/magento setup:install --base-url=http://oxygen.local --db-host=localhost --db-name=oxygen –db-user=root --db-password=Root@123 --admin-firstname=admin --admin-lastname=web --admin-email=...
Alan Biju's user avatar
0 votes
1 answer
166 views

Magento 2.4.6 Localhost Install Windows 11

I am having issues installing Magento2 on my local machine. I have been following this tutorial but I run into the same issue where my localhost/magento2/pub/ page doesn't display content. I have been ...
Kage Dev's user avatar
0 votes
1 answer
39 views

unable to update custom attributes to product using rest API

I have created the custom attribute through rest API and it is also reflected in magento admin, after which when I tried to update the product with the attribute code.it won't worked. Below is my ...
manikandan.p's user avatar
0 votes
1 answer
32 views

Update custom attributes to product using rest

$data = [ "product" => [ "sku"=> $productsku, // "attribute_set_id"=> 4, //"attribute_set_id" => $mage_attr_set_id, ...
manikandan.p's user avatar
0 votes
1 answer
31 views

Magento2: We have unassigned an attribute from the attribute set but it is still showing on the frontend

I have different Attribute Set Name they are tv,laptop and watch I have unassigned Ram in attribute in watch and Tv and assigned attribute in Laptop but it showing Ram in Watch(attribute) and Tv and ...
Alan Biju's user avatar
0 votes
2 answers
60 views

I'm getting empty array without using session object. How we can get cart data without using session object

I'm getting empty array without using session object. How we can get cart data without using session object. Here is the screenshot: Here is the code: $cartItems = $this->cart->...
Alan Biju's user avatar
0 votes
0 answers
41 views

Broken reference: the 'product.reviews' element cannot be added as child to 'product_tabs', because the latter doesn't exist

Broken reference: the 'product.reviews' element cannot be added as child to 'product_tabs', because the latter doesn't exist
Alan Biju's user avatar
1 vote
2 answers
141 views

Magento2: Experiencing a problem with currency loading on PDP page

We are experiencing an issue with one of the store PDP page, where the currency sign is not showing after the page loads. During PDP page loading, the currency symbol is displayed, but after ...
Deepak MageDivine's user avatar
0 votes
1 answer
47 views

Magento 2.4.6: Order confirmation email configurable product custom attribute returns parent value instead of child

I'm trying to add a custom product attribute 'renewal' to the order confirmation email. I have several configurable products and they are returning the parent product attribute value rather than the ...
Michael Meyer's user avatar
2 votes
1 answer
107 views

How can I "debug" my Magento website to find out why some text is there/not there?

first, a picture with some explanations. Then some questions... The question is, can I somehow find out why the Text "Ab" is missing in some cases (when I initially load the website). With ...
Kai Mechel's user avatar
0 votes
1 answer
192 views

Invalid entity_type specified: customer

sudo php bin/magento setup:install --base-url=http://vstar.local --db-host=localhost --db-name=vstar --db-user=root --db-password=Root@123 --admin-firstname=alan --admin-lastname=wac --admin-email=...
Alan Biju's user avatar
1 vote
1 answer
102 views

Using if statement in phtml

Would like to put an if statement in the below code as follows. If saleable qty <=0 (equals 0 or under), add CSS. Otherwise, add different CSS <div class="left-stock"> <...
Shaun's user avatar
  • 109
0 votes
2 answers
59 views

Difficulty Overriding Magento 2 File

I am new to coding in Magento 2. I am trying to override a file using this guide https://webkul.com/blog/overriding-rewriting-classes-magento2/, and my file compiles without error, but changes don't ...
Jack's user avatar
  • 3
0 votes
0 answers
27 views

Upgrading Old Installation and Server. Magento 2.3.4 to 2.4.6

I have an old Ubuntu server that I need to update along with everything else as its been neglected for many years. Some Server Details are: Ubuntu 16.04.4 LTS PHP is 7.2.24 Magento version is 2.3.4 I'...
07lodgeT's user avatar
1 vote
1 answer
89 views

Magento 2 Command Not working

Earlier My site was working properly but suddenly it threw the below error. Also, When I tried to run the command it threw the below error. Can anyone give us a solution on How to fix it? and run ...
Keval Chauhan's user avatar
1 vote
1 answer
54 views

Not Display Product Name in the Email template?

module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/...
Thoubik's user avatar
  • 128
0 votes
0 answers
37 views

Custom Variable get dynamic value based on Realtime condition magento2

I have Create the custom variable programmatically like below. updating custom variable value programatically Ex. I have created the current_time variable now I insert the variable in the email ...
Jigar Jansari's user avatar
0 votes
1 answer
47 views

main.CRITICAL: Error: Call to a member function isVirtual() on null

I am having this strange error filling my cron logs: main.CRITICAL: Error: Call to a member function isVirtual() on null from file magento/module-sales-rule/Model/Rule/Condition/Address.php line 177 ...
G. G.'s user avatar
  • 1,142
1 vote
2 answers
832 views

Argument #1 ($storeId) must be of type int, string given error

I am having a feed which is run every night with crons. My instance is magento 2.4.6-p2. I am using this function to get store id: public function execute() { foreach ($this->...
G. G.'s user avatar
  • 1,142
0 votes
0 answers
33 views

how we can get custom product grid in magento 2

I have tried to create a product grid custom extension but product grid filter is not working and I am not able to save data this is my code: <?php namespace Magebees\Artists\Block\Adminhtml\Slide\...
Arun Suryavanshi's user avatar
0 votes
0 answers
26 views

Adding additional price to product

I want to add additional prices to a specific product such as courier charges. How do i do that in Magento 2 when I only have Flat Rate, Free Shipping and Table Rate? Without needing a plugin I mean. ...
sarmad95's user avatar

1
2 3 4 5
77