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

Yes, You can create Ui component form without a database. If you want to use phtml then also you can use that Using ui component You need to add following into your code For this, Your Data Provider should be like <dataSource name="coupon_email_data_source"> <argument name="dataProvider" xsi:type="configurableObject"> &...


0

Finally, I have managed to solve that problem. I have updated the question and in the 2nd update is the answer: I have searched for remove= looking for something like <container remove=""> and found one file from the template that has: <container name="columns.top" remove="true" /> I have removed attribute remove="true" from element ...


0

I used this as a basis https://github.com/meanbee/docker-magento2 Check issues. There are a few workarounds on a couple of bits. I recommend you use persistent storage. If you've not used docker before check this https://docs.docker.com/get-started/


2

Find "<remove" this sting in your app folder. you will find like below code: <remove name="product.info.price"/> remove this, its alternative, you need to add remove="true" attribute in block tag.


0

you can use Swap memory 。 # /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=16384 # /sbin/mkswap /var/swap.1 # /sbin/swapon /var/swap.1


0

Try this: \Magento\Framework\View\Element\Template\Context $context


1

Found a solution by disabling the Symlinks. Navigate to Stores -> Configuration -> Advanced -> Developer -> Template Settings and set “Allow Symlinks” to “No”. Change Materialization Strategy in magento_root/app/etc/di.xml. Change this: <virtualType name="developerMaterialization" type="Magento\Framework\App\View\Asset\MaterializationStrategy\Factory"&...


1

It seems like permission issue for pub/static So just give necessary permission for pub/static then run your command and of course static content deploy will create a down time as well. As of now run the below command in your root chmod -R 755 pub/static/ or chmod -R 777 pub/static/ EDIT : Run the below command then deploy rm -rf pub/static/...


1

That caused by permission. You can upgrade and deploy again. php bin/magento setup:upgrade php bin/magento setup:static-content:deploy en_GB if it still error, pls run command on root: find app/code lib var generated vendor pub/static pub/media app/etc ( -type d -or -type f ) -exec chmod g+w {} + && chmod o+rwx app/etc/env.php After ...


0

You can safely flush cache storage from the backend if you dont care about any thing stored in it (you probably dont) Keep in mind that magento creates cache data as part of the application so most of what you are clearing has to get created again right away. What you really need is to move your full page cache and session data into redis which is memory ...


2

Your method needs to add the following class: vendor/magento/module-checkout/view/frontend/web/js/view/payment.js So overwrite this and add your method here. goBackShipping: function () { alert("Preparing to go back"); window.history.back(); },


0

For anyone interested, I think I can bring some light about this issue. It seems to be a concurrency (race condition) problem in \Magento\Framework\Code\GeneratedFiles::cleanGeneratedFiles, when the var/.regenerate flag is set, and more than one process/request tries to clean generated files. It is more likely to happen when you have cron enabled, and many ...


1

use Magento\Reports\Model\Product\Index\Factory; $model = $this->indexFactory->get('viewed'); $collection = $model->getCollection() ->addAttributeToSelect('*') ->setCustomerId($customerId); $collection->excludeProductIds($productId) ->addUrlRewrite() ->setPageSize(($...


0

Using Object Manager $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $categoryCollection = $objectManager- >get('\Magento\Catalog\Model\ResourceModel\Category\CollectionFactory'); $categories = $categoryCollection->create(); $categories->addAttributeToSelect('*'); foreach ($categories as $category) { ...


0

First, you need to create the block at the following location: Vendor\Extension\Block\Getcategoryinfo.php <?php namespace Vendor\Extension\Block; class Getcategoryinfo extends \Magento\Framework\View\Element\Template { protected $_categoryCollectionFactory; public function __construct( \Magento\Framework\View\Element\Template\...


0

This code is worked for me protected $resultRedirectFactory; public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\Redirect $resultRedirectFactory ) { $this->resultRedirectFactory = $resultRedirectFactory; parent::__construct($context); } public function ...


0

Got the solution of this In my Class public function __construct( ... \Magento\Reports\Model\Product\Index\Viewed $recentlyViewedModel, ... ) { ... $this->recentlyViewedModel = $recentlyViewedModel; ... } public function getRecentlyViewedCollection() { $collection = $this->recentlyViewedModel->getCollection(); $...


0

Yes you can override input field using $jsLayout array in you custom module. Hope you know how to create Layoutprocessor plugin. In you Layoutprocessor override text field file 'elementTmpl' to your custom file from custom module like below code $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['...


0

You need to do following steps. Open the table "eav_attribute" and search the record with this condition "entity_type_id" = 4 and "attribute_code" = sku so now you get the row which show the attribute_id for the url_key something like this. In demo case it is 121. Now open the "catalog_product_entity_varchar" table and serch the record by "attribute_id"...


0

you can get it form url_rewrite table there are entity_id is product_id and request_path is display url


0

Magento uses an EAV table structure for products. Names are stored in catalog_product_entity_varchar. If you have the product ID X, you can query this table directly: SELECT entity_id, value, store_id FROM catalog_product_entity_varchar WHERE entity_id = X AND attribute_id = ( SELECT attribute_id FROM eav_attribute WHERE entity_type_id=4 AND ...


0

Can you try with this script instead ? I should work for you. I have done 2 things : Added the domReady to wait for the DOM to be loaded Define $ to be jQuery This is it : require([ 'jquery', 'domReady!' ], function ($) { $("input[name='code']").bind('input', function(){ $(this).val(function(_, v){ return v.replace(/\s+/g, ...


0

Looks like you need to wrap your JS in a return function: return function (config) { ... } Try this: define(['jquery'], function($) { 'use strict'; return function (config) { console.log('#engraving' + config.lineId + '_' + config.id); console.log(config.id); console.log(config.maxChar); console.log(config....


0

If you're in doubt whether there is an error in your code, please check the console. If the console doesn't display any error, then it may cache issues. So you have to flush or clean the cache. Basically, Magento is slow by default compared to other platforms. You may consider installing free plugins like lazyloading images and necessary configuration to ...


0

Not sure I understand what you need here, but in case you want to modify the last message you can try this. $messageCollection = $this->messageManager->getMessages(); $lastMessage = $messageCollection->getLastAddedMessage(); if ($lastMessage) { $messageText = $lastMessage->getText(); $messageText = modify here your message as you want. ...


0

I submitted a pull request which I believe made it into 2.3. You can use a GET param to enable/disable template hints. This helps speed up development in our team. Check the options under Stores –> Configuration. Select Developer option from the Advanced tab. Open Debug dropdown. Here you will find the options. Under my pull request they did discuss ...


1

Try 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\Framework\View\Element\UiComponent\DataProvider\CollectionFactory"> <...


0

we have created custom module & created below files. app/code/Namespace/Module/view/adminhtml/ui_component/braintree_report.xml <?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...


5

One of the possible solution to sort these Groups, you need to go to Stores -> Attribute Set in admin panel. Click the attribute set which is set right now on the product which you are checking. It may be like this Now Drag & Drop the Group which you want to sort in whatever position. I hope this will help


0

Its knockout js binding there <a href="#" data-bind="attr: {'data-cart-item': item_id, title: $t('Remove item')}" class="action delete" data-cart-item="74398" title="Remove item"> <span data-bind="i18n: 'Remove'">Remove</span></a> and in minicart vendor\magento\module-checkout\view\frontend\web\js\shopping-cart.js $(...


0

Create an after plugin for the product model isSalable method: in Your/Module/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\Catalog\Model\Product"> <plugin name="...


0

It is not possible on test server. Magento1 databse should be on production server for incremental migration. I have tried with copying m2_cl_* tables on production and then doing incremental migration but it will not work


1

Remove the true parameter from $this->messageManager->getMessages(true); Sending this parameter retrieves the messages from the session and clears them. So the next time you call messageManager->getMessages() you get an empty list of messages.


0

Try adding getMessages() method: $messageCollection->getMessages()->getLastAddedMessage()->getText();


3

It's likely your AJAX request is completing AFTER the slider is initialised, see if adding your Slick JS to your success callback helps: require([ 'jquery' ], function($){ jQuery.ajax({ url: "/manufacturerpages/index/collection", type: "POST", data: "id= <?php echo $manpagedataarr['page_id']; ?>&categoryid=<?...


4

Actually one of possible reason why it may not properly working because you don't add the slick after ajax success response. You just need to replace this, with your js code require([ 'jquery', 'magiccart/slick', 'alothemes' ], function($, slick){ jQuery.ajax({ url: "/manufacturerpages/index/collection", type: "POST", ...


0

Instead of messing around with the layout files, I just added custom CSS inside style tags with the html editor inside the magento 2 page design area. Then Added custom js with a script tag in the same editor that selected the divs that were already there and removed their css classes. The divs are still there which is not a problem in my case as it was only ...


0

After testing, I cannot use non-collection format (array, object) to fullfill admin grid, but I found this plugin using raw SQL to make a collection which is more flexible. If you are annoying with this issue also, hope this can helps you too.


1

Try using plugin: app/code/SR/MagentoCommunity/etc/frontend/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\Quote\Model\Quote"> <plugin name="sr_check_stock" type="SR\...


1

You have to add addAttributeToSort() to your collection addAttributeToSort('entity_id') Code May be Like $collection->addAttributeToFilter('entity_id', array('in' => $productIdsarray)); $collection->addAttributeToSort('entity_id');


3

You just need to add order along with your addAttributeToFilter $collection->addAttributeToFilter('entity_id', array('in' => $productIdsarray )); $collection->getSelect()->order(new \Zend_Db_Expr("FIELD(e.entity_id, ".implode(",",$productIdsarray).")"));


0

This is not a error, its just validating the form data, if you dont want prefix as a required field, then you can change to OPTIONAL from the magento admin customer configuration settings. Steps: MagentoAdmin->Stores->Configuration->Customer->CustomerConfiguration->Name and Address Options->Show Prefix->Optional


1

Try to create the configurable product with manage_stock=false it will works as expected!


0

You can use a Custom script <a href="#url"> <button type="submit" title="<?= /* @escapeNotVerified */ $buttonTitle ?>" class="action primary tocart" id="product-addtocart-button"> <span><?= /* @escapeNotVerified */ $buttonTitle ?></span> </button> </a> <div id="...


0

You probably need to check and change the location of your mixin. Refer to the documentation Update: Remove single quotes in your mixins declaration: reference var config = { config: { mixins: { 'Magento_Ui/js/form/element/website': { 'Vendor_CustomCustomer/customercustom': true } } } };


1

Saving happens in a MySQL transaction and the delete_after event is triggered before the transaction is committed, so that you can do additional updates in the database within the same transaction. The delete_commit_after event is triggered after the transaction has been committed, i.e. when the changes were written to the database.


0

Add the caching interface loading to the constructor. public function __construct( Magento\Framework\DataObjectFactory $dataObjectFactory, Magento\Framework\App\CacheInterface $cache, Json $serializer = null ) { $this->dataObjectFactory = $dataObjectFactory; $this->cache = $cache; $this->serializer = $serializer; } For saving the ...


0

you can use this code. /** @var \Magento\Catalog\Model\ProductFactory */ protected $productFactory; $storeId = 2; $product = $this->productFactory->create()->load('YOURPRODUCTID'); $productStoreView->setStoreId($storeId); $productStoreView->save();


1

As per my understanding, I give an explanation about SearchCriteria, Search result , searchCriteriaBuilder in below. Search Criteria : A Search Criteria is an implementation of the SearchCriteriaInterface class that allows you to build custom requests with different conditions. Repositories use this class to retrieve entities based on a matching criteria....


0

You can try by below method. Queries will be passed after appending ?. use Magento\Framework\UrlInterface; UrlInterface $urlBuilder $this->_urlBuilder = $urlBuilder; $queryParams = [ 'oid' => base64_encode($data['order_id']), 'cid' => base64_encode($data['customer_id']) ]; $this->_urlBuilder->getUrl('controller/index', ['_current' ...


Top 50 recent answers are included