We’re rewarding the question askers & reputations are being recalculated! Read more.

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.

262 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
2answers
982 views

Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php script

I have custom php script that is called with ajax. It must be stand-alone script to save spent resources because it is called 1-3 times per each page load. Init Magento for each ajax call would cause ...
5
votes
0answers
70 views

Magento2 : How to create a basic progress bar with ajax, when I click on add to cart button?

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 ...
5
votes
0answers
1k views

How to add product to wishlist after login by guest customer?

Add to wishlist is being done in AJAX for online customers and the products are successfully added in wishlist. For offline/guests, if they click add to wishlist a pop-up is shown with link to login. ...
4
votes
0answers
180 views

Magento2 : How can use ajax in custom module html file

I have added a template file .html on checkout page in order summary below Totals, In this file I want to add ajax to call my custom module controller and load some content on page. How can I achieve ...
4
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\...
4
votes
0answers
281 views

Need to create Ajax Category filter

Need to create ajax filter for category. Please help me to create AJAX category filter. I don't want any use extension. My Magento version : 1.9
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 ...
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 ...
4
votes
1answer
1k views

Tracking Ajax Add to Cart Event

I have a problem I've been struggling for a couple of days and I would really like you to point me in the right direction. I am developing a module to track basic stuff like addToCart and ViewContent ...
3
votes
0answers
43 views

Page getting cached in Magento 2

I am trying to display random products on the homepage. but my page is getting cached and on refresh, same products are displayed. I used AJAX post request also but did not work. Can anybody say how ...
3
votes
0answers
31 views

Magento 2 - Add to cart not working after products loaded by ajax

I have loaded products collection using ajax. My controller URL is something like this: www.example.com/whoboughtthisproduct/index/getproducts Now products are loading properly, but when user click ...
3
votes
0answers
40 views

in custom module ajax-loading form translations not working magento 2.3

in ajax-loading form Change English it to italiano and it works but italiano to English not working proper. once transalte to italiano then switch to english store not transalte to english ...
3
votes
1answer
108 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", ...
3
votes
0answers
35 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: ...
3
votes
0answers
251 views

How to add a register form inside the login popup during the checkout

I want to add a register form directly inside the login modal during the checkout (instead of the register link that lead to a register customer form page), so that the customer can quickly register ...
3
votes
0answers
98 views

Initialise a Jquery Widget on Demand with Jquery

I have loaded my layered navigation over ajax to speed up my site load. The layered navigation also uses ajax and it's jQuery is normally initialised via RequireJS i believe with the below requireJS ...
3
votes
3answers
5k 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 ...
2
votes
1answer
37 views

Magento 2 Product Filter By Category & Multiple Product Attributes

I'm currently building a custom product filter via Ajax. I've got the basics working but now I'm trying to filter via category and a specific product attribute. Here is my code $collection = $this-&...
2
votes
0answers
20 views

Magento 1.x - Ajax auto choose product

I want after I have pasted sku or name product into the input seach, it will automatically check and notify. I am currently using autoComplete jQuery. But the problem is that if it doesn't show drop ...
2
votes
0answers
20 views

Magento2: How to implement simple Ajax demo for Product Collection?

I want to display product using ajax method on button click same page. How is it possible in Magento?
2
votes
0answers
27 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: <...
2
votes
2answers
182 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....
2
votes
0answers
123 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 ...
2
votes
0answers
28 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.
2
votes
0answers
117 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 ...
2
votes
0answers
34 views

Need to Initialization js while ajax response magento 2

Need to Initialization js for particular div when the div append ajax response magento 2. i have append the div in ajax response and also i need initialize js for that div. How to do that
2
votes
0answers
152 views

Initialise swatches on product list loaded over ajax

I have noticed that on my infinite scroll the swatches are not showing for products loaded over ajax. I'm guessing that similar to ajax add to cart buttons needing to be initialised the swatch ...
2
votes
0answers
74 views

Show popup when update qty in mini cart using ajax magento

When I update qty in mini cart if qty is greater than the qty of products in stock, I want to show popup "The requested quantity for ...(my product name) is not available." using AJAX. How to do that?...
2
votes
0answers
343 views

Upload image with Ajax in M2

In my custom module i am trying to upload images. I am able to upload images with the help of this link https://webkul.com/blog/how-to-upload-image-in-magento2/ But is there any way where we can ...
2
votes
0answers
123 views

Magento 2 without user login add to cart ajax not working with redis session

I have Issue with Magento version. 2.2.0 with integration of redis session. In my magento 2.2.0 Redis Session is enabled , Now when user is not logged in(Guest User) to the system and try to add the ...
2
votes
0answers
22 views

Advice on most performant approach to get variables once per session

I need to pass deviceType and userState(IL, IN, IA, KS, etc) variables to GTM for marketing purporses and wondering what’s the best way to do it. To calculate deviceType I will use mobiledetect php ...
2
votes
0answers
122 views

How to show magento global message in pop up - Magento 2

I have created an ajaxcart custom plugin but I want to show the global message in which appear behind the ajax pop up.
2
votes
0answers
125 views

Magento 1 checkbox issue in the Payment Methods section from adminhtml

I have a custom checkbox in the payment method: <input class="required-entry" type="checkbox" value="1" name="test" /> I checked the checkbox and I changed the shipping method. After the ...
2
votes
0answers
801 views

How to update product quantity on check out page using Ajax in Magento

I want to provide functionality to update product quantity on checkout page of magento. so if user want to update the product quantity he can do it on without reloading checkout page. I want to ...
2
votes
0answers
378 views

Magento 2: Ajax call to customer edit form for dependent dropdown

I have created two attribute for customer as "Restaurant" and "Stores". Currently I am getting data from their respective model collection through InstallData.php in customer add/edit form. Now I want ...
2
votes
1answer
421 views

Uncaught ReferenceError: Add to cart button is not working

When I click any product from the home page "The New Born" section, Add to cart button is not working and I am not able to scroll to the "Product Details" section The Google chrome console is ...
2
votes
0answers
212 views

Manage checkout form validation (required fields) with ajax

How can I manage checkout page required fields programmatically. I want to Add or remove required fields with ajax based on customer selected parameter (country, shipping method...)? I have read the ...
2
votes
1answer
552 views

Magento 2: AJAX / PHP files Knockout uses for Checkout

Anyone know what PHP files, or the AJAX scripts, Knockout uses to pull the product data from the database? Basically, I'm trying to work out how Knockout knows how much product X and product Y are. ...
2
votes
1answer
602 views

Update price without refresh the page

I am working on magento2 customization calculation functionality. In this i have width and gather two field is there in text field I have to calculation with product price eg. pricewidthgather like ...
2
votes
0answers
781 views

Magento SOAP API: How to get SOAP response using JavaScript

I'm able to get SOAP response using Magento SOAP API by using PHP code. Now I want it using JavaScript/AJAX request. How can I accomplish this? What steps should I follow prepare my Magento to allow ...
2
votes
2answers
7k views

submit Form in Ajax

How to submit Form in Ajax in below it reload the page and display nextpage Controller public function ajaxcheckoutAction() { $customer = Mage::getModel('customer/customer'); ...
2
votes
3answers
2k views

Disable Ajax Add to Cart on product page

In our web-shop, we use an AJAX add to cart, so the page doesn't have to reload. But when the order is bigger than the stock, the ajax keeps loading and doesn't show a message the order isn't ...
2
votes
0answers
830 views

Retrieve updated mini cart (cart_sidebar) block - not cached version

I'm using Magento EE 1.13.2 and use jQuery to add products to the cart: var url = "/checkout/cart/add?product=" + productId + "&qty=" + qty + "&form_key=" + formKey; $j.get(url, "", function(...
1
vote
1answer
401 views

How to refresh shipping and billing address after checkout page load just like shipping Rates refresh using Knockout Js magento 2

Hi guys, i want to refresh shipping and billing address after checkout page load using Knockout Js magento 2. If you guys have any idea please guide me. Please check the code i tried below ...
1
vote
0answers
131 views

Magento 2 How to dynamically change custom attributes when click on the color attributes in the configurable product?

I need dynamically change custom attribute on the configurable page when I click to the swatch color attribute. On this purpose I programmatically created custom attributes with options on the admin ...
1
vote
0answers
402 views

Load a ui component with ajax within admin tab

Using the below method to attempt to load a uicomponent over ajax into a tab within custom admin page shows a loading spinner which never completely loads. XML for controller added buttons to the ...
1
vote
0answers
36 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?
1
vote
1answer
206 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
43 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\...
1
vote
0answers
57 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....