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
10 views

How can I pass custom form data and load result page using Ajax?

New to Magento. My goal with this is to have customer pick price range and sort order from a custom form I created, then when form is submitted have Ajax pass the form data AND load the new page with ...
0
votes
1answer
33 views

Emoji is saving as (???????) in the database Magento 2

I added the Emojo library including JS and CSS files. Then it starts to display on the frontend. When I send the Emoji character via ajax. I am getting Emoji in the param request so while saving the ...
0
votes
0answers
21 views

Add pagination in custom module by ajax call

I have developed Custom module in which data retrieving from db perfectly, but i want to show first ten data(10 rows) at first page and at second page display next ten data and so on by Ajax call.
0
votes
1answer
28 views

Adding Dynamic Ui Components on select value change

I have a modal where I put a select ui component. I want than when the value of that select is changed I send an Ajax request to one of my controllers search in database an get a json response wich ...
1
vote
1answer
43 views

Ajax api call doesn't works using onclick returns error 400

So I'm trying to do an API call using Ajax on the Admin page, when I add this API call in onclick attribute, it doesn't work it returns error 400 Bad request, BUT when the API call isn't vinculated at ...
0
votes
0answers
16 views

Magento 2 - Submit form to current page

I'm trying to launch a form with an action pointing to the same page. The form can be found on the details page of the customer's order: www.mysite.com/sales/order/view/order_id/255/ This is my code ...
1
vote
1answer
35 views

Ajax api call returning Bad Request decoding error

I'm trying to do an ajax API call on the admin page, but it returns a Decoding error: \nUnable to unserialize value. Error: Syntax error... $('#button').on('click', function(){ $.ajax({ ...
1
vote
2answers
59 views

Api call using ajax on admin page returns invalid form key

i'm trying to do an api call using ajax on admin page, but it keeps returning "Invalid form key" <script type="text/javascript"> require([ "jquery" ], function (...
0
votes
0answers
9 views

How do I add javascript code to handle callback events after submission of coupon register?

I am using Magento 2.3.5-p2 I am required to trigger a javascript code as below once a user has successfully registered their coupon dataLayer.push({ 'event': 'trackEvent', 'eventDetails.category': '...
0
votes
1answer
17 views

Magento 2 - Direct download external file

In Magento 2, I try to force download a pdf file from an external link (I don't have the source file). All I succeed is opening the file in the new browser tab but the direct download doesn't work. Do ...
0
votes
0answers
8 views

Menu tree via JSON and AJAX

I want to populate TOP Menu later via AJAX Is there some code available that can get this done. Or a code that will generate the needed JSON and then we will take this JSON as a response and ...
0
votes
0answers
30 views

The requested URL was rejected while trying to save the address book using special characters

Steps to Reproduce: Go to the storefront Log in as a customer Go to My Account Now go to Address Book and click on add new address button Fill the address form ( add special characters in mandatory ...
0
votes
1answer
12 views

How to show a popup when the checkbox is ticked in Magento using ajax

Just needed to add a popup modal when the checkbox is ticked and post the values to the controller.
0
votes
1answer
16 views

Magento 2.4.3 - Reload totals cart after ajax change quantity - shipping costs error

I use this code to reload cart with ajax after quantity changing - $.ajax({ url: form.attr('action'), data: form.serialize(), showLoader: true, success: ...
0
votes
1answer
74 views

How to set data into session with ajax magento 2

How to set data into the session with ajax Magento 2, I want to store price into the session with ajax for when the site is refreshed price gets from the session, not from the database.
0
votes
1answer
30 views

How to add product price to session with AJAX Magento 2

How to add the product price to session with AJAX Magento 2. Please give me an example of the custom module of this solution.
0
votes
1answer
11 views

Use AJAX and get the values of text from the Admin Panel

I want to get the values from store->configuration. And print that value in the PDP page using AJAX. The value should be refresh all the time using AJAX.
0
votes
0answers
153 views

The Content-Security-Policy directive 'frame-ancestors' does not support the source expression ''unsafe-inline''

i am using magento 2.4.x and i want to send data from ajax to controller but i cant do that , the compiler doesn't enter to the controller class , is this because i have this error on my console on ...
0
votes
1answer
24 views

Magento 2 : What is Purpose of Custom Varnish Synthetic Rule For Customer Ajax Login?

I have a situation where customer ajax login is not working even though the customer submits valid credentials. Instead, the page reloads and the customer is not logged in. To clarify, it DOES work ...
0
votes
2answers
19 views

How to run ajax in certain time interval in Magento2

I have added ajax to show a text which is fetched from my scope config(The value is given in the store->configuration). In my controller I am getting the value using scope config and used echo in ...
0
votes
2answers
59 views

can't send data from ajax to controller

in my case I have a controller and an Ajax data sending, but when I check the code the AJAX doesn't send anything and Magento doesn't enter to my controller, is it a problem of routing or what, this ...
0
votes
0answers
114 views

Download a csv file by js in magento 2

I would like to know how can I download a CSV file after clicking on the export button through ajax call. Here is my code: Controller Code public function execute() { try { $...
0
votes
0answers
22 views

Jquery dlmenu with Ajax for multilevel click not working properly

I have a custom menu which has been created with dlmenu and ajax. For first level, it has been come the first level menu ul li through Ajax fine and after that, dlmenu is working fine and has been ...
0
votes
1answer
23 views

Change minisearch bar input width on hover

I am trying to change the search bar input width when it expands on hover. <div class="search-wrapper"> <div class="search-content block block-search" id="search-...
0
votes
1answer
17 views

How to force reviews to appear on page load? trigger processReviews

I'm trying to make customer reviews appear on the PDP page without clicking on the reviews button. On reviews tab click, ajax request is being sent to the server and I want to send this request on ...
0
votes
0answers
24 views

How to load opions in admin panel select ui component by ajax?

I need to make form in admin panel with ui components. In this for I need to choose customer/customers in, so I chose formElement="select". I created ui xml file, options provider and js ...
0
votes
1answer
204 views

Remove loader from product view page

Magento 2 adding page loading in product view page like this below in body tag <body data-container="body" data-mage-init="{&quot;loaderAjax&quot;: {}, &quot;loader&...
1
vote
0answers
85 views

Magento 2 POST Request Return 302 Redirect [closed]

I have Image Manager from Ves Base Widget, the issue is when the user tried to upload the image from his computer to the image manager, so that means the request called from Javascript and returned ...
0
votes
0answers
23 views

Customer Create using Ajax in magenot 2.4

I Want to create new customer using ajax in Magento 2.4. If Customer is register success show popup and show success message. Please help me. THANKS.
0
votes
1answer
18 views

Make action available only for admin

I added a button to admin order view which sends request to an url of an action controller (using ajax), and now I need to somehow make it available only for admin. What is the best solution for this ...
0
votes
1answer
97 views

Login caching and sessions

So were using this third party catalog thing which I don't like much at all. I won't get into all the details of my disliking but for starters it runs in an iframe. Now if a customer is browsing ...
0
votes
1answer
149 views

Ajax is not working going to 404 in Magento 2.4.2 Admin

I am creating module for frontend and backend and want to run ajax with in the modules. My ajax is perfectly working on frontend but it doesn't work on admin side. My Ajax URL is http://127.0.0.1/mag/...
0
votes
1answer
96 views

Magento 2 How to Render Child blocks in controller

I want to remove the 'Proceed to Checkout' button when the qty reaches a specified limit. For that I add a condition check in this page module-checkout\view\frontend\templates\onepage\link.phtml On ...
0
votes
0answers
50 views

My Account reorder link onclick Ajax call controller in magento 2.4

My Account reorder link onclick Ajax call controller in magento 2.3 app/code/Vendorname/Modulename/view/frontend/templates/order/history.phtml <?php if ($this->helper(\Magento\Sales\Helper\...
0
votes
1answer
21 views

Call to checkout URL redirecting to homepage

When adding a redirect to the checkout page in an Ajax done callback function, it seems to just go straight to the homepage instead: }).done(function (data) { if (data.error) { console.log(...
0
votes
1answer
135 views

Magento2 Ajax change store currency and refresh total on Checkout page when change address

I want to change the current store currency by ajax and refresh the total when changing the address on the checkout page. I have successfully changed store currency by below code: $this->...
0
votes
2answers
306 views

Magento 2.4 - How to enable ajax for add-to-cart button and wishlist button of product widgets on homepage?

I have added products on the homepage using the widget, how to enable ajax for add-to-cart button and wishlist button of product widgets.
0
votes
0answers
35 views

Minicart qty update Ajax first click not working

I am using this module https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement for update mini cart qty by ajax. If i click + button first time its not update qty but in console response ...
0
votes
1answer
97 views

Magento 2: How to create popup alert in magento 2

I added a button in block which hits custom controller (I am not using any template) This is controller code: <?php namespace Vtn\UnexportedOrder\Controller\Adminhtml\Order; use Magento\Framework\...
1
vote
2answers
119 views

How to add loader to ajax

How to apply loader script to my code, Loader : https://meetanshi.com/blog/magento-2-show-loader-till-ajax-call-not-completed/ My code: define([ 'jquery', 'Magento_Customer/js/model/...
1
vote
1answer
233 views

Minicart qty increment and decrement error -

I am using the following module for minicart qty increment and decrement, https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement, error : Custom Module: Path : app\code\Zero\MinicartQty\...
0
votes
2answers
28 views

JS file is not working

JS for my main page is working..for example, I am using main_file.js for my default loaded page. Which is actually working properly. but I have a search option on my default page which leads to some ...
0
votes
0answers
196 views

Magento 2 infinite scroll on custom page instead of pagination

I am using an extension for deals page. The page has pagination and pagination is called with this code $block->getToolbarHtml() . How can I change this to infinite ajax scroll? Also I only want to ...
0
votes
1answer
60 views

How to load Data From Database via Ajax Call with Resource Model on Click?

Here is my Ajax Call. I call it inside click() function with jQuery. var customurl = gpImageTagLoadUrl + '?isAjax=true'; $.ajax({ url: ...
0
votes
0answers
42 views

pagination using jquery

I have a search bar on my page when I search for something it returns the result perfectly with correct pagination. As shown below but when I clicked on page 2, it returns the data correctly but ...
0
votes
0answers
23 views

Magento2: How to get clicked page number on pagination

My pagination is working fine. But in ajax I only want to get page number which is clicked. For example I have products on 10 pages. When I click on page 2 it alert only 2, when click page 3 it alert ...
1
vote
1answer
174 views

How to add product to Wishlist without redirecting and without page refresh using ajax on Listing page

My controller: app\code\Vendor\Mymodule\Controller\Index\Wishlist.php <?php namespace Vendor\Mymodule\Controller\Index; class Wishlist extends \Magento\Framework\App\Action\Action { public ...
0
votes
0answers
28 views

check all check boxes with just one click

I have one check box on the top of the page. scenario: I want to check all checkboxes on each line by just clicking that top check box and uncheck all the checkboxes on each line by unchecking that ...
0
votes
0answers
118 views

Replace <div> of page with <div> comes from $.ajax response

Problem is written inside the success section. $.ajax({ url : 'path to file', dataType : 'json', type : 'POST', data: data, success : function(res) { // here I want ...
0
votes
0answers
39 views

Refresh checkout cart after adding cross selling items

We have a Magento 2.3.5 with a simple custom theme. In the normal checkout card (not mini cart!) there are some cross selling items beneath. If a customer presses the .to-cart button on such a cross ...

1
2 3 4 5
16