17
votes
Accepted
Errors during compilation: AbstractConfigOption.php
Since approx. 2hrs there is a pull request for symfony/console. This will fix that issue.
https://github.com/symfony/console/pull/75
14
votes
Errors during compilation: AbstractConfigOption.php
I had the same problem tonight. I did a trace to find out which module is causing the problem. I had to downgrade symfony/console to get it to compile.
composer require symfony/console=4.4.26
After ...
11
votes
Errors during compilation: AbstractConfigOption.php
A temporary fix that I have done taken backup of vendor/symfony/console/Input/InputOption.php file and modify it.
After line 48 replace the comment as below before constructor:
/**
* @param ...
3
votes
Magento2 EE pagebuilder settings not workiing on custom entity
In my case I needed to add update handles for styles and editor for the layout file:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
2
votes
Accepted
Magento 2 - Does magento work with short_open_tag turned off?
Yes*.
To try this out I turned off short_open_tag and ran through a few different tasks on a local instance and everything is fine. There are also 0 instances of the short open tag (on my local ...
2
votes
Accepted
How can I add PHPExcel_IOFactory in my custom module class in Magento 2?
Did you install the package with composer first? Also that library seems to be discontinued (https://packagist.org/packages/phpoffice/phpexcel) and replaced by https://packagist.org/packages/phpoffice/...
2
votes
Errors during compilation: AbstractConfigOption.php
I faced this issue too, downgrading symfony/console works.
composer require symfony/console=4.4.26
2
votes
Price on product detail page changed to 0.00 magento 2.4.3-p1
I guess you are struggling with a Bug in Magento 2.4.3 which is discussed in a couple of Magento tickets on GitHub (e.g. https://github.com/magento/magento2/issues/33798 )
Solution would be either a ...
2
votes
Accepted
Magento 2: Add class to body from PHP
You can achieve your requirement by following steps:
Step 1. Create registration.php under
app/code/M2Expert/Classes/registration.php
with below content:
<?php
\Magento\Framework\Component\...
1
vote
Accepted
Magento 2 - Category url load very slow
Generally Category pages or any page will be slow if following not taken care of :
From TTFB perspective or server execution time.
Varnish or Full Page cache is used.
Also to make sure no block is ...
1
vote
Magento 1.9 set exisiting address as default billing and shipping address
Try this code :
if(trim($data['postcode']) !='')
{
$customerAddress = Mage::getModel('customer/address');
$customerAddress->load(trim($data['id']); //ID means address Id
$...
1
vote
Accepted
Magento 2 get tax class id by product in website scope
You can check this code :
$product = $this->getProduct();
$resource = $product->getResource();
$store = $this->_storeManager->getStore();
$resource->getAttributeRawValue($product->...
1
vote
Accepted
Change order status for custom module
create app\code\Vendor\Extension\etc\events.xml with the following code.
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
Accepted
Issue: Magento import limited to 100 records
The problem is that your code is trying to overwrite a registry value, and this causes an error in Magento. Look for every instance in your codebase where register('movement_data') exists (both single ...
1
vote
Accepted
Do a action before insert products by endpoint magento 2
I think what you're looking for is catalog_product_save_before. This event gets called for every product save action, including new products.
In order to use it you could do the following in your ...
1
vote
Do a action before insert products by endpoint magento 2
For this one you need to understand the magento flow.
Your above API call this service class.
<service class="Magento\Catalog\Api\ProductRepositoryInterface"
method="save"/&...
1
vote
Accepted
Detect IE11 browser and show cms block modal with phtml script tag
Scripts in CMS Blocks sounds like something that Magento would block.
If it is just the content of the "dontuseie" block that needs to be admin-editable, you could:
Render that block in a ...
1
vote
Accepted
array_search() PHP fucntion not working on array
You must use json_encode with the second parameter set true, so that it returns an associative array otherwise it will return an array of objects. In your case it will return a multidimensional array.
...
1
vote
Accepted
How can I get the url of my new module?
Your module URL will load based on the "BaseUrl/frontName/controllerName/actionName"
So as per your module code,
frontName = unit3helloworldblock
controllerName = Block
actionName = Index
...
1
vote
Accepted
magento 2.3.6 - Error: cannot call methods on priceBox prior to initialization
It sounds like the PriceBox jQuery widget hasn't been initialised yet.
From looking through the code it appears this is how it is initialised on the product page:
<script type="text/x-magento-...
1
vote
Accepted
Magento 2 Insert / Move page.main.title inside my custom block
use getChildHtml('page.main.title'); to display it in your block "my.block"
echo $block->getChildHtml('page.main.title');
OR add it after tag
<referenceBlock name="page.main....
1
vote
Accepted
Magento 2.4 - PayPal Smart Button Style
No need to create preference, we can use type
create:
app/code/Vendor/Extension/etc/di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=&...
1
vote
Accepted
Magento 2 - How I can rewrite this file
create di.xml file on following location
app\code\Vendor\Extension\etc\frontend\di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
1
vote
Magento 1.9 update street adress line 2 via PHP
to update Street1 and Street2 fields you just need to provide an array:
$address->setStreet(['123 Main Street', 'Street 2']);
1
vote
Magento2: Importing additional images programatically - PHP error
Final code looks like this now, thanks! Still getting the other error though, but I will mark your answer as correct and post another question. Think it's permissions.
<?php
ini_set('...
1
vote
Magento 2 | Item with the same ID already exists when join tables
My solution was different because I really needed that duplicates.
I removed the original ID field from the request (by removing all the columns from the select):
$select = $collection->getSelect();...
1
vote
Accepted
php.ini on magento cloud readonly
For magento cloud, the production is in read-only mode. You have to change & push the codechanges from lower environments (staging, integration, etc) into production.
Another option is to set the ...
1
vote
Magento 2.4.2 composer install PHP extension errors
In case anyone searching for php8.1 ヅ
sudo apt-get install php8.1-opcache php8.1-pdo php8.1-calendar php8.1-ctype php8.1-dom php8.1-exif php8.1-ffi php8.1-fileinfo php8.1-ftp php8.1-gettext php8.1-...
1
vote
\Magento\Framework\Registry deprecated in magento 2.3, How to create instance with Registry?
The correct way of getting the current product on PDP page without using registry class is to use Catalog Helper class.
public function __construct(
\Magento\Catalog\Helper\Data $catalogHelper
...
1
vote
Magento 2.1 update special price dates programmatically
The following code should do the trick -:
$dateValue = '2022-04-08'
$value = date('Y-m-d', strtotime($dateValue));
/* Magento\Catalog\Model\ProductRepository */
$product = $this->...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
php × 3712magento2 × 1429
magento-1.9 × 1026
database × 223
javascript × 184
magento-2.1 × 169
magento-1.8 × 145
magento-1.7 × 142
magento2.3 × 140
product × 134
module × 118
html × 101
error × 91
checkout × 88
category × 85
magento2.2 × 82
xml × 81
admin × 80
phtml × 66
api × 64
attributes × 62
event-observer × 60
layout × 59
customer × 55
cart × 54