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
1answer
103 views

after magento upgrade 1.7.0.2 to 1.9.3.9 add to cart after blank screen open

URL like generate https://domain.com/stage/checkout/cart/add/uenc/ how to solve it this issue Thank you in advance!
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 ...
0
votes
1answer
576 views

Working on ajax wishlist- click again to remove product from wishlist

i am working on magento 1.9.2.4 wishlist, my code successfully adding product to wishlist- what i do for adding product to wishlist is - function ajaxWishlist(url,id){ var messageBox = new ...
0
votes
0answers
7 views

Send data from input checked to controller using ajax in magento 1.x

I want to use ajax to send data from the table to the controller SaveController. The PICK-UP ADDRESS is the required field. How to check when the PICK-UP ADDRESS has data, it will send that line ...
5
votes
5answers
4k views

Magento 2 Load More Product Script

I am using this script for Load More in Magento 2 But it's not working <script src ="https://infiniteajaxscroll.com/vendor/jquery-ias/dist/jquery-ias.min.js"></script> <link src = "...
0
votes
1answer
595 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 ...
14
votes
2answers
735 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
21 views

Dependent dropdowns in Magento 2 Frontend

How can I create a pair of dropdowns such that when one is selected, the options for the other one are updated? PHTML <?php $stateList = $block->getStates(); ?> <div> &...
0
votes
0answers
44 views

Get Data from Controller

I'm trying to create some type of search method for customers where they select the product's brand they want to search and then, if they want, they can also select the category they want (if there ...
1
vote
1answer
578 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 ...
1
vote
2answers
638 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 $('#...
0
votes
1answer
609 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 ...
1
vote
5answers
8k views

How to send a form key with post data using ajax to a controller in magento?

Suppose I have an ajax function like this in a separate js file jQuery.ajax({ url: "/package/module/index/index", type: "POST", data: {name: user_name, dob: date_of_birth},//here i want ...
0
votes
1answer
611 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
312 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
2answers
36 views

Magento 2 : Exception #0 (InvalidArgumentException): Invalid return type

Exception Exception #0 (InvalidArgumentException): Invalid return type #0 /var/www/html/magento/folder/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch() ...
0
votes
0answers
14 views

Ajax call on product view page and that ajax calls on page load in magenro 2

I have different ajax call on product view page and that ajax calls on page load. when I try to do add to cart it waits for that ajax calls to be completed first before process the add to cart. so ...
2
votes
1answer
45 views

Get current Logged user Wishlist products id in Ajax Call Magento 2.3

I Want currently logged user all wishlist products id's json array via ajax call ?
3
votes
1answer
785 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
623 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'])) { ...
0
votes
1answer
624 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 ...
0
votes
1answer
29 views

Magento 2 How to send data to Controller with Ajax from a template?

I'm trying to send some data to my Controller from a template.html using Ajax, so my checkout page does not refresh when I send a custom form, but I don't get anything, the information is an extra ...
6
votes
2answers
873 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 ...
0
votes
0answers
21 views

Magento 2: Validating input in the admin before submit

Is there a way in which I can add an ajax call to an admin field so I can validate the data against an external system? For example, if an admin enters an SKU I want to validate against that the ...
0
votes
1answer
771 views

The following exception is caused by a lack of memory and not having swap configured in magento 2

When trying to install the sample data via this command php bin/magento sampledata:deploy got an error The following exception is caused by a lack of memory and not having swap configured. Can ...
10
votes
5answers
17k views

How to enable AJAX for the the 'Add to Cart' button of product widgets in Magento 2?

In Magento 2 the normal Add to Cart button has a very nice AJAX-based logic to add products to the cart. However, when we use a Catalog Products List widget for example in CMS pages the button in this ...
1
vote
1answer
66 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 ...
-2
votes
1answer
3k views

Checkbox multiple values to controller using ajax.request

I have multiple checkbox along with message which I am trying to pass it via ajax.request parameters. I am able to get the message properly in my controller but unable to find the proper solution for ...
2
votes
0answers
28 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 ...
2
votes
0answers
19 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 ...
0
votes
0answers
17 views

Firefox android on use desktop loading mobile theme instead of desktop on ajax request

Basically, I have 2 theme desktop and mobile using Magento ver 1.9.1.0. The problem currently is when the user using firefox on android and use request desktop sites, website turn into the desktop ...
1
vote
2answers
680 views

Magento 2 how to do minicart ajax update

Is there any way to update the mini cart with ajax without update button. I am using Magento 2.1.7 how to do mini cart ajax update when qty increment(+) and decrement(-) inside the mini cart, as qty ...
2
votes
0answers
110 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 ...
0
votes
1answer
15 views

Form which i getting from ajax not working in admin panel Magento 2

I have a form in the content of the ajax response, but when I submit the form, the action does'nt work (redirected to dashboard), form action same page, but when I use this form without Ajax, then it ...
1
vote
1answer
684 views

Multiple Jquery Version for extension reason

I get some issue my custom theme and it's get from one of extension jquery version. How can I fix this issue ? extension .xml file; <layout> <default> <reference name="head"> ...
0
votes
1answer
56 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 ...
0
votes
0answers
17 views

Magento 2 Custom Module - Product Selector

I wonder if you can help me out. I've just created a customer Ajax module for a product selector. It's been working fine locally, I've just pushed it LIVE and unfortunatley it's now stopped working. ...
9
votes
1answer
1k views

Magento 2 Error in browser console Expected to start loader but did not find one in the dom

I have developed site in Magento 2.2.0 and created custom product listing page. I have used add to cart functionality using ajax but in console giving error:- "VM1386:5 Expected to start loader ...
1
vote
0answers
28 views

magento-2 ajax redirect response Status Code: 302 Found

below is shopping-cart.js file to increment/and decrement of product quantity with update subtotal, is working fine but getting Status Code: 302 Found, how can I solve it? define([ 'jquery',...
10
votes
1answer
28k views

How to make a simple ajax call in Magento 2.1.0

I have added a simple button in one of my phtml file. <input type='button' name='emq_zip_btn' class='emq_zip_btn' value='Go'> I have added one custom js file ("emq.js") from a custom module (...
2
votes
1answer
29 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-&...
0
votes
1answer
764 views

Why after successful ajax call , it does not return to success function

Ajax call var wishlistForm = new VarienForm('product_addtocart_form'); wishlistForm.submitAjaxWishlist = function(button, url,id){ if(this.validator) { var nv = Validation.methods; ...
0
votes
1answer
25 views

Magento 2 - First Module - AJAX

I'm creating my first module which has been going well, I've managed to create the controller, block and route and can access the page. I'm now trying to perform an ajax query and return some product ...
1
vote
3answers
281 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\...
2
votes
2answers
39 views

How to get Current Module and Full Action Name in ajax controller

I need Full Action Name in Ajax Controller Magento 2. protected $request; public function __construct( ... \Magento\Framework\App\Request\Http $request ) { $this->request = $request; }...
0
votes
0answers
18 views

How to get admin base Url or ajax request to any controller in magento2?

I have not any phtml file to set base url. How can i call ajax form admin side in customjs magento2 form.xml <field name="type"> <argument name="data" xsi:type="array"> <...
0
votes
1answer
809 views

Magento 2 layout with no html head or body tags for ajax output

I'm attempting to output the wishlist block as an ajax request. I've attempted to do it in the controller using $block = $resultPage->getLayout() ->createBlock('Magento\Wishlist\Block\Customer\...
0
votes
3answers
351 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 ...
3
votes
4answers
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 ...
1
vote
0answers
51 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 ...