Categories
CMS Magento Mastering Development

How to Show Static CMS block in Magento 2 html file?

I want to Show Static CMS block in Magento 2 html file. So, I created these files Model/ConfigProvider.php <?php namespace Reg\Checkout\Model; use Magento\Checkout\Model\ConfigProviderInterface; use Magento\Framework\View\LayoutInterface; class ConfigProvider implements ConfigProviderInterface { /** @var LayoutInterface */ protected $_layout; protected $cmsBlock; public function __construct(LayoutInterface $layout, $blockId) { $this->_layout = $layout; $this->cmsBlock = $this->constructBlock($blockId); } public function constructBlock($blockId){ $block […]

Categories
CMS Magento Mastering Development

Magento 2 Show Messages at Checkout

I am trying to show a message at checkout based on a Store ID. So for different stores I show different messages either with the shipping method or the payment method. Here is what I have: — Sorry, I couldn’t get the code blocks below to work consistently. view/frontend/layout/checkout_index_index_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="checkout.root"> […]

Categories
CMS Magento Mastering Development

Magento 2 – Create repeatable field in checkout and saving the data to model

I am trying to create fields for each product in the cart. Some extra data needs to be filled in per product and the wish was for it to be found in the address section of the checkout form. I can create the fields correctly with the following view elements: define( [ ‘jquery’, ‘ko’, ‘uiComponent’, […]

Categories
CMS Magento Mastering Development

Magento 2 use custom data in ui component

I’m adding a custom UiComponent to checkout using Layout Processor: LayoutProcessor.php $this->jsLayout[‘components’][‘checkout’][‘children’][‘sidebar’][‘children’][‘summary’][‘children’] = ‘my-item’ => [ ‘displayArea’ => ‘my-item’, ‘component’ => ‘Vendor_Module/js/view/my-item’, ‘config’ => [ ‘template’ => ‘Vendor_Module/my-item’ ], ‘custom-data’ => ‘some custom data’ ]; Vendor_Module/js/view/my-item.js define( [ ‘jquery’, ‘ko’, ‘uiComponent’, ‘Magento_Checkout/js/model/totals’ ], function ($, ko, Component, totals) { ‘use strict’; return Component.extend({ items: ko.observable([]), […]

Categories
CMS Magento Mastering Development

Add a from in newly added step in checkout page magento 2

we follow this step to add a new form in checkout page. we need to add some form fields in that newly added steps. I have updated the checkout_index_index.xml file based on shipping-step. But its not working. Suggest me, which way i need follow. what I did: Vendor/Module/view/frontend/web/js/view/schedule-on-appointment-view.js define( [ ‘ko’, ‘uiComponent’, ‘underscore’, ‘Magento_Checkout/js/model/step-navigator’ ], […]

Categories
CMS Magento Mastering Development

Magento 2 How to observe cart price in JS Component

I want to show amount after which free shipping will be available in mini cart like below For that I override minicart.phtml in view/frontend/layout/defaul.xml 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”> <body> <referenceBlock name=”minicart” template=”Vendor_Module::cart/minicart.phtml” /> </body> </page> And create my own ui component fst.js define([ ‘uiComponent’, ‘ko’, ‘Magento_Customer/js/customer-data’ ], function (uiComponent, ko, customerData) { […]

Categories
CMS Magento Mastering Development

Magento 2: Add 2 JS files in that depend on each other in checkout page

I tried to add 2 js files in checkout page using require-config.js from a custom extension like this: app/code/Vendor/Module/view/frontend/requirejs-config.js var config = { “map”: { “*”: { ‘GAP’: ‘Vendor_Module/js/gap’, ‘GAP-PICKER’: ‘Vendor_Module/js/gap-picker-min’ } } }; The gap.js and gap-picker-min.js are located under app/code/Vendor/Module/view/frontend/web/js, the gap-picker-min.js will be depended on gap.js , but when i tried to […]

Categories
CMS Magento Mastering Development

How to redirect from payment gateway to success page using the callback URL in Magento 2.x

I had integrated the Razorpay payment gateway in my Magento site. It’s working absolutely fine on the web and mobile browser. But when I try to make the payment using in-app browsers (from Instagram, Facebook) I am facing the blank page issue. So I found the solution that I need to pass the callback URL […]

Categories
CMS Magento Mastering Development

Magento2: Issue with additional dropdown option in checkout

I used module delivery date from: https://github.com/sohelrana09/magento2-module-delivery-date/tree/master/SR/DeliveryDate I want to this module add custom dropdown option, should be like this: Here I edit file: Modify following class app/code/SR/DeliveryDate/Model/DeliveryDateConfigProvider.php namespace SR\DeliveryDate\Model; use Magento\Checkout\Model\ConfigProviderInterface; use Magento\Store\Model\ScopeInterface; class DeliveryDateConfigProvider implements ConfigProviderInterface { const XPATH_FORMAT = ‘sr_deliverydate/general/format’; const XPATH_DISABLED = ‘sr_deliverydate/general/disabled’; const XPATH_HOURMIN = ‘sr_deliverydate/general/hourMin’; const XPATH_HOURMAX = ‘sr_deliverydate/general/hourMax’; […]

Categories
Mastering Development

How to merge multiple stocks onto single data frame and find monthly returns

I am trying to pull stock information in R and cant figure out how to combine all of my stocks under one data frame. I can pull the data from excel, however, I have to manually update excels stock numbers. I have attached a picture of what I am looking for but utilizing only R […]