New answers tagged

0

There is a plugin at play here that's tricky. Product save calls the UpdateHandler method of Magento\Catalog\Model\Product\Gallery. The file @ Magento\Catalog\Model\Product\Gallery\UpdateHandler.php says: class UpdateHandler extends \Magento\Catalog\Model\Product\Gallery\CreateHandler{...} To achieve your goal, override UpdateHandler.php in addition to ...


0

the answer I can come up with is: you need a command created in a custom Magento 2 module the command needs to fetch the orders that have a status 'unapproved' and I do this using order repository and search criteria the order status needs to be changed to 'approved'. I do this in a loop using the order repository as well please accept the answer if it ...


0

@op Did you ever manage to fix this?


0

$collection = $this->categoryCollectionFactory->create(); $collection->addAttributeToSelect('*') ->setStore($storeId); instead ->setStoreId(0); use ->setStore(0);


0

Create a Custom Module: Create di.xml file under {Vendor}/{CustomModule}/etc folder: <?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\Tax\Model\Calculation"> <arguments> &...


0

Copy file from vendor directory vendor/magento/module-checkout/view/frontend/web/js/view/payment/default.js to your custom created theme app/design/frontend/[vendor]/[theme]/Magento_Checkout/web/js/view/payment/default.js Now, search for find placeOrder: function (data, event) and edit this function as given below if(confirm("Are you sure to place ...


-2

you can import visual swatches with store manager


0

Use currentPage param like this /rest/default/V1/products/?searchCriteria[pageSize]=20&searchCriteria[currentPage]=2 for seconde page /rest/default/V1/products/?searchCriteria[pageSize]=20&searchCriteria[currentPage]=3


0

==> Please used below code NOTE: Please do not use the Object manager /** * If the external file is in the root folder */ require __DIR__ . '/app/bootstrap.php'; $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); $obj = $bootstrap->getObjectManager(); $state = $obj->get('Magento\Framework\App\State'); $state->setAreaCode('...


0

We can get customer id by product review like this! protected $_reviewCollection; public function __construct( \Magento\Review\Model\ResourceModel\Review\CollectionFactory $reviewCollection ){ $this->_reviewCollection = $reviewCollection; } public function getReviewByCustomer($customerId) { $collection = $this->_reviewCollection->...


0

A third party plugin will never be guaranteed to work with another third party plugin, unless you're willing to do some custom development to resolve this I wouldn't have any expectation of it ever working.


0

Check if you have overrided : view/frontend/templates/product/view/gallery.phtml or etc/view.xml Usually this happens with modifications made on custom theme overidde , especially on etc/view.xml . Try locally to update those based on magento core files . Do : rm -rf var/cache/* rm -rf var/view_preprocessed/* rm -rf pub/static/* rm -rf generated/* ...


0

If you are on a product page then if ($_product->isSaleable()) or if ($_product->isAvailable()) should do the job If you are handling the product collection in your block code, I would look into adding \Magento\CatalogInventory\Helper\Stock $stockHelper $stockHelper->AddIsInStockFieldToCollection($productCollection) for 2.3.3 or $...


1

You can use jQuery to do this, just check for change on the text field and update the main image with the image you get. require(['jQuery'], function($){ $('#textFiledId').on('change', function(){ let src = 'img.jpg'; // get image using ajax //set src to main image }); }


0

You can use min-width and max-width for this. If you want to target specific width, you can use same value i.e 1366 in both min-width and max-width like: <!DOCTYPE html> <html> <head> <title>Media Example</title> <style> body{ background: red; } @media (min-width:1366px) and (...


2

==>You can get the current product category using the below code. NOTE: Please do not use the Object manager <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->create('Magento\Catalog\Block\Product\View')->getProduct(); $categoryId = $product->getCategoryId(); echo $categoryId; ?> ==>And ...


0

Hey there it seems sometimes ago we also received the same ID “” already exists but for Magento\Catalog\Model\Product\Interceptor. https://magento.stackexchange.com/a/299081/66041 Try using this maybe it will help..


1

It seems to me that the problem is that in the shipping method that you use, the Title field is not filled, if it is empty, such a result will appear. If you use Shipping Table Rates by Amasty 1.6.4 there is such a field, fill it in and the result will change.


0

In windows 10 you need to make real-time protection off under Windows Security, this will increase the performance in Windows


0

Your Answer is here Click here create your form and add into like this <div id="events_popup" style="display:none;"> <form> ................... ................... ................... <form> </div> and add pass this id into here $("#events_popup").html('Thanks.').modal(options).modal('openModal');


0

Finally I have figured this by myself, I actually had to override /vendor/magento/module-ui/view/frontend/web/templates/form/fields.html this file to get HTML tags working in notice section. I have written a detailed blog post about this: https://www.backarapper.com/how-to-add-html-tags-in-notice-section-of-checkout-form-fields-in-magento-2/ Hope this ...


0

Use this code to redirect protected $_response; protected $storeManager; public function __construct( ................................... ................................... \Magento\Framework\App\ResponseInterface $response, \Magento\Store\Model\StoreManagerInterface $storeManager, ................................... ..........


0

Update customer_account.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="...


0

I have way to add new attribute to your container. <container name="minicart-row" htmlTag="div" htmlClass="[container-class-name]"> so every container you define with a same class or deiffernet class as you need. now we need to add new attribute to this container <container name="minicart-row" htmlTag="div" htmlClass="minicart-wrapper"> so ...


0

After many try attempts I finally made it work: setData was not working with option code, but was with option ID. I modified the code as following: foreach ($options_list as $current_option) { $attributeCode = $current_option["attribute_code"]; $attributeValue = $current_option["option_code"]; $attr = $product->getResource()->...


0

The “quantity” is under the heading of “Cart Item Attribute”. This means it’s matching against each line item in the cart, not the cart overall. I believe if you want to do this, you need to make it a condition, not an action. The condition would be “Total Items Quantity” under the “Cart Attributes” heading. Conditions determine when the rule applies, ...


0

instead of getProcuctUrl() Try this $product = $this->_productRepository->getById($productId); $url = $product->getUrlModel()->getUrl($product);


0

Check out this tutorial. It works perfectly for me


0

You might be looking for something this. <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $Stock = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface'); echo $Stock->getStockQty($product->getId(), $product->getStore()->getWebsiteId()); ?>


0

You can try GDPR dump but it needs some configuration... Would be nice if you share your config if you succeed. https://github.com/machbarmacher/gdpr-dump


0

if you need data for testing, you can install sample data, two options: ---> Sample data module, simply run composer command to install sampledata: To install sample data using the command line, enter the following command as the Magento file system owner in the folder: bin/magento sampledata:deploy https://devdocs.magento.com/guides/v2.3/install-gde/...


0

You're going to be told that third party stuff is not in scope. It is quite a trial and error slog to "undo" layout changes and quite a bit will probably be in layout xml files but there's 2 things perhaps worth trying: If the template monster theme actually installed extra modules as part of the package, disable any navigation sounding ones. That could ...


0

You can write scripts for it. There are several tuts available for creating products,order,customer etc. Google it.


0

I have done the same thing. app/code/vendor/module/etc/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="review_save_after"> <observer name="vendor_email_review" instance="vendor\module\Observer\...


0

It seems you added product using widget, you need to copy below file: vendor/magento/module-catalog-widget/view/frontend/templates/product/widget/content/grid.phtml to app/design/frontend/{Package}/{theme}/Magento_CatalogWidget/templates/product/widget/content/grid.phtml After that you can add a button like: <div class="discover"> <a ...


0

//you can use magento exception class to throw message after namespace use Magento\Framework\Exception\LocalizedException; class ShipmentEstimationPlugin { public function __construct( \Magento\Customer\Model\Session $customerSession ) { $this->customerSession = $customerSession; } public function ...


0

In my case, I have got error like Notice: Undefined offset: 0 in /html/vendor/magento/module-deploy/Source/Modules.php on line 49 app static folder or view has the wrong name or contains another folder compare to the view structure check folder name and run php bin/magento setup:static-content:deploy -f it's work for me. I hope it will help you


0

I didn't do anything more than adding this line in my .htaccess php_value xdebug.max_nesting_level 500 It worked for me


0

First, take a backup of the inventory_source_item table. Now execute below SQL query in MySQL, INSERT IGNORE INTO `inventory_source_item` (source_code, sku, quantity, status) select 'default', sku, qty, stock_status from (`cataloginventory_stock_status` as `lg` join `catalog_product_entity` as `prd` on((`lg`.`product_id` = `prd`.`entity_id`))) Execute the ...


1

You have the table authorization_rule and permissions are in the column resource_id Find the role_id you want to modify in the table authorization_role and do UPDATE `m2_authorization_rule` SET `resource_id`='Magento_Backend::all', `permission` = 'allow' WHERE role_id = 'ROLE_ID_TO_MODIFY';


0

Added a template to app/design/frontend///Magento_Theme/templates/html/topmenu.phtml <nav class="navigation" data-action="navigation"> <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'> <li class="level0"><a href="<?= $block->escapeUrl($block->getUrl('')) ?&...


0

This is a pretty big question. There may be tools out there like Zapier that might help you bootstrap some kind of solution here. If you wanted to understand, technically, what you would need to build - check out this extension for dotdigital Engagement Cloud or this Mailchimp module. Both modules will have events that handle subscriptions, as well as cron ...


0

issue 11372 throwing error: Fatal error: Uncaught Error: Call to a member function getPackage() on null in /srv/magento2/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php on line 217 Error: Call to a member function getPackage() on null in /srv/magento2/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php on line ...


0

if you'r running production mode try this steps worked with me : 1- switch to developer mode php bin/magento deploy:mode:set developer 2- run these commands one bye one php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento indexer:reindex php bin/magento cache:flush php bin/...


0

A widget would be your best bet. There are a number of custom widget examples that allow you to display a list of sub-categories. Try this one out: https://github.com/emizentech/magento2-category-list-widget


0

It's a known bug. Please check out the below link. https://github.com/magento/magento2/issues/7399


0

Use this in the doc block of the function: /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) * phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter */ The first line is to suppress warning for PhpMd, the latter for Phpcs.


0

You can use the text to column function in your sheet editor and later use the TEXTJOIN function. In Google spreadsheets, the function looks like this: =textjoin(","; TRUE; A2:C2) Change the cells to your needs offcourse. There is no way you can get the additional attributes out of the box. There are several extension that can do so but the methode above ...


4

Magento has added this feature in latest 2.3.3 You have to whitelist the domains of those links through ssh in order to save them. To add a domain you have to run this command : bin/magento downloadable:domains:add www.xyz.com In order to get all whitelisted domains bin/magento downloadable:domains:show In order to remove a domain from whtielist ...


0

Please follow below steps to resolve the issue. remove all data from generated. run "php bin/magento setup:upgrade" run "php bin/magento c:c" run "php bin/magento c:f" run "php bin/magento setup:static-content:deploy"


Top 50 recent answers are included