Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ajax]

AJAX (Asynchronous JavaScript and XML) is a technique for creating seamless interactive websites via asynchronous data exchange between client and server. AJAX facilitates communication with the server or partial page updates without a traditional page refresh.

1
vote
0answers
19 views

Ajax call always returns in error from controller Magento 2

From my controller, I return a JSON data to my Ajax call but it always goes in the error section, even when it's not an error. jQuery.ajax({ type: 'POST', url: '/yxcustomer/index/...
1
vote
0answers
11 views

Show notification message after ajax call

I have my own controller for a customer address delete, so at the end of the controller, I send a notification message to notify the user. try{ $this->_addressRepository->deleteById($...
1
vote
0answers
26 views

Magento2 Checkout cart automatically updates when qty changes with ajax

Magento2 checkout cart page Please ensure when quantities are changed that the cart automatically updates. Some customers might change the quantity and if they dont click update cart they might move ...
4
votes
0answers
26 views

How to create a basic progress bar with ajax, when il click add to cart in Magento 2?

I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function I follow a video example in ...
3
votes
0answers
27 views

Adding a configurable item to cart via ajax

I've inherited a project which lists configurable products in the catalog view, as well as listing the simple products attached to that configurable product. For example; Configurable Product: ...
1
vote
0answers
14 views

Show magento loader ajax

how can I show the loader only on my div and not on the body during an ajax call ? Can't make it work. Here's my code, I have the show loader and the context but I'm missing something ? <div id="...
0
votes
0answers
29 views

Magento 2 401 Ajax Post Request

So I have the following AJAX Post request within vendor/MyModule/view/frontend/templates: let controllerUrl = "<?php echo $block->getUrl('MyModule/index/GetDates'); ?>"; $.post(...
2
votes
0answers
15 views

Magento2 ajaxsuite- ajax login

I want to show Ajax suit modules, Ajax login popup on cart page when press checkout button. right now, I used $('.modals-wrapper .popup-authentication').addClass("_show") and it shows magento2 ...
1
vote
1answer
22 views

Magento 2 Ajax call not working

I am trying to update whole minicart content but my ajax call is not working $.ajax({ url: "my_controller_url", type: "POST", success: function (result) { $(".minicart").html(...
0
votes
2answers
60 views

Magento 2 layered navigation Ajax jquery problem

I am having this problem from Magento 2.2.5 and when upgraded to Magento 2.3 also. I use custom template Layered navigation with Ajax isn't working. I use Amasty one It just refreshes the page and ...
0
votes
1answer
21 views

Magento 2 AJAX Post to another module's controller

I was wondering if it were possible to send an AJAX Post over to a controller contained within a custom module I have created. The reason for doing this is because I want to separate my logic out from ...
2
votes
1answer
37 views

Load a jQuery script after fully loading the page

I'm struggeling with this. My jQuery script works fin with every of my input, but not with the input loaded by AJAX, such as the mini-cart input. The code (and the css) is used to do this : add to ...
2
votes
0answers
22 views

Amazon Payment agreement checkbox not working

Checkbox for agree not work currently and always show this message. I think does this is javascript or Ajax conflict. Please agree to all the terms and conditions before placing the order.
1
vote
1answer
51 views

Magento 2 Minicart Ajax update

I need to update mini cart without the need to click on update button (just clicking on +/- button) I can't find module or code to do that!
1
vote
1answer
43 views

Database-Based & Redis-Based Customer-Session Empty Data Issue in Magento 2 Using 2 Web-Servers

I am facing a problem in getting session data in Magento 2, when I deploy my Build on 2 Web-Servers. I am facing no issue on Single Web-Server. Problem Details I am setting some data in session, in ...
1
vote
0answers
73 views

Expected to start loader but did not find one in the dom - Ajax Call Magento 2

I have implemented Ajax call to add product to cart, which is somewhat like below: $.ajax({ showLoader: true, url: SERVER_URL+'common/custompurchase/addtocart', data: data, type: "...
2
votes
0answers
20 views

how to edit quantity in cart with ajax magento 2?

I'd like to know how to change the quantity of a product on front using ajax ? When I change the quantity in the input and them click on the small pencil to apply modification, I'm redirected to the ...
0
votes
0answers
38 views

Ajax call on controller and get collection in grid

I am creating a functionality on my custom phtml. I want simple ajax call on my controller and get product grid in response. to ajax call I used this: require(['jquery'], function($){ $.ajax({ ...
1
vote
1answer
30 views

save-data-using-sales-order-model

I am sending ajax request to save data in my custom field in sales_order table , It saves data successfully in case of exit, but not with out exit, any suggestion //Not working public function ...
0
votes
1answer
45 views

What is the ajax url if

help, what will be the ajax url if method is in: /app/code/core/Mage/Adminhtml/controllers/CmsBlockController.php ?
0
votes
0answers
25 views

How to make an AJAX button on an admin grid container?

I have my admin grid container working and I have added a button to the top right of the page using this: class My_Class extends Mage_Adminhtml_Block_Widget_Grid_Container { public function ...
1
vote
1answer
57 views

How to re init ajax add to cart inside the response in magento2

I have installed third-party module Infinite scroll for the lazy load(Lof_Ajaxscroll). The problem I am facing is Once the page loads new HTML content is generated from ajax. So add to cart is not ...
1
vote
2answers
25 views

Magento 2 custom ajax request

In my custom module have a custom ajax request for sending selected date (datepicker) to controller and found this exception when access controller Block1 exception(s): Exception #0 (...
0
votes
2answers
84 views

Add multiple items to cart in Magento2

I am implementing add to cart functionality from ajax using product id. This is my code of template file <tr class="border_bottom child-items selected"> <td >...
0
votes
0answers
26 views

Magento 1.9.2. - Update breadcrumb with ajax filter category

I created a filter in my layered navigation that covers all the categories of my site. The effect with ajax seems to work correctly and the contents update just like other normal filters. The problem ...
0
votes
0answers
9 views

Magento 2 user field validation using an API

In a dedicated data table where we stored customer's privilege card number in order to validate them with users that they enter to a field called "privilege card no" On such an occasion I'll have to ...
0
votes
2answers
36 views

Calling M2 REST API from browser for anonymous users

I'm trying to call REST endpoints from the browser. Initially, I'd like to be able to fetch product information. It looks like session-based authorization is what I'm after. I started by grabbing a ...
0
votes
0answers
26 views

Magento Amasty FPC and Dynamic Content

We have Amasty FPC and want to use their hole punch method for Dynamic Content but I’m a little confused on the XML configuration file. Their is two methods which have the block exclusions - one is ...
0
votes
2answers
65 views

How to create AJAX action for POST requests in Magento 2.3?

How to create a controller action that can be requested by POST properly in own custom payment module in Magento 2.3? How to create a parent class that will be extended by classes corresponding to ...
0
votes
0answers
43 views

Category page custom category filter magento2

I have loaded custom template before the product list in category list page. this is my block file Vendor/Module/Block/Category.php <?php namespace Vendor\Module\Block; class Category extends \...
1
vote
0answers
76 views

Populate sub category drop down based on category selected magento2

I have used below code to populate sub categories in other dropdown once the parent category is selected. Used this code in my template file. app/code/Vendor/Module/view/frontend/template/category....
0
votes
0answers
17 views

magento 2 getting product grid on passing category id in frontend

Is there a way i can get ajax response of product grid on passing category id. On a custom page i want to pass category id as ajax so that it can return product collection with image,title etc how it ...
1
vote
1answer
82 views

Generation does not exist

I have this code for a AJAX call: Controller/Data/Get.php <?php namespace Vendor\Module\Controller\Data; class Get extends \Magento\Framework\App\Action\Action { protected $...
1
vote
0answers
27 views

Forms not working with array fields

Don't know something has gone wrong. Suddenly on my magento (1.9) site forms which have array fields are not working. for example :- <input type="text" name="inputfield['first']" id="...
0
votes
2answers
69 views

Invalid Return Type in Ajax Call

I made an ajax script to (at the moment) simply return some HTML to a select. My function looks like this: $.ajax({ showLoader: true, data: {val: inputVal}, /*dataType: 'json', (un)...
1
vote
1answer
28 views

Get breadcrumb in Controller Action

I need to get the breadcrumb in the controller action because I am using the cache modules(FPC and another system externally). It cached the breadcrumb in the frontend page. With that, I would use ...
0
votes
1answer
18 views

I wish to add custom section in product detail page in magento 2

How to add custom button in product page,while clicking that button it needs to show custom form in a popup ?
0
votes
0answers
25 views

I want to update qty on checkout page using ajax without page load in magento1

When I update my qty page reload I am using this code qty update but when I refresh page /* here is mu code */ jQuery(document).ready(function(){ jQuery('.btn-update').on('click', ...
0
votes
2answers
76 views

Unable to call function in ajax success in magento2

I have found below error: > Uncaught TypeError: Cannot read property 'set' of undefined. Code: <script> require(['jquery','Magento_Customer/js/customer-data','domReady!'], function ($, ...
0
votes
1answer
164 views

Magento 2 Update cart automatically on carty quantity update gives error “Mismatched anonymous define() module”

I have done everything mentioned in this post, however, it gives me an error in console: require.js:166 Uncaught Error: Mismatched anonymous define() module: function ($, getTotalsAction, ...
1
vote
0answers
25 views

How to set success and error message when custompage ajaxcall in magento2?

I want to display success message when my custom form submitted . I am doing ajaxcall here. How to achieve this? I want default page.messages not custom message div.
0
votes
0answers
26 views

Return as json instead of Html from controller renderlayout

How my code look like. In frontend layout xml file my Handle is like. <wordpress_ajax_post> <block type="wordpress/homepage" name="root" output="toHtml" template="wordpress/homepage....
2
votes
1answer
290 views

Add product to wishlist using Ajax - get response message

I'm trying to implement adding product to wishlist using ajax. I have managed to do this but I can't get the success message from response ("You have added X product to wishlist"). require([ 'jquery'...
1
vote
1answer
75 views

Ajax call issue in magento 2.2.6

My ajax call not working . It returns "A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later." my ajax call code ...
1
vote
2answers
107 views

Unable to add success message in magento2?

Unable to add success message through ajax success function using messageManager in magento2. How to display default message of magento2 using ajax functionality? JS code $('#...
1
vote
1answer
217 views

Magento 2.3 admin custom form ajax not working

Custom form ajax submit data not working in magento 2.3 its working with magento 2.1 and 2.2.x versions. Error 401 (Unauthorized) Failed to load resource: the server responded with a status of ...
0
votes
1answer
55 views

Magento 2 ajax is not working

I am trying to save form details using AJAX. Below is my Code. etc/adminhtml/routes.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
1answer
67 views

Change sorter in category select box to <ul> <li>

I want to change sort by select box into <ul> <li> type by using javascript so I can change style css for it. How can i do this?
1
vote
1answer
119 views

Magento 2: AJAX POST to AdminHTML

I have an AJAX POST setup within my template file currently that has 3 values, which I want to POST to my Index.php within my Block. However, my module is an AdminHTML module and this cannot be ...
1
vote
0answers
55 views

Update programmatically config content text/x-magento-init script inside of phtml template

For a requirement I had to override the config of the configurable.js script that is initialised inside configurable.phtml, this one specifically: <script type="text/x-magento-init"> { ...