Magento 2 how to do minicart ajax updateShopping cart ajax quantity display wrong when changing so fast.How to get quote and update total through AJAX Magento 1.9Magento2: Update minicart view using ajaxMagento 2 : Mini-cart quantity update button not working properlyMagento 2 : Minicart always showing loader after product add to cart?Magento2 update minicart using custom ajaxHow to update cart qty using ajax Magento 2Show popup when update qty in mini cart using ajax magentoHow to auto update Subtotal, Total in cart when I update product qty?Add Ajax Quantity Increment and Decrement Button on mini cart in Magento 2
How does a sound wave propagate?
Propulsion Systems
direct sum of representation of product groups
How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?
Is it appropriate to ask a former professor to order a library book for me through ILL?
Professor forcing me to attend a conference, I can't afford even with 50% funding
Why isn't P and P/poly trivially the same?
I am the person who abides by rules but breaks the rules . Who am I
Who has more? Ireland or Iceland?
What does *dead* mean in *What do you mean, dead?*?
How to recover against Snake as a heavyweight character?
Unfamiliar notation in Diabelli's "Duet in D" for piano
Has a sovereign Communist government ever run, and conceded loss, on a fair election?
Why does this boat have a landing pad? (SpaceX's GO Searcher) Any plans for propulsive capsule landings?
What is better: yes / no radio, or simple checkbox?
What would be the most expensive material to an intergalactic society?
Why does a car's steering wheel get lighter with increasing speed
How to install "rounded" brake pads
How would an energy-based "projectile" blow up a spaceship?
Can I negotiate a patent idea for a raise, under French law?
Should I file my taxes? No income, unemployed, but paid 2k in student loan interest
Why aren't there more Gauls like Obelix?
How spaceships determine each other's mass in space?
A running toilet that stops itself
Magento 2 how to do minicart ajax update
Shopping cart ajax quantity display wrong when changing so fast.How to get quote and update total through AJAX Magento 1.9Magento2: Update minicart view using ajaxMagento 2 : Mini-cart quantity update button not working properlyMagento 2 : Minicart always showing loader after product add to cart?Magento2 update minicart using custom ajaxHow to update cart qty using ajax Magento 2Show popup when update qty in mini cart using ajax magentoHow to auto update Subtotal, Total in cart when I update product qty?Add Ajax Quantity Increment and Decrement Button on mini cart in Magento 2
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 increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update
Thanks in advance
magento2 ajax mini-cart qty
add a comment |
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 increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update
Thanks in advance
magento2 ajax mini-cart qty
add a comment |
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 increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update
Thanks in advance
magento2 ajax mini-cart qty
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 increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update
Thanks in advance
magento2 ajax mini-cart qty
magento2 ajax mini-cart qty
edited Oct 20 '18 at 4:48
trilok kumar
1629
1629
asked Oct 8 '18 at 11:20
Chala ChalapathiChala Chalapathi
9911
9911
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There are two Methods of updating the minicart
Method 1: Using sections.xml
Create sections.xml file under app/code/Vendor/Module/etc/frontend
directory
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="module/ajax/index">
<section name="cart"/>
</action>
</config>
Note: Put your ajax call URL in place of 'module/ajax/index'
Method 2: Using customerData dependency in the script tag
<script>
require([
'jquery',
'Magento_Customer/js/customer-data'
], function ($, customerData)
$.ajax(
type: "post",
url: "your_url",
data: data : yourData,
cache: false,
success: function(response)
// reload the minicart
var sections = ['cart'];
customerData.reload(sections, true);
);
);
</script>
Thanks a lot Dinesh for comment , can you please elaborate
– Chala Chalapathi
Oct 8 '18 at 12:47
I have explained it in the answer. Can you please tell me what did you not understand?
– Dinesh Yadav
Oct 9 '18 at 6:16
When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.
– Dinesh Yadav
Oct 9 '18 at 9:15
Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing
– trilok kumar
Oct 18 '18 at 11:34
@trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.
– Dinesh Yadav
Oct 18 '18 at 12:19
|
show 7 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f245544%2fmagento-2-how-to-do-minicart-ajax-update%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are two Methods of updating the minicart
Method 1: Using sections.xml
Create sections.xml file under app/code/Vendor/Module/etc/frontend
directory
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="module/ajax/index">
<section name="cart"/>
</action>
</config>
Note: Put your ajax call URL in place of 'module/ajax/index'
Method 2: Using customerData dependency in the script tag
<script>
require([
'jquery',
'Magento_Customer/js/customer-data'
], function ($, customerData)
$.ajax(
type: "post",
url: "your_url",
data: data : yourData,
cache: false,
success: function(response)
// reload the minicart
var sections = ['cart'];
customerData.reload(sections, true);
);
);
</script>
Thanks a lot Dinesh for comment , can you please elaborate
– Chala Chalapathi
Oct 8 '18 at 12:47
I have explained it in the answer. Can you please tell me what did you not understand?
– Dinesh Yadav
Oct 9 '18 at 6:16
When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.
– Dinesh Yadav
Oct 9 '18 at 9:15
Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing
– trilok kumar
Oct 18 '18 at 11:34
@trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.
– Dinesh Yadav
Oct 18 '18 at 12:19
|
show 7 more comments
There are two Methods of updating the minicart
Method 1: Using sections.xml
Create sections.xml file under app/code/Vendor/Module/etc/frontend
directory
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="module/ajax/index">
<section name="cart"/>
</action>
</config>
Note: Put your ajax call URL in place of 'module/ajax/index'
Method 2: Using customerData dependency in the script tag
<script>
require([
'jquery',
'Magento_Customer/js/customer-data'
], function ($, customerData)
$.ajax(
type: "post",
url: "your_url",
data: data : yourData,
cache: false,
success: function(response)
// reload the minicart
var sections = ['cart'];
customerData.reload(sections, true);
);
);
</script>
Thanks a lot Dinesh for comment , can you please elaborate
– Chala Chalapathi
Oct 8 '18 at 12:47
I have explained it in the answer. Can you please tell me what did you not understand?
– Dinesh Yadav
Oct 9 '18 at 6:16
When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.
– Dinesh Yadav
Oct 9 '18 at 9:15
Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing
– trilok kumar
Oct 18 '18 at 11:34
@trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.
– Dinesh Yadav
Oct 18 '18 at 12:19
|
show 7 more comments
There are two Methods of updating the minicart
Method 1: Using sections.xml
Create sections.xml file under app/code/Vendor/Module/etc/frontend
directory
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="module/ajax/index">
<section name="cart"/>
</action>
</config>
Note: Put your ajax call URL in place of 'module/ajax/index'
Method 2: Using customerData dependency in the script tag
<script>
require([
'jquery',
'Magento_Customer/js/customer-data'
], function ($, customerData)
$.ajax(
type: "post",
url: "your_url",
data: data : yourData,
cache: false,
success: function(response)
// reload the minicart
var sections = ['cart'];
customerData.reload(sections, true);
);
);
</script>
There are two Methods of updating the minicart
Method 1: Using sections.xml
Create sections.xml file under app/code/Vendor/Module/etc/frontend
directory
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="module/ajax/index">
<section name="cart"/>
</action>
</config>
Note: Put your ajax call URL in place of 'module/ajax/index'
Method 2: Using customerData dependency in the script tag
<script>
require([
'jquery',
'Magento_Customer/js/customer-data'
], function ($, customerData)
$.ajax(
type: "post",
url: "your_url",
data: data : yourData,
cache: false,
success: function(response)
// reload the minicart
var sections = ['cart'];
customerData.reload(sections, true);
);
);
</script>
edited 6 mins ago
answered Oct 8 '18 at 12:01
Dinesh YadavDinesh Yadav
4,0501937
4,0501937
Thanks a lot Dinesh for comment , can you please elaborate
– Chala Chalapathi
Oct 8 '18 at 12:47
I have explained it in the answer. Can you please tell me what did you not understand?
– Dinesh Yadav
Oct 9 '18 at 6:16
When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.
– Dinesh Yadav
Oct 9 '18 at 9:15
Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing
– trilok kumar
Oct 18 '18 at 11:34
@trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.
– Dinesh Yadav
Oct 18 '18 at 12:19
|
show 7 more comments
Thanks a lot Dinesh for comment , can you please elaborate
– Chala Chalapathi
Oct 8 '18 at 12:47
I have explained it in the answer. Can you please tell me what did you not understand?
– Dinesh Yadav
Oct 9 '18 at 6:16
When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.
– Dinesh Yadav
Oct 9 '18 at 9:15
Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing
– trilok kumar
Oct 18 '18 at 11:34
@trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.
– Dinesh Yadav
Oct 18 '18 at 12:19
Thanks a lot Dinesh for comment , can you please elaborate
– Chala Chalapathi
Oct 8 '18 at 12:47
Thanks a lot Dinesh for comment , can you please elaborate
– Chala Chalapathi
Oct 8 '18 at 12:47
I have explained it in the answer. Can you please tell me what did you not understand?
– Dinesh Yadav
Oct 9 '18 at 6:16
I have explained it in the answer. Can you please tell me what did you not understand?
– Dinesh Yadav
Oct 9 '18 at 6:16
When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.
– Dinesh Yadav
Oct 9 '18 at 9:15
When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.
– Dinesh Yadav
Oct 9 '18 at 9:15
Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing
– trilok kumar
Oct 18 '18 at 11:34
Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing
– trilok kumar
Oct 18 '18 at 11:34
@trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.
– Dinesh Yadav
Oct 18 '18 at 12:19
@trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.
– Dinesh Yadav
Oct 18 '18 at 12:19
|
show 7 more comments
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f245544%2fmagento-2-how-to-do-minicart-ajax-update%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown