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.

Filter by
Sorted by
Tagged with
1
vote
1answer
22 views

Magento 2 Adding custom parameter to the ajax url, from the admin grid row issue

I am on the edit page with the following url: https://local.magento/admin/hello_test/shipping/edit/shippingmethod_id/1/key/df70da11cddd2ee1c41aa67a8cbccf6d9403207740547719560dec30a3fd9ceb/ , where I ...
1
vote
1answer
639 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'])) { ...
6
votes
2answers
985 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
7 views

Uncaught Syntax Error: Unexpected number in JSON at position 2. Why in Magento2?

["092019,082019,072019,062019,052019,042019,032019,022019,012019"] Uncaught SyntaxError: Unexpected number in JSON at position 2 at JSON.parse (<anonymous>) at Object.success (admin.php:667)...
0
votes
0answers
19 views

How To Customize Newsletter PHTML? [on hold]

I used an extension but I don't know how to customize its phtml, extension send's ajax based newsletter subscription request... /app/code/Vendor/Module/view/frontend/layout/default.xml <?xml ...
0
votes
1answer
852 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 ...
0
votes
1answer
37 views

The file was not uploaded in Magento 2

I'm trying to save the attachment file in my custom module using $.ajax({}) request. But it's not working for me. For these, I tried the below code. In cart page having below code. <dl class="...
2
votes
3answers
2k views

Ajax Newsletter magento 2

I am using magento 2.1.5, and i am trying to make ajax newslatter. di.xml <type name="Magento\Newsletter\Controller\Subscriber\NewAction"> <plugin name="...
0
votes
1answer
53 views

Magento 2 - Call Ajax controller on click of place order?

I've set up the JS, and controller and checkout.html I need to call the controller with ajax to getPrice() method. My controller name is GetAjax.php and here is the controller code. <?php ...
0
votes
0answers
9 views

Magento 2 Resize and draggable modal popup

I want to open a popup with an external site using iframe when a custom link is clicked in addtocart.phtml. I am facing three issues 1> Iframe gets loaded as soon as external site url is dynamically ...
0
votes
0answers
18 views

How i can prevent Default Action in Magento 2

In Magento 2 I want to Override Default Action on Add to WishList I have tried e.preventDefaults() but i think it only override Href Actions Here is My Code require(['jquery', 'mage/url', '...
10
votes
3answers
12k views

Magento2 - How to stop a product from getting added to cart programmatically?

What I want to do is if my custom attribute is set in quote then i do not want any product to be added in cart. My custom attribute is being set correctly. To stop product from getting added to cart,...
0
votes
0answers
19 views

Clear cache vs Ajax

I need to create Magento 2 extension that will be adding some content (information) to products on category and product page, that information will update depending on the configuration of extension (...
0
votes
0answers
12 views

magento1.9, adminhtml, request ajax return 404

i am calling to ajax, when the user entered the data in input, but it constantly returns 404 status my code on my phtml file <script> $j(document).ready(function(){ var typingTimer;...
1
vote
1answer
702 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
824 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; ...
1
vote
2answers
1k views

How to reset a form after form submission using ajax or how to empty the input fields in magento 2

How to reset a form after submission (which is submitted using ajax)?
0
votes
0answers
19 views

Magento1.9 How to update quantity on cart page ajax based

I am using Mangeto 1.9 and in cart page when I update qty same reflects on mini cart using ajax based work and if I update cart item button click than work same ajax based.
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 ...
1
vote
1answer
970 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: "...
0
votes
3answers
38 views

Magento 2 Admin url using Ajax

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $configLoader = $objectManager->get('\Magento\Backend\Model\UrlInterface'); $url = $configLoader->getUrl('testing/queue/...
0
votes
1answer
896 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\...
2
votes
1answer
603 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 ...
1
vote
2answers
35 views

Invalid form key while making an ajax request in Admin panel in Magento 2.3

I have Magento 2.3 installed, and I'm trying to create a small form in sales_order_view.xml and saving the form using ajax. Following is the code XYZ/Sales/view/adminhtml/layout/sales_order_view....
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 ...
0
votes
0answers
13 views

Uncaught ReferenceError: ConfigurableMediaImages is not defined error Magento 1.9.4.2

I have been looking to incorporate infinite scrolling into my site. So, when I came across the InfiniteScroll Magento Plugin by Strategery-Inc I was excited to give it a go. However, I get the error: ...
0
votes
1answer
57 views

Magento 2 - 401 controller in magento admin

I currently have a module that adds a field to the admin cms page. I've written a controller and on input change I want to ajax this controller. This is the simple controller I added to start testing:...
0
votes
1answer
1k views

Magento 2 - How to add ajax tab on admin user edit page in admin section

I want to add a tab on User edit page which can be accessed from grid in section System -> All users. I have managed to add tab but it is not loading through AJAX. When I click on tab it redirects to ...
0
votes
1answer
689 views

Ajax Call php file ,located in checkout template directory, from success.phtml

I'm using Magento 1.9.2. I want to send Custom Coupon code to customer when they click on Claim button on Success page. I have the php code for generation of Coupon Code based on user name (ex- ...
0
votes
1answer
28 views

Error when add product to cart in magento 1

I installed a module ajax add to cart and when click add to cart, it show error Refused to execute script from 'http://.../ajaxcartsuper/ajaxcart/delete/id/...' because its MIME type ('text/html') ...
1
vote
2answers
975 views

How to display success message after ajax form summit

I've been working on this code I found somewhere. I use it to submit the Send to Friend form from a popup. It works but I can't get it to display the success message after it submits the form. Right ...
1
vote
2answers
417 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....
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'); ...
0
votes
1answer
627 views

ajax add to cart on product list

I want a trick to add product to cart whitout reloading page, I'm not looking for a paid extension , just code ajax to make product added to cart on my product list. thank you
1
vote
1answer
45 views

Magento 2 pass data from template phtml to js file

I want to call an ajax function on a button click. All other things are working fine. But I can't read the parameter which is passed to the js. How can I do it? Here is my code. Phtml file <...
0
votes
2answers
21 views

Get Model Data in ajax request

I am making an ajax request in my module to grab some custom CRUD data to populate a select box on the fly. I have a working ajax request and controller Javascript define(["jquery"], function($){ ...
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 ...
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
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
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 1.9 catalog layered filter via ajax

How can we get the filtered data via ajax without using any plugin? I have created a module for ajax filtering. But don't know how to render the data through catalog/product/list.phtml. Does anyone ...
3
votes
1answer
45 views

Magento 2: Ajax without effect

My problem is as follow, my script except ajax in working (no problem with giving value or console.log) but my ajax doesn't give me the result expected (remove hidden class and fill a drop list with ...
0
votes
0answers
44 views

Magento2: Save data of popup form in database using ajax in controller

I set button in form popup in product-detail page in addtocart.phtml in my custom module. But form submit button is not working and data not passed to controller so not saved in the database Here is ...
0
votes
2answers
11k 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
2answers
64 views

Magento 2: Calling module script, controller, template (app/code/vendor/module) from design (app/design/frontend/vendor)

First of all, I am kind of new in Magento then sorry if my question looks stupid. I would like to use a template, controller, block, and the script from my module (app/code) into the header of my ...
0
votes
1answer
17 views

unexpected SyntaxError from Template/Ajax - Magento 2

I am a newby in Magento, so sorry if my question seem stupid. I have an error SyntaxError: JSON.parse: expected double-quoted property name at line 6 column 17 of the JSON data that I don't ...
3
votes
0answers
44 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 ...
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 ...
1
vote
1answer
41 views

Using AJAX for displaying Random Products on Home Page

Can any one give me an example of Displaying Random Products on homepage using AJAX in Magento 2.3
0
votes
0answers
23 views

Magento 2 : How to add value to shipping address from

I am facing issue to add Dynamic value (Via Ajax) in shipping address I was trying to do so with JQuery but validations are failing But my text box has dynamic data assigned to it. please find some ...