Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

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.

0
votes
2answers
56 views

Add multiple items to cart in Magento2

I am implementing add to cart functionality from ajax using product id. This is my code of template file <tr class="border_bottom child-items selected"> <td >...
0
votes
0answers
8 views

Magento 1.9.2. - Update breadcrumb with ajax filter category

I created a filter in my layered navigation that covers all the categories of my site. The effect with ajax seems to work correctly and the contents update just like other normal filters. The problem ...
0
votes
0answers
7 views

Magento 2 user field validation using an API

In a dedicated data table where we stored customer's privilege card number in order to validate them with users that they enter to a field called "privilege card no" On such an occasion I'll have to ...
0
votes
1answer
29 views

Calling M2 REST API from browser for anonymous users

I'm trying to call REST endpoints from the browser. Initially, I'd like to be able to fetch product information. It looks like session-based authorization is what I'm after. I started by grabbing a ...
0
votes
2answers
26 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 ...
0
votes
0answers
20 views

Category page custom category filter magento2

I have loaded custom template before the product list in category list page. this is my block file Vendor/Module/Block/Category.php <?php namespace Vendor\Module\Block; class Category extends \...
0
votes
0answers
33 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....
1
vote
1answer
34 views

Generation does not exist

I have this code for a AJAX call: Controller/Data/Get.php <?php namespace Vendor\Module\Controller\Data; class Get extends \Magento\Framework\App\Action\Action { protected $...
1
vote
0answers
25 views

Forms not working with array fields

Don't know something has gone wrong. Suddenly on my magento (1.9) site forms which have array fields are not working. for example :- <input type="text" name="inputfield['first']" id="...
0
votes
2answers
42 views

Invalid Return Type in Ajax Call

I made an ajax script to (at the moment) simply return some HTML to a select. My function looks like this: $.ajax({ showLoader: true, data: {val: inputVal}, /*dataType: 'json', (un)...
1
vote
1answer
18 views

Get breadcrumb in Controller Action

I need to get the breadcrumb in the controller action because I am using the cache modules(FPC and another system externally). It cached the breadcrumb in the frontend page. With that, I would use ...
0
votes
1answer
18 views

I wish to add custom section in product detail page in magento 2

How to add custom button in product page,while clicking that button it needs to show custom form in a popup ?
0
votes
0answers
15 views

I want to update qty on checkout page using ajax without page load in magento1

When I update my qty page reload I am using this code qty update but when I refresh page /* here is mu code */ jQuery(document).ready(function(){ jQuery('.btn-update').on('click', ...
0
votes
2answers
47 views

Unable to call function in ajax success in magento2

I have found below error: > Uncaught TypeError: Cannot read property 'set' of undefined. Code: <script> require(['jquery','Magento_Customer/js/customer-data','domReady!'], function ($, ...
0
votes
1answer
117 views

Magento 2 Update cart automatically on carty quantity update gives error “Mismatched anonymous define() module”

I have done everything mentioned in this post, however, it gives me an error in console: require.js:166 Uncaught Error: Mismatched anonymous define() module: function ($, getTotalsAction, ...
1
vote
0answers
21 views

How to set success and error message when custompage ajaxcall in magento2?

I want to display success message when my custom form submitted . I am doing ajaxcall here. How to achieve this? I want default page.messages not custom message div.
0
votes
0answers
18 views

Return as json instead of Html from controller renderlayout

How my code look like. In frontend layout xml file my Handle is like. <wordpress_ajax_post> <block type="wordpress/homepage" name="root" output="toHtml" template="wordpress/homepage....
0
votes
1answer
86 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
56 views

Ajax call issue in magento 2.2.6

My ajax call not working . It returns "A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later." my ajax call code ...
1
vote
2answers
52 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 $('#...
1
vote
1answer
103 views

Magento 2.3 admin custom form ajax not working

Custom form ajax submit data not working in magento 2.3 its working with magento 2.1 and 2.2.x versions. Error 401 (Unauthorized) Failed to load resource: the server responded with a status of ...
0
votes
1answer
24 views

Magento 2 ajax is not working

I am trying to save form details using AJAX. Below is my Code. etc/adminhtml/routes.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
1answer
44 views

Change sorter in category select box to <ul> <li>

I want to change sort by select box into <ul> <li> type by using javascript so I can change style css for it. How can i do this?
1
vote
1answer
46 views

Magento 2: AJAX POST to AdminHTML

I have an AJAX POST setup within my template file currently that has 3 values, which I want to POST to my Index.php within my Block. However, my module is an AdminHTML module and this cannot be ...
0
votes
0answers
33 views

Update programmatically config content text/x-magento-init script inside of phtml template

For a requirement I had to override the config of the configurable.js script that is initialised inside configurable.phtml, this one specifically: <script type="text/x-magento-init"> { ...
0
votes
0answers
16 views

Direct add to cart link in product grid for children products of a configurable parent in M1.x using getAddUrl

we sell clothing in sizes. On the product grid (category page) we want to show the available sizes. Requested behavior: A customer can click on the size and it will automagically add the product to ...
1
vote
0answers
18 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 ...
0
votes
0answers
57 views

Magento2 - DataTable.js - Custom Grid with Ajax Pagination and Search filter

Is there any working example which we can use to integrate Ajax search and pagination filter for custom grid and tables on front-end ? Something similar to DataTable.js ?
0
votes
0answers
29 views

How to do AJAX call in js (widget) in magento 2

I wish to add ajax call while submitting the frontend form in magento 2 1)how to add jquery widget 2)How to make ajax call
0
votes
1answer
30 views

Get method in magento2

Why the get method ajax call content like.. /customer/section/load/?sections=messages&update_section_id=true&_=1540902816229 Thank You.
0
votes
0answers
15 views

Magento 2: Lightweight way to access custom model with ajax call

I have some data that needs to be displayed on each page view and can not be cashed. Workflow is like this: Page is loaded Ajax call is made to custom php script that gets information from db The ...
0
votes
0answers
51 views

Magento 2 Ajax add to cart related products

So I've found the location to turn on ajax add to cart in the product page. I've also found where the; $showCart: true Lives to enable the related products to have an add to cart button on them. ...
0
votes
2answers
36 views

AJAX call to controller returns admin dashboard html

Calling a controller with location Vendor\Orderitemstatestatus\Controller\Adminhtml\orderitemstatestatusmapping\OrderStatus.php The controller is called through AJAX from admin custom form as ...
0
votes
2answers
172 views

Change value of text field in admin form based on option selected in dropdown

I have made a custom admin form which has a drop-down. Based on the option selected in the dropdown, I want to change the value of the text field below using AJAX. In the above pic, I want to change ...
-1
votes
0answers
65 views

Set Ajax Response template to be phtml file Magento 2

I want to send HTML in response in Ajax. The HTML I want to be of the phtml file. I have used the below code, but in Ajax, I am getting the response as undefined. $block = $resultPage->getLayout() ...
0
votes
0answers
51 views

Magento2 - How to send mail of form data using AJAX in custom form?

I have created one inquiry form in magento 2. now I want send data to given EmailID using ajax. here is my code <form> <div class="form-group"> <label for="Full Name">Full ...
0
votes
0answers
20 views

Custom button to check for login else redirect to login page and then successful login should redirect back to the button functionality

I am adding a button in product view page clicking to which will show a modal having customer data. Once customer click on that button, my all functionalities is working fine but if guests are ...
1
vote
1answer
229 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 ...
0
votes
1answer
39 views

Magento 2 URL to call custom controller not working

This is the default magento URL: <base URL>/magento2/multishipping/checkout/billing Now i have a custom controller i want to call this. <base URL>/magento2/multishipping/checkout/...
0
votes
0answers
31 views

Magento 2 load cart page as ajax

How I can load cart page as Ajax? I create a controller and try to show cart block like below echo $block=$this->_view->getLayout() ->createBlock('Magento\Checkout\Block\Cart') ...
1
vote
0answers
23 views

Toggle switch to change between Incl. and Exc. TAX with ajax continious loading

I've coded up a quick toggle switch which will change the price display between Including and Excluding tax using "display: none" with jQuery hide and show but i'm having problems with an Ajax ...
0
votes
1answer
91 views

How to add News Letter Subscription checkbox on checkout Success Page in Magento 2?

I am getting email address in the database with this function: protected $subscriberFactory; public function __construct( \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, ....
2
votes
0answers
30 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
35 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 ...
1
vote
1answer
124 views

How to add AJAX for the 'Add to Cart' button in wishlist page and in sidebar wishlist product in produst list page in Magento 2.2.3?

How to add AJAX for the 'Add to Cart' button in wishlist page and in sidebar wishlist product in product list page in Magento 2.2.3? Please help.
1
vote
1answer
83 views

Magento 2, error 'unserialize value' when using Ajax in phtml in admin page

Using Magento 2, Ajax in phtml, Admin. I got an error while trying to request API by ajax from template of sale order page. AJAX <script type="text/javascript"> require(['jquery', 'domReady!'],...
0
votes
0answers
10 views

How to merge name : value pairs in Javascript

We have a form on our Magento site and wants to send the form data to an external application like Superoffice using ajax call. But the Superoffice table contains only 8 fields and the extra fields ...
3
votes
1answer
325 views

Magento 2 how to Load custom collection data using Ajax

I want to display modal collection data using load more Ajax functionality, currently i am display load more data using jquery & CSS. Because for now i have a limited collection data but in ...
0
votes
0answers
126 views

jquery ajax not working in magento2

I am working on a simple custom module, where user can input height and the weight/BMI will be shown as output on form submit. The page where user enters input is Calculation Page while output is ...
0
votes
1answer
107 views

Magento 2: How can I verify native captcha in a form via an ajax call to controller only?

I have an ajax customer registration form with native captcha. I am already returning ajax based response against other field validations. Only thing left is Captcha validation. Please tell me how ...