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.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

jQuery (server side) search and sort using Ajax

I tried to create search and sort from live URL using Ajax , i used do search function and i managed to retrieve the data from the URL . I am showing Ajax response in select options as below code. I ...
0
votes
1answer
16 views

Shipping Estimator from ShipperHQ fails on page load if I remove item from cart or leave and come back to cart

My shopping cart has a shipping estimator from ShipperHQ. If the value changes in the zip code field it calculates the shipping cost. If you remove an item from the cart, update the quantity, leave ...
0
votes
1answer
15 views

Magento 2 Translation on Ajax Backend Not Working

I am making ajax request , and I call __('string to translate') function on backend. The problem is that translate is not working at all. My ajax controller is implementing HttpPostActionInterface ...
0
votes
0answers
16 views

Magento 2 - Passing variable to controller is not working

I want to pass a selected value to a controller. After researching, it seems that I can use Ajax call to pass the value. I don't know why this is not working, but it seems the url that I use to call ...
0
votes
0answers
13 views

Magento 2 - Admin Create Order. sales/order_create/loadBlock cant retrieve layout with <script type=“text/x-magento-init”>

When Creating an order via the admin. the forms are being loaded by http://localhost/project/Admin/sales/order_create/loadBlock/block/shipping_method,totals,billing_method?isAjax=true this request ...
0
votes
0answers
14 views

Magento 2.4: How to display the filename after uploading the file via ajax?

I want to show the filename instead of uniqid(). I have the below code in my controller, how can I display the actual file name after uploading the file <?php namespace Vendor\Module\Controller\...
0
votes
0answers
15 views

How to add a ajax option to load address in Admin panel customer information address tab?

Hi guys we want to add a pagination/load more feature in backend customer edit address section. Please guide us on how we can do this.
0
votes
0answers
19 views

Change the position of the Newsletter success message in magento 2.3.3

By default newsletter success message is shown at the top of the page https://prnt.sc/vud4fh. How can i show this message right below the Email text box using ajax https://prnt.sc/vud3ln Any idea?
0
votes
1answer
39 views

Auto delete item from minicart in magento 2?

I have 2 items in cart suppose A & B. When customer delete item A from minicart then auto delete item B. How the ajax will call 2 times, I have done this in controller's execute function (delete ...
0
votes
1answer
18 views

Ajax tabs for configurable product with description of child products

I need to create custom tab in configurable product that will check is there a description in child product that is selected now and load description of child product. So for example in configurable ...
0
votes
0answers
24 views

Magento 2 Ajax form key invalid request

I'm trying to send a form from a modal and also an image from that form. the form_data works fine with only serialize(), but I need to attach the image to data, so I did this: click: function (data)...
0
votes
0answers
19 views

How to add text to URL so pages reflect only in stock options when in Magento 2

Currently, on my site when I access product pages, the product counts reflect both in and out of stock options. I would like when those product pages are loaded, the url changes to add '?stock=1' to ...
0
votes
1answer
35 views

Magento 2: How to send data using Ajax

Im trying to create an Ajax call in frontend but I get redirect to Homepage when I get to the controller. Can anyone explain why? Many thanks. Here my script in phtml <script type="text/...
0
votes
2answers
37 views

After making ajax query controller redirects back to product page

I’m making an ajax query from a product page (code below). If I run it directly in browser, it works but if I run it inside a code (javascript) it redirects me back to the product page with a status ...
0
votes
1answer
93 views

Magento 2 Knockout bind on ajax response

I am going crazy with knockout on Magento 2, I am new to knockout and I cannot understand what I am doing wrong. I know there are some related questions posted there but each one is different from ...
0
votes
0answers
19 views

Disable ajax completely in admin order grid - Magento 2.4.1

Is there a possibility to disable ajax on the admin order grid page? This to improve the loading speed. The page itself loads quote fast (within 1 second), but to complete the ajax that takes for 200 ...
0
votes
0answers
11 views

how to refresh admin side edit page block after inserting image of custom module using AJAX in magento1.9

I have create one custom module to insert image from admin side in custom database same as catalog product in magento1.9 below is my controller function for insert image in custom database. this ...
0
votes
0answers
33 views

How to reload block using ajax in magento 1.9

Below is my controllers/adminhtml/vendorproductcontroller.php to save image. public function imagesaveAction(){ $data = $this->getRequest()->getPost(); $id = $data['...
0
votes
0answers
31 views

Add ajax qty plus minus buttons in shop page

Hello guys i want to add qty plus and minus in catalog view so when my clients press plus automatically add the item to cart and if the press minus remove the item specific qty from cart. and if they ...
0
votes
0answers
20 views

How to implement Ajax File Upload in Magento 2?

I have a custom form and there I'm using the default file attachment input type but I want the form uploading as a ajax. I have followed many tutorials but can't find the appropriate solution. Can ...
0
votes
1answer
40 views

Magento 2 - Update collection data through ajax

I have a collection inside my Block file Vendor\MyModule\Block\PostsCollectionList.php protected function postCollection() { return $this->postCollectionFactory->create() ->...
0
votes
0answers
41 views

Calling PHP block or Controller from AJAX from just a .JS file in Magento2

In other magento2 modules i have used AJAX to call a block from a PHTML file but for this specific task i am needing to make an ajax call to a controller file from a .js file but i am getting 404 on ...
0
votes
0answers
15 views

Button in system.xml not working properly

I created a button that shows in a tab, but it does nothing, here's what I've done Custom/ExportSubs/etc/adminhtml/system.xml <?xml version="1.0"?> <config xmlns:xsi="http://...
0
votes
0answers
17 views

Ajax Add to cart in wishlist page magento 2.4

I'm looking for a way to add ajax functionality to the wishlist page. So when I add a product to the cart in my wishlist page it utilizes ajax. How would I approach this? Hope for an answer. Thanks in ...
0
votes
1answer
23 views

CustomerData Messages Section is not showing up

What I am trying to do: Normally you have to click "Update Shopping Cart" button to update cart when you change the quantity. With this following code, you do not need to reload cart but it ...
0
votes
2answers
681 views

Magento 2 - How to display messages on ajax success change

What I am trying to do: When I update the cart qty so that the qty is higher than the quantity available, I want my code to be able to show an alert ‘The requested qty is not available’ pop up or ...
0
votes
1answer
30 views

Magento2 call to specific function in controller

I have a controller class called Index that is called in a javascript AJAX request, but rather than have the code in the constructor i would like to call specific functions in the Index.php, so i dont ...
0
votes
3answers
71 views

Magento 2 - How to make ajax show messages

I want to display messages on the cart page. I have made a custom module so that the shopping cart will automatically reload when the qty changes using AJAX. Here is my js code: define([ 'jquery', '...
0
votes
0answers
17 views

Invalid template file error on enabling Ajax Cart module

I have installed Magento 2.3.5 on my hosting and uploaded a a theme Ethan theme by magesolution. I am getting the following error on home page on enabling MGS AjaxCart module 1 exception(s): Exception ...
0
votes
0answers
12 views

Get the 'password' Value from AJAX Login Magento2 in the event customer_login

I need to login to another website with the same credentials when the customer_login event fired but with this code public function execute(\Magento\Framework\Event\Observer $observer) { $...
0
votes
0answers
17 views

Recalculate total after change shipping methods in magento 2 ajax

I need to recalculate total of quote, after change shipping method via Ajax Shipping Method Change: i try to change shipping method based on customer selection, find the Ajax code. var customurl = url....
0
votes
2answers
53 views

Disable Ajax Add to Cart on the Product page in Magento 2

how to disable Ajax ‘Add to Cart’ button on the Magento 2 product page <script type="text/x-magento-init"> { "#product_addtocart_form": { "...
0
votes
0answers
17 views

Enable Ajax Cart in Wishlist page

I'm writting ajax cart extension but it just worked with home page and compare page. How can i open ajax cart popup in wishlist page? Here are my code in controller: use Magento\Framework\App\Action\...
0
votes
1answer
185 views

How to insert/update data in custom table using Magento 2 using Ajax but 404 error occur on ajax hit?

I have created a custom module for admin area in which i have show some data in phtml file. I have created a custom table in database using installschema.php. Now i want to save that data in database ...
0
votes
0answers
56 views

Ajax on admin side goes to 404 ( Not Found ) in Magento 2?

I have created a button and want to save some data using Ajax but it goes to 404 not found. My URL is http://127.0.0.1/magento/AdminSample/datasave/index/?isAjax=true My controller file path is ( app/...
0
votes
2answers
81 views

How to show loader on custom checkout page in Magento 2?

I have created some steps in magento 2 on saving the data an ajax is fired. I want to show loader between start and complete process how to i achieve that. My JS file for saving the data is : define( [...
0
votes
1answer
118 views

How to update qty minicart by ajax without clicking “Update” button

I'm trying to make shopping cart get updated automatically when a customer/user changes the qty of an item in the minicart without having to click the "update" button. I was thinking of this ...
0
votes
1answer
79 views

Products stuck in quick cart

When I add multiple items to a cart, they get stuck in the quick cart. They even pass from computer to computer some how and I am unable to remove them. This is one of the pages affected https://...
0
votes
0answers
28 views

Magento 2: Refresh a widget at regular interval

I have developed an extension to provide a widget to list featured random products on CMS pages. The requirement is to refresh this list at regular interval without caching. Is there any option to ...
0
votes
2answers
148 views

How to reload shopping cart items?

I added a module to automatically update shopping cart by Ajax which works fine. Basically, when I change the item qty in the shopping cart, it will automatically update the shopping cart subtotal and ...
0
votes
0answers
15 views

Magento 2 Add custom AJAX script in HTML file

I want to add this code inside my html file but it's not working, tried it in phtml file and it works. Can someone tell me how can make it work in html <script> require([ 'jquery', '...
0
votes
1answer
123 views

How to redirect to controller using jquery ajax in magento 2.3.5

I want to pass dynamic text-box value to controller using ajax, so if anyone have idea about it then please share with me. Thanks In Advance
1
vote
1answer
72 views

Ajax onepage checkout magento 2

I add a checkbox input to the checkout page in magento 2. The way I add it is really simple, just add an item in checkout_index_index.xml. When clicking on the checkbox, I want to call a PHP function. ...
3
votes
3answers
150 views

Magento 2 Knockout variable from response in controller via ajax

Assume I've got something like this <div class="greet welcome" data-bind="scope: 'customer'"> <!-- ko if: blockIsLoggedIn == '1' --> <span data-bind="...
0
votes
0answers
25 views

UI component select box on change event call ajax

How can I add an event when changes select box dropdown value and I will trigger Ajax when change value in the dropdown, Below are my code. <fieldset name="sample_fieldset"> <...
0
votes
0answers
6 views

Unread jQuery script in custom phtml file included with ajax in Magento 2

I have included in the product page a custom external phtml file from a module which is called with ajax on click. The html and php code is read correctly, only the jQuery code is not read and is not ...
1
vote
3answers
246 views

Magento 2: Insert Form data Using AJAX Request

How to insert form data Using AJAX request. This my phtml file <html> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/...
1
vote
1answer
205 views

Magento 2.3 On mass action how can I refresh listing grid using ajax (without page refresh)

As I see by default once magento2 mass action applied, default logic is to refresh the page. I would like to have grid refreshing without actual page reload but rather from js once massaction ...
1
vote
0answers
39 views

Magento 2 - Ajax call on controller working in desktop but not on mobile

Here is the ajax call in which data is not passed in controller This is found only in mobile device and working fine in desktop. Thanks in advance. $.ajax({ type: "POST", ...
4
votes
1answer
839 views

Magento 2: Custom added ajax pagination not working

I have added an ajax pagination in a custom module collection. I have a total of 50 items in the collection and the limit per page is 5; that should show total page of 10. Instead, it is showing only ...

1
2 3 4 5
16