Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

0

First of all, I thank you for sharing this dev . I have the same need as you, I have to add on "catalog_product_entity_tier_price" a special price that will be applied only on particular customer groups, so I followed the steps you marked on the page, but I can't set the value on the custom filed Could you confirm me if there is a part of dev missing, here ...


0

Please confirm first you have .htaccess file here on this path pub/static/.htaccess If that is available there then please try to run below command in following sequence. rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* generated/* php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f ...


0

Make sure you have .htaccess file in pub and pub/static folder. If you accidentally deleted it, you can copy from here https://github.com/magento/magento2/tree/2.2/pub


0

Did you already try to reindex all? php bin/magento indexer:reindex so without --catalogsearch_fulltext If it is not working well, try to deactivate module and try again; php bin/magento module:disable elasticsearch Dont forget to run following commands after changes; bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-...


0

You have to recreate the inventory_Stock_1 view in Database. You can make it happen with an query (like this); CREATE OR REPLACE VIEW inventory_stock_1 AS select distinct legacy_stock_status.product_id AS product_id, legacy_stock_status.website_id AS website_id, legacy_stock_status.stock_id AS stock_id, legacy_stock_status.qty AS ...


0

Magento2 takes 4x longer to develop for the only people that should consider it is large companies with a lot of money to throw at it, because that's the only way to get things done in it. It's just plain and simple, awfully designed. It still has bugs listed 3 years ago on it's github not resolved and there's over a thousand listed bugs at any time. Just ...


0

The same issue in Magento 2.2.9 for DE store and after debugging an hour, I have finally solved the issue by following steps: 1. deleted/commented generated folder 2. flush cache


0

This is a workaround that how can one edit/add/update the robots.txt portion.


0

Is the website using a BasicAuth, is the website public, are you using a CDN wiht basic Auth or is you SSL certificate expired? I encountered a similar situation in an UAT environment where the certificate was expired and the emails in gmail weren't showing the images. You can also check the source of the images by viewing the origin email. In gmail is ...


0

Login to admin Go to stores > configuration > General > General > States options (Choose Required Country from drop down) from here Save configuration Go to PHPMYADMIN > choose table directory_country_region_name and directory_country_region Delete the particular desired record from that tables. (You have to do from the database. Otherwise, you have to use ...


1

Openbravo does have an Openbravo Magento Connector Module for connecting Openbravo ERP and Magento eCommerce systems under commercial licensing. With the help of this module, one can synchronize the customer data, product information and sales orders using a scheduler job. Please go through the Openbravo Magento Connector project page for downloading the ...


0

I got solution. I know that this is not reliable but it works for me. I made changes in Massdelete controller. $count = count($collection); // newly added foreach ($collection as $product) { $this->productRepository->delete($product); $productDeleted++; if($count == $productDeleted){break;} // newly added } And now i am going to override this ...


0

This is a known bug on Magento. Please see here https://github.com/magento/magento2/issues/19533 You need to rewrite the following classes via preference Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php Magento/Ui/Component/MassAction/Filter.php And apply the code changes found in this commit https://github.com/magento/magento2/commit/...


0

It is almost impossible to identify the source of this error based just on this message. Most likely you are overriding/extending (mixin) some file, which being called on page where it is not intended. Maybe instead of declaring some of your js library at requirejs, put in view/frontent/templates, as an example bellow. <?php $displayOnThisPage = $block-&...


0

Find controller: Magento\Store\Controller\Store\Redirect, the issue might lie in the fact that the arguments are not passed along when going from Redirect in header links to the Switch controller: $arguments = [ '_nosid' => true, '_query' => $query ]; $this->_redirect->redirect($this->_response, 'stores/store/switch', $arguments); ...


0

If you look at the end of the checkout_index_index.xml file in the Magento_Checkout module, you will see the page.messages container is removed there. I have a hunch it is removed for a specific purpose, but if you want to bring it back, you can place a new checkout_index_index.xml file in a layout folder in your theme (like app/design/frontend/...


0

\magento\app\code\Module\RewriteSwatches\etc\module.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Module_RewriteSwatches" setup_version="2.0.1"> </module> \magento\app\code\Module\RewriteSwatches\view\frontend\requirejs-...


0

I have updated the code a bit in a clean and better manner. It may be useful to others :) define([ 'Magento_Ui/js/form/element/abstract', 'jquery' ], function (Text, $) { 'use strict'; return Text.extend({ onUpdate: function (value) { $("label[for=" + this.uid + "]").text(value); return this._super(); ...


0

When you clear the data from the 'catalog_product_entity_decimal' table with the attribute_id of tier_price (92 for me), then you are able to save new tier_prices for products. Magento 2.2.9 does as far as i know nothing with tier_price attribute values in the 'catalog_product_entity_decimal' table.


1

You want to use javascript Something like this https://stackoverflow.com/a/41121797/10121426 Assuming that your href attribute is linking to a div with the tag id with the same name (as usual), you can use this code: HTML <a href="#goto" class="sliding-link">Link to div</a> <div id="goto">I'm the div</div> JAVASCRIPT - (...


0

It working for me: Create a requirejs-config.js in your module to add a mixing to the validator object to app/design/frontend/Vendor/Theme/Magento_Ui/requirejs-config.js with the following content: var config = { config: { mixins: { 'Magento_Ui/js/lib/validation/rules': { 'Magento_Ui/js/lib/validation/rules-mixin': ...


0

We had the same problem with changing / adding stuf in the app/i18n/ directory. We added the translation file in app/design/frontend/[vendor]/[custom-theme]/i18n/da_DK.csv Hopefully this help.


0

Here's a better way to get the discount amount public function getProductDiscount(ProductInterface $product) { $regularPrice = $product->getPriceInfo()->getPrice(\Magento\Catalog\Pricing\Price\RegularPrice::PRICE_CODE)->getAmount()->getValue(); $finalPrice = $product->getPriceInfo()->getPrice(\Magento\Catalog\...


0

Try this $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product echo $product->getId();


0

Mine is 92. *************************** 74. row *************************** attribute_id: 92 entity_type_id: 4 attribute_code: tier_price attribute_model: NULL backend_model: Magento\Catalog\Model\Product\Attribute\Backend\Tierprice backend_type: decimal backend_table: NULL frontend_model: NULL frontend_input: text frontend_label: Tier Price ...


0

Try : require( [ 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/cart/totals-processor/default' ], function( quote, totalsDefaultProvider ) { totalsDefaultProvider.estimateTotals(quote.shippingAddress()); } );


0

If you want you totals to be recalculated after payment method select, then follow these steps Create requirejs-config.js in app/code/Vendor/Module/view/frontend/requirejs-config.js the code will be: var config = { map: { '*': { 'Magento_Checkout/js/action/select-payment-method': 'Vendor_Module/js/action/select-...


0

Using js define([ 'uiComponent', 'jquery', 'Magento_Customer/js/customer-data' ], function ( Component, $, customerData ) { 'use strict'; return Component.extend({ /** * @param {obj} data, {obj} event * */ yourFunction: function () { ...


0

"since years" (M2.1.x, M2.2.x, M2.3.x) production mode is slower. We run only in development mode.


1

Download owl carousal from OwlCarousal And paste owl.carousel.js to app/design/frontend/Ctm/customtheme/web/js/owl.carousel.js owl.carousel.min.css to app/design/frontend/Ctm/customtheme/web/css/owl.carousel.min.css Create requirejs-config.js with below code in app/design/frontend/Ctm/customtheme/Magento_Theme/requirejs-config.js var config = { ...


0

The price calculation is done for the configurable products as below and you should be able to use the OOB solution. You created many simple products and set the price respectively for each simple products. SKU, Size, Fabrics, Color, Price SKU1, 10, Silk, Red, 100 SKU1-2, 10, Silk, Blue, 150 SKU2, 11, Silk, Blue, 200 SKU3, 12, Silk, Black, 300 SKU4, 13, ...


1

_cache folder at pub/static is created when you enable CSS/Js minify or merge. During Static content deply if this merge/minify setting enables then the merge and minify CSS and js is generates at the store at pub/static/_cache and it creates Website Speed.


0

You can see the url like baseurl/newsletter/manage so the xml file must be newsletter_manage_index.xml you can find this file from vendor/magento/module-newsletter/view/frontend/layout/newsletter_manage_index.xml Override this file in you custom module app/code/vendor/module/view/frontend/layout/newsletter_manage_index.xml with below code <?xml ...


0

First you have to Override your Existing File so basically you need to follow such simple steps: Create Module OSCP_NewsletterOveride - Path: app/code/OSCP/NewsletterOveride Create module.xml file in path app/code/OSCP/NewsletterOveride/etc/module.xml and paste this code <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...


0

This unfortunately appears to be a bug in Magento, one of which had been puzzling me for a while! The error is appearing because within Magento\Catalog\Model\Layer::setCurrentCategory, it expects a category to have already been set: public function setCurrentCategory($category) { if (is_numeric($category)) { try { $category = $this-&...


0

php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento cache:flush php bin/magento cache:clean It definitely be work.


2

Try Below solution $(document).click(function(event) { if (jQuery(event.target).is(".mobile-bar-icon")) { $(".mobile-bar-content").addClass("open"); } else if(jQuery(event.target).is(".mobile-bar-close") || !$(event.target).is(".mobile-bar-content")) { $('.mobile-bar-content').removeClass('open'); } });


1

I think you should review the EAV structure tutorials. https://inchoo.net/magento/magentos-database-layout-and-its-eav-structure/ https://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-7.html https://belvg.com/blog/eav-in-magento-2.html Still, you required any help, let me know. Hope this will help you.


0

public function getWebsiteName($websiteId) { $collection = $this->_websiteCollectionFactory->create(); $websiteData = $collection->addFieldToFilter('website_id',$websiteId); foreach($websiteData->getData() as $websiteName): $webName = $websiteName['name']; endforeach; return $webName; }


2

You can follow this link magento 2.2.2 - How to transfer the product thumbnail to the left side Modify your theme view.xml file <vars module="Magento_Catalog"> <var name="gallery"> <var name="navdir">vertical</var> <!-- Sliding direction of thumbnails (horizontal/vertical) --> </var> ...


0

you can easily do it by css, Please add this following css in your existing css file: .fotorama__stage__shaft.fotorama__grab { margin-left: -120px !important; }


1

You will need to extend the framework. Each email needs to be individually added as a destination address. I do this for CC address in this extension https://github.com/DominicWatts/EmailCC/blob/master/Plugin/Magento/Framework/Mail/Template/TransportBuilder.php#L51 There isn't a quick and easy method I can show you https://github.com/magento/magento2/...


Top 50 recent answers are included