New answers tagged

0

Do you have simple product or configurable or downloadable product ? because, COD will not show in downloadable or virtual product. Just check and let me know.


2

You should do that. <!-- ko if: totals()['subtotal'] < 29.95 --> <span class="shipping-cost"><!-- ko i18n: '$ 5,95' --><!-- /ko --></span> <!-- /ko --> <!-- ko if: totals()['subtotal'] > 29.95 --> <span class="shipping-free"><!-- ko i18n: 'Free' --><!-- /...


0

What you have described is a featured product extension https://github.com/DominicWatts/Featured All you need to do is rename code and label of attribute to coming soon Or keep attribute label and code the same. Just change the title on the widget and / or landing page. Update The extension contains logic to create attribute code, landing page and allow ...


1

Make this configuration in your custom attribute : Admin -> Stores -> Attributes -> Product > Select your attribute -> Storefront Properties -> Set "Used in Product Listing" to Yes Reindex all In your product/list.phtml : <?php foreach ($_productCollection as $_product): ?> ... <div class="discount-percent"> <...


0

Try this way Some of the functionalities in Magento 2.3.x is different from previous version. The reason is that in most cases the 2.3.x framework uses Zend Framework 2 (ZF2) and almost totally refuses to applyZend Framework 1 (ZF1). Magento\Framework\Mail\MailMessageInterface::createAttachment() So, due to this, the previous method is deprecated and ...


0

Try this way Some of the functionalities in Magento 2.3.x is different from previous version. The reason is that in most cases the 2.3.x framework uses Zend Framework 2 (ZF2) and almost totally refuses to applyZend Framework 1 (ZF1). Magento\Framework\Mail\MailMessageInterface::createAttachment() So, due to this, the previous method is deprecated and ...


0

The impact will be during that period of time(When ES is down) it may happen that Catalog Search results and Category Pages may not be accessible. When Elasticsearch down then catalog_search index should be disabled for some time or switch to another search engine (i.e. MySQL). For other items, it depends on a few other things as well Elasticsearch ...


0

Deleting the file your-mysql-data-dirs/your-magento-store-schema-dirs/sales_shipment_item.ibd seems to solve the issue in my case. (Magento 2.3.2, mySQL 8.0.18 (Homebrew))


0

I have setup 2 websites using below steps: (nothing extra) Provide store urls in admin on website level Stores > Configuration > General > Web > Base Urls Update .htaccess file same as you did in step 5 just exclude protocol and add those lines above RewriteEnging on line Update virtual host entry Restart apache Hope this helps!


0

I used CSS only and it worked! No jquery issues <style>* { box-sizing: border-box; } body { padding: 10px; background: #f2f2f2; text-align: center; } .tabs { display: flex; flex-wrap: wrap; max-width: 100%; background: #efefef; box-shadow: 0 48px 80px -32px rgba(0,0,0,0.3); } .input { ...


0

I ended up creating this function in the module's helper class and pulling the helper into whatever class I needed it via di (in the __construct method). /** * Get the frontend url for the given path * * @param string $route * @param string $type base,path,frontname */ public function getFrontUrl($route = '', $type = 'base') { if (empty($route)) { ...


0

This is not a product attribute, it is only used to switch between virtual and simple/configurable product types. If the product is virtual then this will be as your question shows, so you can use product type to determine this.


0

Although not the case for OP, I had the issue as well due when trying to set up multiple stores on separate domains. Hope it helps someone. Turns out that in nginx configuration the passed variable $MAGE_RUN_CODE together with $MAGE_RUN_TYPE store should be the store view code, not the store code. See example below:


1

Create PHP file in the Magento root directory like "deleteproducts.php". And add the below code to file. Note: Please take a backup before running this script. <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); ini_set('memory_limit', '5G'); error_reporting(E_ALL); use Magento\Framework\App\Bootstrap; require 'app/bootstrap....


0

Try to run command like.. composer config repositories.compactcode-base git git@github.com:CompactCodeEU/base.git && composer config repositories.compactcode-intercom git git@github.com:CompactCodeEU/intercom.git composer require "compactcode/intercom:dev-master" php bin/magento setup:upgrade Follow this link Hope this will help you!


0

you can see configuration file: https://github.com/magento/magento2/blob/9544fb243d5848a497d4ea7b88e08609376ac39e/app/code/Magento/PageCache/etc/varnish6.vcl#L193 probably headers your are looking for just not set or unset. you have some of them: Age: 46 Grace: none X-Magento-Cache-Debug: HIT


0

The error occurred because of many reasons, one of the reason is, "There is an alpha character and a numeric character in the admin password. This should be labeled a bug if the password is not validated during install with magento setup:install." try to reset the password of your admin by clicking on "Forgot Your Password?" Click here for more reference


0

Please open the below path file. vendor/magento/module-customer/view/adminhtml/ui_component open customer_address_form.xml and remove below code from line number.194 <formElements> <select> <settings> <options class="Magento\Directory\Model\ResourceModel\Country\Collection"/> </settings> &...


0

You can setup in cPanel with cron job. Use below configuration and command. As per directory need to change path. Minute - 0 Hour - 0,12 Day - * Month - * Weekday - * Command : /usr/local/bin/php /home/magentodirectory/public_html/bin/magento queue:consumers:start product_action_attribute.update --max-messages=20 >> /home/magentodirectory/public_html/var/...


1

Please use this way getUrl("support/index/index");


1

You need to change controller code Customtab/ImportOrders/Controller/Customer/Index.php <?php namespace Customtab\ImportOrders\Controller\Customer; class Index extends \Magento\Framework\App\Action\Action { protected $_pageFactory; public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\View\...


1

Magento2.3.3 Products not Save Once Imported If Products imported using csv issue. In database table named 'cataloginventory_stock_item' column named 'use_config_max_sale_qty' affect the save functionality. While importing using csv as per magento import/export functionalities It must be '1',not blank or '0'. So if import with blank or with zero then ...


0

I hope you are getting Mime type errors in console Can you try these commands sudo chmod -R 777 pub/ var/ app/ sudo php bin/magento setup:upgrade sudo php bin/magento deploy:mode:set production sudo chmod -R 777 pub/ var/ app/ ref https://magento.stackexchange.com/a/296528/82482


1

Try to run below command once php bin/magento config:set web/secure/use_in_adminhtml 0 php bin/magento config:set web/cookie/cookie_domain '' php bin/magento setup:upgrade php bin/magento cache:clean php bin/magento cache:flush Hope this will help you!


0

The Example you mentioned (https://devdocs.magento.com/guides/v2.3/extension-dev-guide/message-queues/implement-bulk.html) seams to be fore ampq only. I'am guessing you are trying to use the DB-Backend. In that case you need to create "queue.xml" as well and run setup:upgrade again. Example here: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/...


1

You don't need to configure a different URL to media and static files; Since Cloudflare manages your domain, it'll deliver the static content using their CDN and get the dynamic content from your server, all of it through your domain. Reference: https://www.cloudflare.com/learning/cdn/caching-static-and-dynamic-content/


0

Frontend page builder generally has some specific syntax that it adds to the wysiwyg editor for all the pages. When you add or remove any content from front-end it basically adds or deletes the particular codes inside the cms pages in order to efficiently manage the dynamic content from the front-end itself without any prior knowledge of coding. But the ...


0

1) For removing a Block (using remove="true") you do not need to mention the exact referenceContainer name. just write the code inside referenceContainer name="content" <referenceContainer name="content"> <referenceBlock name="field.qty" remove="true"/> </referenceContainer> 2) To find out what are the referenceContainer available , ...


0

Magento 2.3 core modules used a declarative schema approach instead of the setup upgrade script. This is a new recommended approach in Magento 2.3 and above. Magento 2.3.x is still working with InstallSchema, InstallData,.. etc.


1

Vendor\Module\etc\di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogSearch\Model\Search\IndexBuilder"> <plugin name="Custom_Layernavigation::CustomLayernavigation" type="Vendor\Module\Plugin\...


0

Need to start message queue consumers. After consuming all available messages, the command terminates. You can run the below command again manually or with a cron job php bin/magento queue:consumers:start product_action_attribute.update --max-messages=20


0

routes.xml When set the url by routes which id and frontName must be same ( ie, id="support" and frontName="support ") The routes.xml file maps which module to use for a URL with a specific frontName and area. The location of the routes.xml file in a module, either etc/frontend or etc/adminhtml, specifies where those routes are active. The content of this ...


0

You need to create a module and call this block in phtml file. Since you want to create a widget ideally you need to create cms block first and call this block template file in it. like {{block class="Vendor\Yourmodule\Block" template="Vendor_Yourmodule::coming_soon.phtml" name="formblock" template="advanced/form.phtml"}}


1

You can use a default Magento store repository \Magento\Store\Api\StoreRepositoryInterface. Add it as dependency and call the getList method. /** @var \Magento\Store\Api\StoreRepositoryInterface $repository */ $stores = $repository->getList(); foreach ($stores as $store) { echo 'Store: ' . $store->getId(); echo ' --- '; } will output all ids:


-1

Check this extension: https://github.com/PayboxByVerifone/Magento-2.0.x-2.2.x/blob/master/Model/Payment/AbstractPayment.php It may help you.


0

This should be fixed by this commit https://github.com/magento/magento2/commit/c15e194a9c5395d6cc703813feea8ed6efc4f6d5#diff-5caf9b4a7016097c6254817ce41d982e The problem was that it was using 0, 1, etc. as keys and 0 evaluates to false in the PHP.


3

The permissions for .user.ini can be -rw-r----- (or 640 in octal). This removes access for anyone other than owner and group members. (As Hunter said, you can check permissions by running ls -la in your Linux terminal/shell). Our Magento 2.3 site is running with .user.ini permissions of 640, so I can verify they do work. I ran the security scan today and ...


0

This is the constructor of the parent class public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \...


0

I was facing the same issue, after creating the view by executing the below query my problem has been resolved. CREATE ALGORITHM=UNDEFINED DEFINER=`{database_user_name}`@`localhost` SQL SECURITY INVOKER VIEW `inventory_stock_1` AS SELECT distinct `legacy_stock_status`.`product_id` AS `product_id`, `legacy_stock_status`.`website_id` AS `...


0

I could solve this issue by myself. It was caused after Data-Migration. We have to update Attribut-Sets with "Category IDs" to solve it. For all with the same Problem: In backend go to Stores-> Attributes -> attribute set From there select the first attribute and go editing. Now you can see on the right block "unassigned Attributes". Search and assign "...


1

I've investigated this subject a little deeper and tried multiple solutions to fix the problem. Injecting a subform (UI component fields) via AJAX didn't work without having to write a ton of code. Module\Name\Plugin\Magento\Framework\View\Element\UiComponentFactory <?php declare(strict_types=1); namespace Module\Name\Plugin\Magento\Framework\View\...


1

vendor/magento/module-swatches/etc/view.xml path to override app/design/frontend/{Package}/{themename}/etc/view.xml example : <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...


0

I got solution of my own problem, actually there was a problem in product data, product data coming was invalid due to that it was not rendering phtml file of listing page. So I just added try catch block in foreach at Magento_Catalog/templates/product/list.phtml and it's now working fine. Here is the code after changes I have made <?php foreach ($...


2

Need create before plugin on \Magento\Framework\App\Http\Context:getVaryString() <type name="Magento\Framework\App\Http\Context"> <plugin name="my_page_cache_variation" type="My\Module\Plugin\Framework\App\Http\ChangeCustomerContext" /> </type> Plugin: <?php namespace My\Module\Plugin\Framework\App\Http; use \Magento\...


1

Go to app/etc/config.php and remove the module names of your custom module that you just delete or want to delete it... Go to mysql, remove your module from setup_module table, delete from setup_module where module = 'Vendor_Module'... Run php bin/magento setup:upgrade... If your Custom Module folder exist in app/code, remove it.


1

After create or update product attribute programmatically (like tier price , etc..) by mistake product has_option set with false value. check in "catalog_product_entity" table. select entity_id, has_options, sku from `catalog_product_entity` where sku = {sky of yourproduct} So update it if has_options value is zero or null. UPDATE `...


0

The error was thrown, because magento was unable to load the script, because it is expected to be in THEME_LOCATION\Magento_Theme\web\js instead of THEME_LOCATION\web\js Another error source was because I had to use bootstrap.bundle.js instead of bootstrap.bundle.min.js ! Also don't forget to change the path: THEME_LOCATION\Magento_Theme\requirejs-...


0

In more recent versions of Magento2, the remove method is now: <referenceBlock name="block_name" remove="true"/> Example: Remove newsletter in block on page and footer links block on page <?xml version="1.0"?> <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../...


0

Inject Magento\Framework\Setup\ModuleDataSetupInterface on your data patch class: Add below code add for adding to that table $this->moduleDataSetup->startSetup(); $setup = $this->moduleDataSetup; $data[] = ['field1' => 'Value11', 'field2' => 'Value12']; $data[] = ['field1' => 'Value21', 'field2' => '...


0

Here is the github module. You can use on Checkout Page. Add a custom form to Magento 2 checkout : https://github.com/sbodak/magento2-checkout-custom-form


Top 50 recent answers are included