New answers tagged

0

Please update this code :- $shippingAddress = $quote->getShippingAddress(); $shippingAddress->setFreeShipping(true); $shippingAddress->setShippingMethod('flatrate_flatrate'); $shippingAddress->setCollectShippingRates(true);


0

Please update the code like below $address->setShippingMethod('flatrate_flatrate'); $address->setCollectShippingRates(true)->collectShippingRates(); Let me know if you need further assistance.


0

I asked this a while ago - Adding extension attributes to Order API Endpoint But never really got a concrete answer of how to pull it off. I ended up using a third party extension to get around this for my specific use, not too sure if it would work for whatever you're trying.


0

Open app/code/Sm/MegaMenu/Block/Adminhtml/MenuItems/Edit/Tab/Form.php Now search $_wysiwygConfig. Now add following code: $_wysiwygConfig = null;


0

the solution .media { display: block; align-items: flex-start; } .media-body { flex: 1; } *, *::before, *::after { box-sizing: initial; // 1 }


0

Duplicate ID issue in the Sales Order or Order Payment tables. Please check new order ID or duplicate ID in the tables.


0

Try this : Tested Code Note :Just pass productId parameter in your ajax call & Logged User Id Automatically fetch class WishlistRemoveItems extends \Magento\Framework\App\Action\Action { protected $wishlist; public function __construct( \Magento\Wishlist\Model\Wishlist $wishlist, \Magento\Framework\App\Request\Http $request, ...


0

Backup your composer.json to easily revert your upgrade in case the upgrade fails and you want to revert your upgrade. $ cp composer.json composer.json.bak Enable maintenance mode, so that your update will not be able to be interrupted. $ bin/magento maintenance:enable First, you need to remove unused packages from your composer.json (--no-update is ...


1

Here is a solution with a mixin to avoid overwriting the whole file: 1) app/design/frontend/[THEME_VENDOR]/[THEME_NAME]/Magento_Theme/requirejs-config.js var config = { config: { mixins: { 'mage/validation': { 'Magento_Theme/js/lib/mage/validation-mixin': true } } } }; 2) app/design/frontend/[...


1

I had a misunderstanding in the structure of the data being passed to the email template. The "data" object was set as the only accessible DataObject in the variables array passed to send(...) in Mail.php. So I could access the data object like this in the email template: {{layout handle="email_product_custom_options" dataObj=$data area="frontend"}} ...and ...


0

I would approach to this problem with a different way. When I create a plugin, I always try to focus on the purpose, rather than the result. There can be multiple ways to reach the expected result, but which one would serve the purpose the most? The purpose here is to return a custom JSON response instead of a redirect. It is not to rewrite a core process ...


0

This is how I fixed this error: I removed one by one xml files, till I found in which one is the problem, and I found it in one of the extensions. Hope this is helpful for you :)


0

you can rewrite product_listing.xml. path:vendor/magento/modulecatalog/view/adminhtml/ui_component/product_listing.xml remove code in the product_listing.xml: <filters name="listing_filters"> <filterSelect name="store_id" provider="${ $.parentName }"> <settings> <options class="Magento\...


0

Try to run the below command in your MySQL instance and then flushing the Magento cache: Update core_config_date set value = 'http://localhost/Magento root_folder/' Where path like '%base_url'


-1

Search for this button code in phtml , where it is rendered. Create simple module: 1.add to system.xml select with yes /no. 2.create helper, that will check this setting. 3.add your helper to phtml file. 4. Add a construction if with checking your value from admin configuration ( this is doing by helper). And check - if in admin it is value = 1(yes,hide it) ,...


0

It seems like you use Product Stock Indexer. Try to do these steps: reindex cataloginventory_stock run bin/magento indexer:reindex cataloginventory_stock in console flush cache run bin/magento cache:flush in console flush varnish cache (additional, if you use one) run sudo service varnish restart in console


1

Difficult to know without seeing your email send logic but typically you need to build objects which you then pass through to email templates. https://magento.stackexchange.com/a/283338/70343 So I would have thought you would be better passing the block template output as a variable.


0

Check the catalog module page layout. It should be 2 column left. Set it to 1.column and try.


0

https://github.com/clean-docker/Magento2 use this as a base image of magento docker.


0

You can use method getCustomerSession() in \Magento\Checkout\Model\Cart to get customer data. $cart = $objectManager->get('\Magento\Checkout\Model\Cart'); $customerId = $cart->getCustomerSession()->getCustomerId();


1

This should be the right code: $customerSession = $objectManager->create("Magento\Customer\Model\Session"); echo $customerSession->getCustomerId(); By using this great code it should work. Therefore, the customer ID will get returned to you.


1

If you want to get current Add to cart request path of the product then you have to use request param product .magento send product id as a parameter to add to Add.php. protected function _initProduct() { $productId = (int)$subject->getRequest()->getParam('product'); if ($productId) { $storeId = $this->_objectManager->get( ...


0

Have you considered using one of the events for the cart this should make updating information easier. Events checkout_cart_add_product_complete checkout_cart_update_item_complete checkout_cart_product_add_after checkout_cart_update_items_before checkout_cart_update_items_after checkout_cart_save_before checkout_cart_save_after ...


2

You can use .minicart-wrapper .action.showcart:before selector to change the icon in your custom stylesheet example path: app/design/frontend/{theme}/{theme_name}/web/css/custom.css .minicart-wrapper .showcart::before { content: "" !important; background: url(https://www.svgrepo.com/show/222653/shopping-cart.svg) no-repeat; width: 27px; ...


0

I had to this very same thing today - you need to remove the validation from the input itself as described above by localising; /m2root/app/design/frontend/NameSpace/Theme/Magento_OfflinePayments/web/template/payment/purchaseorder-form.html Change; <input type="text" id="po_number" name="payment[...


1

Open below URL directly in the browser http://127.0.0.1:9200/_cat/indices?v 127.0.0.1 - Replace with Elasticsearch Server Hostname 9200 - Replace with Elasticsearch Server Port Will show below table: health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open ...


0

The above code works only if the swatches enabled. Please use the following code which will get all dropdown attributes values on the dropdown change event and please the values to the custom module using the ajax call. <script type="text/javascript"> require(['jquery','underscore'], function(jQuery,_){ var confProductId = jQuery('.price-box')....


0

As Per This Link The requested URL was not found on this server I am Check In Your Site And After Add index.php like this vitalticks.in/index.php/create-your-package.html open every category or page perfectly.


0

Create File In MassiveArt/ShoppingCart/view/frontend/layout/default.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <referenceContainer name="minicart.addons"> <block class="MassiveArt\ShoppingCart\Block\ButtonGet" name="...


0

so I changed the implementation a bit, there was a problem with the getItem() method and I went with the following get current customer ID $customerId = $this->_session->getCustomerId(); get wishlist by customer ID $wishlist = $this->_wishlist->loadByCustomerId($customerId, true); I had to set create to true here otherwise the collection was ...


0

Copy the vendor/magento/theme-frontend-luma/Magento_Theme/layout/default.xml file in your app/design/frontend/[vendor]/[theme]/Magento_Theme/layout folder and add the following line to the container <referenceBlock name="footer_links" remove="true"/> This will remove the footer links you are trying to remove.


0

To remove footer links, create default.xml file on path app/design/frontend/VendorName/ThemeName/Magento_Theme/layout and add below code <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <...


0

Footer Links Remove List of below link block: Privacy and Cookie Policy: privacy-policy-link Search Terms: search-term-popular-link Contact Us: contact-us-link Advanced Search: catalog-search-advanced-link Orders and Returns: sales-guest-form-link To add new links to footer links, use this code: <referenceBlock name="footer_links"> <...


0

In addition to Amit Bera's answer, make sure that if you're adding any new parameters to the __construct() method that you add them before any parameters with default values (like null) defined.


2

You can try monitoring the elasticsearch slowlog to see how the queries are actually being executed. Change the index from twitter to whatever your index name is or * for all. Then you can find the logs at: var/log/elasticsearch/elasticsearch_index_search_slowlog.log PUT /twitter/_settings { "index.search.slowlog.threshold.query.debug": "0s", "index....


2

Following this page Have you tried running - Verify that Elasticsearch is working by entering the following command on the server on which it is running: curl -XGET '<host>:9200/_cat/health?v&pretty' A message similar to the following is displayed: epoch timestamp cluster status node.total node.data shards pri relo init unassign ...


1

Create Dynamic Custom Tabs on Product View Page This is the only best solution I have ever seen for adding a tab in product details page. It is working in 2.3.2.


0

The issue seems to have now been resolved. Thanks to @Hassan Al-Jesh and @Mitro for their advice. It turns out that it was the extension "Shipping Table Rates" by Amasty that was causing the issue. As I needed this extension to calculate shipping, simply disabling it (as in 281311) was not an option. The solution was simply to delete all of the ...


1

Try something like this: <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="review_product_form_component"/> <body> <referenceBlock name="product.info.details"> ...


1

you can do it like so: <referenceBlock name="product.info.details"> <block class="Module class" name="unique name" as="alias if you want" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info"> <arguments> <argument name="css_class" xsi:type="string">class if you want to</argument> &...


0

I discovered this problem caused by some bootstrap scss files such _reboot.scss and _boot.scss I have added to default_head_blocks.xml but it doesn't work the question is how to remove _reboot.scss and _boot.scss? or can I override these two files to them (neutral) not affect any tag?


2

LocalizedException The \Magento\Framework\Exception\LocalizedException varies from \Exception in the way that it uses Magentos \Magento\Framework\Phrase for the raw message that is going to be displayed or logged. This makes sure that you can display the messages in the language of your store. From the Technical guidelines: 5.17. Exceptions which ...


1

Run this command: php bin/magento catalog:images:resize


1

login in Magento admin section and navigate to store -> configration -> sales -> Tax Click on shopping cart display settings and make sure you have No for Display Full Tax Summary. If it is yes make it No. After change configuration Clear cache. Please find attachment


2

Please create module and add below code in Block file. <?php namespace Vendor\CustomerGroup\Block; class CustomerGroup extends \Magento\Framework\View\Element\Template { public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\ResourceModel\Group\CollectionFactory $...


0

Please try with below code : <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $groupOptions = $objectManager->get('\Magento\Customer\Model\ResourceModel\Group\Collection')->toOptionArray(); ?> <select> <?php foreach($groupOptions as $groupOption) { ?> <option value="<?php echo $groupOption-...


0

use this code $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $groupOptions = $objectManager->get('\Magento\Customer\Model\Customer\Attribute\Source\Group')->getAllOptions(); $fieldset->addField( 'customer_group', 'multiselect', [ 'name' => 'customer_group[]', 'label' => __('Customer Group'),...


0

I see that you pass parameter of class AttributeValueProvider with null default value. The problem should be caused by the way you pass this parameter in dependency injection. So that when you call $this->attributeValueProvider->getRawAttributeValue($item->getProductId(), 'name') PHP will throw fatal error, because the dependency injection does not ...


0

Try to use: \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $test = $this->categoryCollection ->create() ->addAttributeToSelect('parent_id') ->addAttributeToSelect('name') ->addAttributeToFilter('parent_id', 'your_id') ->setOrder('name', 'ASC') ->load();


0

Below is the difference between For matching items only and For shipment with matching items. For matching items only: Free shipping is available only for specific items in the cart that match the rule. For shipment with matching items: Free shipping is available for the entire cart when a coupon that is based on the rule is used.


Top 50 recent answers are included