Categories
CMS Magento Mastering Development

Magento 2 Hide Shipping Price on Checkout with Mixin

I have added a mixin for checkout shipping.js: requirejs-config.js var config = { config: { mixins: { ‘Magento_Checkout/js/view/shipping’: { ‘Vendor_Modulename/js/view/checkout/shipping’: true } } } }; shipping.js define([ ‘jquery’, ‘uiComponent’ ], function ($, Component) { ‘use strict’; var mixin = { defaults: { shippingMethodListTemplate: ‘Vendor_Modulename/checkout/shipping-address/shipping-method-list’, shippingMethodItemTemplate: ‘Vendor_Modulename/checkout/shipping-address/shipping-method-item’ }, canShowShippingPrice: function () { console.log(“CAN SHOW SHIPPING:”, false); […]

Categories
CMS Magento Mastering Development

magento2.2.3 How to set knockout js scope when I use data-mage-init?

I’m working on Magento2.2.3. I am overriding products on the list page. Exactly I’m adding Already added qty for each product next to the add to cart button on the list page. To show this qty, I made a custom phtml file. Let’s call it custom.phtml In custom.phtml file, I add qty_change.js to get qty […]

Categories
CMS Magento Mastering Development

magento2.2.3 How to set knockout js scope when I use data-mage-init?

I’m working on Magento2.2.3. I am overriding products in list page. Exactly I’m adding Already added qty for each product next to add to cart button in list page. To show this qty, I made a custom phtml file. Let’s call it custom.phtml In custom.phtml file, I add qty_change.js to get qty of each product […]

Categories
CMS Development Magento

Magento2 mixin with custom component to extend checkout summary totals

I am not sure what I am missing here, I am trying to hide prices on my checkout totals using mixin with a custom component. view/frontend/layout/default.xml <?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> <referenceContainer name=”content”> <block name=”hideprices” class=”Vendor\Module\Block\Js\MyComponent” template=”Vendor_Module::js/mycomponent.phtml”/> </referenceContainer> </body> </page> Block/Js/MyComponent.php <?php namespace Vendor\Module\Block\Js; use Magento\Framework\Json\Helper\Data as JsonHelper; class MyComponent extends \Magento\Framework\View\Element\Template { protected […]

Categories
CMS Development Magento

How can I display related products in the minicart? – Magento2

In Magento Commerce Cloud (Magento 2), I am trying to display related products in the Minicart after a user adds an item to the cart. The specific issue is that my code works in the Docker local development environment, but does not seem to work in the production Magento Commerce Cloud environment. I have Up-sell […]

Categories
CMS Development Magento

Magento2: How to get cart product category ids by Knockout JS?

I want to get the cart product category ids by Knockout JS. define([ ‘jquery’, ‘ko’, ‘mage/url’, ‘uiComponent’, ‘Magento_Customer/js/customer-data’, ‘uiRegistry’ ], function ($, ko, url, Component, customerData, registry) { ‘use strict’; return Component.extend({ defaults: { template: ‘Vendor_Module/product/configurator’ }, observableProperties: [ ‘items’ ], /** @inheritdoc */ initialize: function () { this._super(); var self = this; this.lastItem = […]

Categories
CMS Development Magento

Magento 2 UI Component conflicts between observable value

I try to add UI Component to product item on product list due to difficult FE login for each item. But I was wondering when conflicts between components appeared. All components for each item has a unique name. This is an example how I try to implement it: Added div with scope to list.phtml and […]

Categories
CMS Development Magento

Magento 2 UI Component conflicts between observable value

I try to add UI Component to product item on product list due to difficult FE login for each item. But I was wondering when conflicts between components appeared. All components for each item has a unique name. This is an example how I try to implement it: Added div with scope to list.phtml and […]

Categories
CMS Development Magento

Magento2: How to get Cart items collection on Product view page?

I want to get Cart items collection on product page. customer-data.js define([ ‘jquery’, ‘ko’, ‘uiComponent’, ‘Magento_Customer/js/customer-data’ ], function ($, ko, Component, customerData) { ‘use strict’; return Component.extend({ /** @inheritdoc */ initialize: function () { this._super(); this.items = customerData.get(‘cart’)().items //get cart items console.log(this.items); } }); }); product.phtml <div class=”col-md-12″ data-bind=”scope: ‘section'” style=”padding: 0;”> <!– ko template: […]

Categories
Development

JSF UIComponent.popComponentFromEL causing high CPU utilisation

I’m having high cpu usage during the day (100% or more) consistenly. So, I tried to find the problem using Yourkit profiler, and looking at the threads tab, i found this log. There were several threads with these same stack trace. I’m having a hard time interpreting what’s happening. ¿Can someone help me? http-nio-8080-exec-3 Runnable […]