Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

Thank you for the M2DeletedProductImage solution, it worked perfectly for me. Found 354495 files 23,698.23 MB However this tool did not fix another issue I was looking the solution for. I have some entries in DB tables: catalog_product_entity_media_gallery catalog_product_entity_media_gallery_value catalog_product_entity_media_gallery-...


0

You can override prepareform() function as per the following code: First, You need to override the di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Vendor\ExtensionName\Block\Adminhtml\ABC\XYZ\Tab\...


0

This change needs to be made via php.ini as per the Magento documents there is currently no setting that will extend the session life of the cart. Within php.ini you need to modify session.gc_maxlifetime restart php and restart apache


0

Run This Command and Try :- sudo rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs pub/static/deployed_version.txt var/cache var/page_cache var/generation var/view_preprocessed var/session generated/code var/di sudo php bin/magento setup:upgrade sudo php bin/magento setup:static-content:deploy -f sudo php bin/magento cache:flush ...


0

When an attribute gets created with addAttribute() and a group is specified or the attribute should not be a user defined attribute, Magento will add the attribute to all attribute sets with the same entity type (catalog_product). I don't have any clue why, though. So if you would like to create a non user defined attribute you can first create the ...


0

Same issue here with magento version 2.3.1 It is Always Porto theme breaking my sites. My advice Porto Theme there is a Patch included for Magento. The file is called Patch for Magento 2.3.x.zip This will resolve your issues. Apply this patch please and after this you should be fine again. Step 1 download the latest Porto magento 2 theme package. step 2 ...


0

You could rewrite the class. Something like this. Depends on the level of change required though. di.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CatalogInventory\Model\Quote\Item\...


0

change it in i18n/en_US.csv "This product is out of stock." to your modified errorMessage if you want to add message on condition base please make after plugin: in di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> ...


0

It is necessary to think of the timezone, here is my answer ( {theme_dir}/Magento_Theme/templates/html/copyright.phtml ): <?php /* @var $block \Magento\Theme\Block\Html\Footer */ use Magento\Framework\App\ObjectManager; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; $year = ObjectManager::getInstance()->get( TimezoneInterface::class )->...


0

Let me do that for you with step by step.  First Step: Register your export button in your: view/adminhtml/ui_component/[grid-view-id].xml <exportButton name="export_button" class="Namespace\AdvancedReport\Component\ExportButton"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <...


2

The cause of such errors is hidden in the template files. In the following commented code 1 <?php //echo "this is an unwanted php code";?> there is no space between the semicolon “;” and the closing tag of php i.e. “?>” which causes the error. For the above code, when the HTML file is minified, the closing tag of php is considered as a part of the ...


0

You need to set image sizes in view.xml file inside your theme Code would be like this: <view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <media> <images module="Magento_Catalog"> <image id="bundled_product_customization_page" ...


1

Run php bin/magento cron:install [--force] Force rewrites existing Magento cron tab View the crontab by running crontab -l Run the crontab by bin/magento cron:run [--group="<cron group name>"] Omit the group to run crontab for all groups You must run cron twice. The first time to discover tasks to run and the second time to run the tasks ...


2

Add the Magento crontab php bin/magento cron:install Remove the Magento crontab You should remove the Magento crontab only before uninstalling the Magento application. bin/magento cron:remove Run cron from the command line bin/magento cron:run [--group=""] For more detail see Magento cron devDocs I hope it helps!


2

You can use: php bin/magento cron:install Above command will Generates and installs crontab for current user


1

I managed to find a workaround for this problem. I extend the \Magento\Catalog\Block\Product\ProductList\Toolbar class to overwrite the setCollection() function. By adding the call $this->getCollection()->getSize(); at the end of the function, before the return, somehow the Collection used in the toolbar.phtml template (which shows the pagination if ...


0

Had the same problem. Added a var_export to see what it was buzzy with. } catch (\Exception $e) { var_export($data); throw new InvalidTransitionException(__('%1', $e->getMessage()), $e); Then it returned some settings from my app/ect/env.php array ( 'default' => array ( 'dev' => array ( 'debug' => ...


1

To display product attributes in order history items and admin panel you need to create extra column in sales_order_item table. STEP1: In your Vendor\Module\Setup\UpgradeSchema.php <?php namespace Vendor\Module\Setup; use Magento\Framework\Setup\UpgradeSchemaInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Framework\Setup\...


0

Review https://magento.stackexchange.com/a/222428/45214 on how to create a form and save that data in database in magento 2.


0

Create a controller in your Vendor/Modlue/Controller/Index <?php namespace Vendor\Module\Controller\Index; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\App\Action\Context; use Vendor\Module\Model\YourModel; class Blog extends \Magento\Framework\App\Action\Action { protected $model; protected $date; protected $...


0

I tried Himanshu's answer but it didn't work for me but this one worked: <settings> <switcherConfig> <rules> <rule name="0"> <value>0</value> <actions> <action name="0"> <target>vendor_module_form.vendor_module_form.general.field&...


1

As you have seen there are lot of Js files which are being requested from the server which slows down the rendering process of checkout . I tried in built option of js bundling but that wasn't useless at all After doing bit of research i found there is option to do js bundling using require js which bundles all the required js and html(knockout template ...


1

Try the following way: app/code/SR/MagentoCommunity/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogInventory\Model\StockStateProvider"> <plugin name="...


2

override vendor/magento/module-customer/i18n/en_US.csv In your theme and put "Sign In","test in" What you need if above not working then override authorization.phtml in your theme like this and put code as below: app/design/frontend/Test/testnew/Magento_Customer/templates/account/link/authorization.phtml <?php /** * Copyright © Magento, ...


2

You can use jQuery events like below method will work <script> require(['jquery', 'jquery/ui'],function($){ jQuery('#nbrbox').on('input', function(){ var nbrbox = document.getElementById('nbrbox').value; var qtybox = parseFloat(document.getElementById('qtybox').textContent); var qtysquare =(Math.round(nbrbox*...


1

Default Charset is set in Theme configuration, You can find in the below file path vendor/magento/module-theme/etc/config.xml If you want to change this, override the file into your custom theme, app/design/frontend/[Vendor]/Theme/etc/config.xml You can change the setting in this file. Flush cache and check it.


2

You should use name instead of element in your xml <referenceBlock name="register-link" remove="true"/>


1

Got the solution, Changes need to dataProvider file. public function getData() { if (isset($this->_loadedData)) { return $this->_loadedData; } $items = $this->collection->getItems(); foreach ($items as $item) { if ($item->getDefaultImage()) { $img['default_image'][0]['name'] = $item->...


1

1 .Set System - Configuration - Catalog - Inventory - Stock Options - Display Out of Stock Products to Yes. 2.Set System - Configuration - Catalog - Inventory - Product Stock Options - Backorder to Allow Qty Below 0.


1

Stroes -> Configuration -> Catalog -> Inventory Click on Product stock Options Tab.


0

You can check the Customer Block Class in: Magento\Customer\Block\Account\Customer.php


0

Go to below file app/design/frontend/[VendorName]/[theme]/Magento_Checkout/templates/cart/item/default.phtml if above file not your theme then override in your theme after change and find this code like : <?php if ($block->hasProductUrl()):?> <a class="cart-product" href="<?= /* @escapeNotVerified */ ...


0

First you need to add the following to your config.xml under the <config> tag: <frontend> <layout> <updates> <expressdelivery> <file>expressdelivery.xml</file> </expressdelivery> </updates> </layout> </frontend> Then you need to ...


0

In your block file Add below code : public function getOrderItems() { $order_items = []; foreach ($_order->getAllVisibleItems() as $_item) { $order_items[] = $_item; } return $order_items; } In your phtml file add below code : $productCollection = $block->getOrderItems(); $viewMode = 'list'; $_imageHelper = \...


2

add the docblock to the __construct method and type hint as string the following $name, $primaryFieldName, $requestFieldName. /** * @param string $name * @param string $primaryFieldName * @param string $requestFieldName * @param array $meta * @param array $data * @param OutfitCollectionFactory $outfitCollection * @param Http $request * @param ...


0

You will have to either purchase third party extension or upgrade. General info found here. https://docs.magento.com/m2/ce/user_guide/catalog/inventory-merchant-type.html


1

Your path seems wrong. You forget to add the "frontend" folder name. Vendor/Module/view/frontend/templates/product/view/type/default.phtml Please change it and try again. Follow this github.com/emizentech/


0

Just create the attribute with the attribute_code you'd want, then go to the eav_attribute table, search for your attribute_code, and change its ID to your desired one. UPDATE eav_attribute set attribute_id = YOUR_ID where attribute_code = 'ATTRIBUTE_CODE' There should not be any problem, magento has foreign keys for eav attributes, the only problem ...


0

Your custom theme is extending luma theme. By default in luma theme, Continue Shopping and Clear Shopping Cart are available but hide using CSS. You need to inspect in browser search for class action continue and remove display: none; Hope above will help!


0

If you would like to modify orders, you should update quote and order. Edit items: $item = $quote->getItemById($id); if(!$item) return; $taxAmount = $item->getTaxPercent() * $qty * ($item->getProduct()->getPrice()/100); $rowTotalInclTax = $item->getPrice() * $qty + $taxAmount; $item ->setQty($qty) ->...


0

A better way could be public function match(\Magento\Framework\App\RequestInterface $request){ if (!$this->dispatched) { $identifier = trim($request->getPathInfo(), '/'); if (strpos($identifier, 'matinteg/orders') !== false) { $request->setModuleName('cms')->setControllerName('integration')->setActionName('integration'); ...


1

app/code/VendorName/Catalog/view/frontend/layout/catalog_product_view.xml <?xml version="1.0"?> <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.info.addtocart"> ...


0

module.xml :- <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="VendorName_ModuleName" setup_version="1.0.0"> <sequence> <module name="Magento_Catalog"/> ...


0

You should return following code: return parent::_prepareLayout(); So _prepareLayout method looks like: protected function _prepareLayout() { // your modification return parent::_prepareLayout(); }


0

Whenever i run into issues on a dev server i found the best way would to fix is to first find out which user and group Magento is running under, navigate to another folder (not one with permission issues) and do : ls -la Check the columns for user and group on the correct files and then fix the permission on the problem folder by applying those same ...


0

You can try with fileUploader <field name="outfit_image"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">string</item> <item name="source" xsi:type="string">source</item> ...


1

Just as an FYI, I thought setup:upgrade had frozen on me because there was no output but it eventually finished after a good 15 minutes. Might be worth leaving it for an hour or checking disk activity if you think it's frozen.


0

You need to create an admin configuration field for "Button position" with 3 values consisting of the name of the three blocks added in your xml file ('test1.tab', 'test2.tab'and the third one) Then, your xml should look like: <referenceBlock name="product.info.addtocart"> <block class="Vendor\Module\Block\CustomButton" name="test1.tab" template=...


0

Try this, it seems to be working http://www.webspeaks.in/2016/05/magento-2-add-products-grid-to-custom-admin-module.html


0

free extension https://landofcoder.com/magento-2-advanced-reports.html OR I used this module https://github.com/degdigital/magento2-customreports/ and customize to my needs.


Top 50 recent answers are included