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.

3
votes
1answer
40 views

Magento 2 create ajax request from out of magento

I wanna create Ajax request from empty HTML with jQuery. I do like this $.ajax({ url: "http://****.com/rest/V1/integration/admin/token?username=***&password=****", type: "POST", ...
1
vote
0answers
17 views

Magento2: Issue with load more products

We have any issue with load more products (no load photo product). Please on down page click "load more". https://gerris.pl/new-arrivals Any solution?
3
votes
4answers
16k views

Call a PHP file with AJAX in Magento

Seems like I can't make Ajax to call the PHP file and I can't figure out what or where the problem is. I`m trying to make a module that reads from database and it should display a form with options to ...
0
votes
0answers
10 views

Incrementing cart total price with ajax but total price is not displaying at correct place

When trying to update cart......total price is not showing at right place. I am using below mentioned code : <script> function postStuff(){ // Create our XMLHttpRequest object var hr = new ...
1
vote
3answers
152 views

Quote id is empty when inserting multiple records into cart in magento2

I am adding product to cart from ajax by passing product id Here is my controller code. use Magento\Framework\Controller\ResultFactory; use Magento\Framework\App\Action\Action; use Magento\...
4
votes
2answers
213 views

Magento 2 - Slick slider function not working

Slick slider function is not working after ajax response, This is the order of my code. Firstly I got a product collection response, Then I wrote a slick slider function. but slider function is not ...
0
votes
0answers
24 views

Magento 2.2 Ajax not working on second time in category page

My site was working fine, suddenly the ajax on category pages is not working on second time. On first time it works fine, whether it is pagination or layered navigation but on second time it doesn't ...
1
vote
1answer
31 views

How to use ajax in alert modal magento 2?

I have this ajax code and i want to use alert modal of magento 2. <script> require(['jquery'],function($){ $(document).ready(function() { $("#vendor_search").on('click',...
1
vote
1answer
6k views

“Uncaught TypeError: Cannot read property 'submit' of undefined” while adding product to basket

I am working with a mobile theme. I am trying to make an ajax request to add the product from product detail page and show a pop up after the addition. But while clicking the "Add to cart" button it ...
1
vote
1answer
19 views

In Magento 2, Why it is not refreshing shipping methods after State field select

In Magento 2, after Country filed select then shipping methods refreshing automatically. But why it is not refreshing shipping methods after State field select and how to apply refresh to state field ...
1
vote
0answers
28 views

Filter product with Ajax and return Json Array from a controller to show in a phtml file

Is it possible to return an array from a controller or from a block function to the phtml file? <?php namespace Mnuhell\FormSearchAttributes\Controller\Index; use Magento\Framework\App\Action\...
3
votes
1answer
1k views

Ajax not working in Magento 2 admin

I'm using ajax in Magento 2 admin. But it not working. My controller: class CustomAjax extends \Magento\Backend\App\Action{ protected $resultJsonFactory; public function __construct( \Magento\...
2
votes
0answers
18 views

Magento 2.2: Ajax login is not working in Mozilla and IE

I added ajax login form in my custom theme and it's working fine in chrome but in Mozilla when I try to log in it redirects me to the same page. I am unable to log in. Here is my ajax code: <...
0
votes
1answer
1k views

Javascript in ajax loaded modal popup

I'm working on a module that needs to open modal window and show some content inside of it + some js logic. So I load template with ajax request which works just fine: (simplified template): <...
0
votes
0answers
22 views

Magento Show Payment Method Validation

I'm working on a magento 1.9 payment gateway extension. It have a little form on payment method step and when we fill and clickon next button it validate after validate it call to this function /...
4
votes
1answer
3k views

How to get quote and update total through AJAX Magento 1.9

In cart page when postal code is entered and pressed get quote button then it submits one form and shows the rate of that postal code after that update button appears and clicking on that updates the ...
0
votes
0answers
25 views

How to make words translatable in js file , Magento 1.9

I have a problem with translation in Magento 1.9. I want to translate the "Search:" word, but have no idea how. As you can see the "Search:" word isn't in the red frame. In project i found one place ...
2
votes
4answers
4k views

How to send ADMIN AJAX request?

I need to retrieve some information from my custom admin controller using AJAX. But when AJAX is used I get current page's entire HTML ! I simply want to get some JSON data from my custom ...
0
votes
0answers
14 views

Magento 2 Newsletter Subscription via Ajax

I've installed the module to subscribe to the newsletter via ajax. Without using the javascript file I get a new page with the message it's okay. When I make use of the javascript file, I get the ...
4
votes
2answers
2k views

Apply Magento Coupon in Ajax Without Redirecting to Cart Page

I have coupon code on sidebar on my product categories list, cart and checkout page. Whenever I'm trying to add coupon code while being on the product or category list page or checkout page, it is ...
0
votes
2answers
1k views

Magento:Upload file in ajax form

I have a custom frontend form. The form is submitted via ajax. The form has a "type=file" field. I want to save the uploaded file to a folder.How can I do that. Please help.. How is it possible to ...
0
votes
2answers
6k views

Sending ajax POST data to controller

This is my ajax request: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ ...
0
votes
0answers
26 views

Prevent Ajax calls on Homepage

What is the purpose of these ajax calls and how to prevent these Ajax calls on magento 2 homepage, or atleast minimize their execution time because they are taking load time of around 3-4 secs on my ...
1
vote
2answers
1k views

Update Cart Page by Ajax on quantity change

I have to update the main cart on change of quantity by Ajax without click on "Update Cart Button" and without reloading the page. By the following code, I'm able to update cart table but m not ...
1
vote
0answers
31 views

Ajax Cart - Out of stock [closed]

I have ajax cart from porto theme. But when I am add more product than stock, the ajax cart crash (wheel is just rotating) and I got no message How to fix this issue?
2
votes
2answers
49 views

Magento 2 secret key problem

I've a form that performs an Ajax call to a controller, but the response always is You entered an invalid Secret Key. Please refresh the page. PereiraTech/Faturamento/Controller/Adminhtml/Ac/Index....
1
vote
0answers
24 views

AJAX call returns the same page html

I have a module that I need to do a php GET action and get some informations from php file. The problem is that the returned value is the Dashboard html. Faturamento/Controller/Adminhtml/Ac/Index....
0
votes
0answers
28 views

Magento 2 Change Store View using Ajax

I want to change the store-view according to user-address in checkout. If store view does not change by using ajax, then can we change the cart summary.
0
votes
1answer
43 views

How to Fetch results from server using JQuery AJAX? on the basis of Drop-down Condition

I have two conditions, if two conditions are matching the given value should display. I am using input value as Drop down. If the value of two drop-downs matched i need to display my value on same ...
0
votes
0answers
52 views

AJAX login/register with Amasty_Fpc does not update full page cache

When you log in with an AJAX request, the full page cache is not updated when using Amasty_Fpc. This happens only on the page on which user log in. The problem is observed with many modules (for ...
2
votes
1answer
22 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 ...
0
votes
1answer
559 views

Admin controller is not being called in Magento Ajax

I am calling admin controller via ajax, but it is not being called. Here is the controller file- Assel/Allstock/controllers/Adminhtml/AllstockController <?php class ...
13
votes
2answers
623 views

How to update Shipping rates using Ajax when cart item is deleted on Checkout-Cart page?

My Shipping rates are calculated based on item present in cart and now on deletion of item on Checkout/Cart page, I need to update the Shipping rates. As of now, Remove Item on Checkout/Cart page ...
0
votes
1answer
27 views

Magento 1.9.2. - Validate email if already exist with ajax without custom module

Before registering I would like to validate the email field entered by the user to know if it exists in the database. This is my code: <input type="text" name="emailreg" value="" id="emailPreReg" ...
0
votes
1answer
47 views

Magento2 update cart on qty change event plugin created

My website i have updatecart on qty btn change event call so with ajax how to created a plugin for this.
0
votes
1answer
409 views

Load all gallery images in category on hover (Ajax)

I have a code to load all the gallery images of a product in category, it will work but the problem is that will load ALL gallery images for products in the category (list.phtml) so will increase ...
4
votes
1answer
972 views

For Ui Component admin form Field with ajax updating the select value

I have a select field in the UI component, on the changing the select field with ajax how to load the next select field.in the admin side?
2
votes
0answers
79 views

Mini Cart Update issue

I am facing mini cart update issue - to replicate the issue you need to browse the site and add a product to the cart - then continue shopping. If you press checkout (instead of continue shopping) the ...
0
votes
1answer
578 views

One page search result using ajax

I'm using Magento 1.9 C.E, and I want to remove pagination from catalog search result page. I want all the results to be coming on the same page itself with ajax. On click of a load more or something, ...
1
vote
1answer
28 views

Magento 2.2.7 - Reload totals cart using Ajax

I have tried below code var deferred = $.Deferred(); getTotalsAction([], deferred); But no luck and instead below error i am facing Uncaught TypeError: Cannot read property '...
1
vote
0answers
38 views

Magento 2.3 Ajax Breadcrumb Product-Detail

When the Product-Detail Page is loaded, on Magento 2.3 the Breadcrumb is loaded via an Ajax request. This causes a large delay, because of the amount of requests on the product page. How could I ...
1
vote
4answers
3k views

Magento2 ajax fails in admin

In admin I have the following controller: <?php namespace Vendor\Module\Controller\Adminhtml; use Magento\Backend\App\Action\Context; class Test extends \Magento\Backend\App\Action { /** ...
1
vote
0answers
43 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
1answer
599 views

set a product list with pager in ajax action controller

I am trying to set child to another block using the following script : public function refreshlistAction() { $data = $this->getRequest()->getParams(); if (isset($data['delivery'])) { ...
1
vote
0answers
34 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($...
0
votes
1answer
591 views

Add to cart - Loader spins until timeout, but product was added quickly

Magento Community 1.9.2.4 Systems were working until an extension from BSS Commerce (Defer Javascript) was installed and a couple of other internal small changes were made. EDIT The BSS Commerce ...
1
vote
1answer
574 views

Add to cart inconsistent after 2.0.2 upgrade

On my webshop the add to cart using the default Luma theme is inconsistent working / not working. If add to cart from frontpage, its not working, if i go to a product page and add to cart then both ...
0
votes
1answer
590 views

Ajax Cart Does NOT work with Full Page HTTPS (SSL)

I turned on Full Page https, so all pages load only in HTTPS. Now I realized that AJAX cart throws error window when I try to add somethign to the cart. Any ideas where to look for the cause? I can ...
4
votes
0answers
36 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 ...
1
vote
0answers
40 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 ...