Skip to content

popup

Auto Added by WPeMatico

How to show address fields in register when you call the block

I have included the register.phtml file in another .phtml file using the following code: <?php echo $this->getLayout()->createBlock(“MagentoCustomerBlockFormRegister”)->setTemplate(“Magento_Customer::form/register.phtml”)->toHtml(); ?> This code is used to display the registration form as a popup. Additionally, I have created an customer_account_create.xml file to enable the… Read More »How to show address fields in register when you call the block

Show Related products in the popup modal

I am using this code to show the modal when product add to cart /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ ‘jquery’, ‘mage/translate’, ‘underscore’, ‘Magento_Catalog/js/product/view/product-ids-resolver’, ‘Magento_Catalog/js/product/view/product-info-resolver’, ‘jquery-ui-modules/widget’ ], function ($,… Read More »Show Related products in the popup modal

Magento 2 Add To Cart modal is not Opening instead refreshes the page

Console Errors: Uncaught Error: Mismatched anonymous define() module: function(){var e=!1,t=!1;function s(e){this.opts=r.extend({},{onClose:null,onOpen:null,beforeOpen:null,beforeClose:null,cssClass:[],policies:[]},e),this.init()}function i(){if(!t){t=!0;var e=document.createElement(“link”);e.type=”text/css”,e.rel=”stylesheet”,e.href=”https://cdn.websitepolicies.io/lib/embed/embed.min.css”,document.head.appendChild(e)}}function n(){this.wpembed=document.createElement(“div”),this.wpembed.classList.add(“wpembed-modal”),this.wpembed.style.display=”none”,”string”==typeof this.opts.cssClass&&(this.opts.cssClass=this.opts.cssClass.split(” “)),this.opts.cssClass.forEach(function(e){“string”==typeof e&&””!=e&&this.wpembed.classList.add(e)},this),this.closeButton=document.createElement(“button”),this.closeButton.type=”button”,this.closeButton.classList.add(“wpembed-close”),this.closeButton.innerHTML=”×”,this.wpembedContainer=document.createElement(“div”),this.wpembedContainer.classList.add(“wpembed-container”),this.wpembedContent=document.createElement(“div”),this.wpembedContent.classList.add(“wpembed-content”),this.wpembedContent.style.userSelect=”none”,this.wpembedContainer.appendChild(this.wpembedContent),this.wpembed.appendChild(this.closeButton),this.wpembed.appendChild(this.wpembedContainer)}function o(){this._events={policyLink:p.bind(this),closeButton:d.bind(this),clickOutside:c.bind(this),escButton:h.bind(this)};var e=this;this.policyLinks=document.querySelectorAll(‘a[href*=”/policies/view”‘);for(var t=0;t<this.policyLinks.length;t++)this.policyLinks[t].getAttribute(“data-wpembed”)&&”inline”==this.policyLinks[t].getAttribute(“data-wpembed”)||this.policyLinks[t].classList.contains(“wpembed-inline”)?this.policyLinks[t].getAttribute(“data-wpbusy”)||(this.policyLinks[t].dataset.wpbusy=!0,e.getPolicy(this.policyLinks[t],!0)):this.policyLinks[t].getAttribute(“data-wpbusy”)||(this.policyLinks[t].dataset.wpbusy=!0,this.policyLinks[t].addEventListener(“click”,function(t){t.preventDefault(),e.getPolicy(this)}));this.closeButton.addEventListener(“click”,this._events.closeButton),this.wpembed.addEventListener(“mousedown”,this._events.clickOutside),document.addEventListener(“keydown”,this._events.escButton)}function c(e){var t=this.wpembed.offsetWidth-this.wpembed.clientWidth,s=e.clientX>=this.wpembed.offsetWidth-15,i=this.wpembed.scrollHeight!==this.wpembed.offsetHeight;(“MacIntel”!==navigator.platform||0!==t||!s||!i)&&!function e(t,s){for(;(t=t.parentElement)&&!t.classList.contains(s););return t}(e.target,”wpembed-modal”)&&e.clientX<this.wpembed.clientWidth&&this.close()}function l(){for(var e=0;e<this.policyLinks.length;e++)this.policyLinks.removeEventListener(“click”,this._events.policyLink);this.closeButton.removeEventListener(“click”,this._events.closeButton),this.wpembed.removeEventListener(“mousedown”,this._events.clickOutside),document.removeEventListener(“keydown”,this._events.escButton)}function p(e){e.preventDefault(),this.open()}function d(e){this.isOpen()&&this.close()}function h(e){27===e.which&&this.isOpen()&&this.close()}s.prototype.init=function(){if(!this.wpembed)return n.call(this),o.call(this),i.call(this),document.body.appendChild(this.wpembed,document.body.firstChild),this},s.prototype.destroy=function(){null!==this.wpembed&&(this.isOpen()&&this.close(!0),l.call(this),this.wpembed.parentNode.removeChild(this.wpembed),this.wpembed=null)},s.prototype._busy=function(t){e=t},s.prototype._isBusy=function(){return e},s.prototype.isOpen=function(){return this.wpembed.classList.contains(“wpembed-visible”)},s.prototype.open=function(){return this._isBusy()?void 0:(this._busy(!0),”function”==typeof this.opts.beforeOpen&&this.opts.beforeOpen(),this.wpembed.style.removeProperty?this.wpembed.style.removeProperty(“display”):this.wpembed.style.removeAttribute(“display”),this.scrollPosition=window.pageYOffset,document.body.style.top=-this.scrollPosition+”px”,document.body.classList.add(“wpembed-enabled”),this.wpembed.classList.add(“wpembed-visible”),”function”==typeof this.opts.onOpen&&this.opts.onOpen.call(this),this._busy(!1),this)},s.prototype.close=function(){if(!this._isBusy()){if(this._busy(!0),”function”==typeof this.opts.beforeClose&&!this.opts.beforeClose.call(this)){this._busy(!1);return}document.body.classList.remove(“wpembed-enabled”),document.body.style.top=null,window.scrollTo({top:this.scrollPosition,behavior:”instant”}),this.wpembed.classList.remove(“wpembed-visible”),this.wpembed.style.display=”none”,”function”==typeof this.opts.onClose&&this.opts.onClose.call(this),this._busy(!1)}},s.prototype.setLoader=function(){this.wpembedContent.innerHTML=”},s.prototype.setContent=function(e,t,s,i){if(i){var n=document.getElementById(“custom_policy_css”);n&&n.parentNode.removeChild(n);var o=document.createElement(“style”);o.setAttribute(“id”,”custom_policy_css”),o.textContent=i,document.head.appendChild(o)}if(t){var… Read More »Magento 2 Add To Cart modal is not Opening instead refreshes the page

When click Image and show clicking Image in popup in magento 2

How to create, When click Image and show clicking Image in popup. This is my code :- echo “<td>”?><img src=”<?php echo $this->getMediaUrl() .’brand’. $data->getImage(); ?>” width=”100px” height=”100px” class=”click-header”></td> JS Code :- <script type=”text/javascript”> require([ ‘jquery’, ‘Magento_Ui/js/modal/modal’ ], function($, modal) {… Read More »When click Image and show clicking Image in popup in magento 2

Create popup after customer logged in

How to show a popup as soon as customer logs in. I created an customer_login event and called an observer, I want to display a phtml file with my popup code. Following doesn’t work etc/frontend/events.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Event/etc/events.xsd”>… Read More »Create popup after customer logged in