Categories
CMS Magento Mastering Development

knockout template html file in adminhtml area is not rendering

I am trying to initialize the knockout component in the admin html area, the respective code is below. phtml file to initialize ko template <?php /** * @var \JC\ChatSupport\Block\Adminhtml\ChatList $block */ ?> <div id=”chatlist” class=”chatlist” data-bind=”scope:’chatlist'”> <!– ko template: getTemplate() –><!– /ko –> phtml <script type=”text/x-magento-init”> { “#chatlist”: { “Magento_Ui/js/core/app”: { “components”: { “chats”: { […]

Categories
Mastering Development

Add-AzTableRow command is not available in Azure Cloud Shell

I’m trying to insert new row in my table storage by using Azure Cloud Shell but I’m facing below exception. So let me know any other command that we need to use to insert. Blockquote Add-AzTableRow: The term ‘Add-AzTableRow’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check […]

Categories
CMS Magento Mastering Development

Price Utils issue

Hi, I am trying to format the price using ‘Magento_Catalog/js/price-utils’. require( [ ‘jquery’, ‘Magento_Catalog/js/price-utils’ ], function ($, priceUtils) { console.log(priceUtils.formatPrice(selectedPrice)); }); Can someone help me with this? I am getting the selected price from the product view. Thanks

Categories
Mastering Development

Typescript value of 2nd item of array based on value of 1st item array

I have object of arrays, where each array is pair [value, function], where function accepts value in parameter: const items = { first: [‘a’, val => val.length], // val should be string second: [[1, 2], val => val.push(3)] // val should be number[] } Is there any way to set type of function parameter (second […]

Categories
CMS Magento Mastering Development

Group Product formatting price issue

I am trying to format the price using ‘Magento_Catalog/js/price-utils’, require( [ ‘jquery’, ‘Magento_Catalog/js/price-utils’ ], function ($, priceUtils) { console.log(priceUtils.formatPrice(selectedPrice)); }); Can someone help me with this? I am getting the selected price from the product view. Thanks

Categories
User Help

Powershell won’t run ps1 files

Completely baffled by this. Can’t seem to run any ps1 files on powershell?? I know for sure it was working fine last week. Here is the error I’m getting. It suggests the file doesn’t exist, so I proved it does by using Test-Path first… PS C:\WINDOWS\system32> cd C:\Users\Public if (Test-Path test.ps1) { ./test.ps1 } ./test.ps1 […]

Categories
User Help

Powershell won’t run ps1 files

Completely baffled by this. Can’t seem to run any ps1 files on powershell?? I know for sure it was working fine last week. Here is the error I’m getting. It suggests the file doesn’t exist, so I proved it does by using Test-Path first… PS C:\WINDOWS\system32> cd C:\Users\Public if (Test-Path test.ps1) { ./test.ps1 } ./test.ps1 […]

Categories
CMS Magento Mastering Development

Uncaught TypeError: target.extend is not a function

I am having this issue with disposable-customer-data-mixin.js In a module for Gdpr Cookie for magento 2.3.4 Code is: define([ ‘jquery’, ‘mymodule_GdprCookie/js/action/cookie-decliner’ ], function ($, cookieDecliner) { ‘use strict’; var mixin = { initialize: function () { return cookieDecliner.call(this, this._super); } }; return function (target) { return target.extend(mixin); }; }); I think I have issue in […]

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

Checkout custom shipping address field – set as required

I have created a custom module that adds a text field in shipping address. It’s workin ok but I’d like to make it required. How can I do that? I tried adding ‘required-entry’ => true at validation parameter, in file Plugin/Checkout/LayoutProcessor.php but it didn’t work. Here are the module files: Mymodules/FieldCheckout/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, ‘Mymodules_FieldCheckout’, […]