Magento 2: Add quantity 2 when add to cart from product view page Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?display the quantity box in product view pageQuantity in checkout shopping cart doesn't work properly for MagentoDifferent quantity for different size add to cart productAdd to cart button added the same product issueMagento 2: Add multiple products to cart programmaticallyadding and removing product from the cart at the same timeMagento 2 - Quantity in cartAdd to cart only stock availabel quantity Magento ShopMagento 2: Observer add product to cart?Magento 2 how to add products into cart without loading page
Why did the IBM 650 use bi-quinary?
What do you call a plan that's an alternative plan in case your initial plan fails?
Can a non-EU citizen traveling with me come with me through the EU passport line?
What would be the ideal power source for a cybernetic eye?
When to stop saving and start investing?
Single word antonym of "flightless"
How to find all the available tools in macOS terminal?
Why was the term "discrete" used in discrete logarithm?
Why are there no cargo aircraft with "flying wing" design?
When -s is used with third person singular. What's its use in this context?
What are the pros and cons of Aerospike nosecones?
Should gear shift center itself while in neutral?
G-Code for resetting to 100% speed
Gastric acid as a weapon
The logistics of corpse disposal
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
How to recreate this effect in Photoshop?
How to draw this diagram using TikZ package?
How much radiation do nuclear physics experiments expose researchers to nowadays?
How does cp -a work
Are my PIs rude or am I just being too sensitive?
Storing hydrofluoric acid before the invention of plastics
Letter Boxed validator
Models of set theory where not every set can be linearly ordered
Magento 2: Add quantity 2 when add to cart from product view page
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?display the quantity box in product view pageQuantity in checkout shopping cart doesn't work properly for MagentoDifferent quantity for different size add to cart productAdd to cart button added the same product issueMagento 2: Add multiple products to cart programmaticallyadding and removing product from the cart at the same timeMagento 2 - Quantity in cartAdd to cart only stock availabel quantity Magento ShopMagento 2: Observer add product to cart?Magento 2 how to add products into cart without loading page
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Add quantity 2 when adding to cart from product view page.
For only one product because it calls 2-time post request for one product.
After clearing cache and checking and some time that works, but again that problem comes in other product.
magento2 product addtocart
add a comment |
Add quantity 2 when adding to cart from product view page.
For only one product because it calls 2-time post request for one product.
After clearing cache and checking and some time that works, but again that problem comes in other product.
magento2 product addtocart
Have you customize anything or extended any js ?
– Codrain Technolabs Pvt Ltd
Apr 22 '16 at 11:39
have you got this answer @user15917
– Devidas
Oct 27 '18 at 7:23
add a comment |
Add quantity 2 when adding to cart from product view page.
For only one product because it calls 2-time post request for one product.
After clearing cache and checking and some time that works, but again that problem comes in other product.
magento2 product addtocart
Add quantity 2 when adding to cart from product view page.
For only one product because it calls 2-time post request for one product.
After clearing cache and checking and some time that works, but again that problem comes in other product.
magento2 product addtocart
magento2 product addtocart
edited Dec 27 '17 at 13:32
Amrit Pal Singh
802623
802623
asked Apr 22 '16 at 11:34
user15917
Have you customize anything or extended any js ?
– Codrain Technolabs Pvt Ltd
Apr 22 '16 at 11:39
have you got this answer @user15917
– Devidas
Oct 27 '18 at 7:23
add a comment |
Have you customize anything or extended any js ?
– Codrain Technolabs Pvt Ltd
Apr 22 '16 at 11:39
have you got this answer @user15917
– Devidas
Oct 27 '18 at 7:23
Have you customize anything or extended any js ?
– Codrain Technolabs Pvt Ltd
Apr 22 '16 at 11:39
Have you customize anything or extended any js ?
– Codrain Technolabs Pvt Ltd
Apr 22 '16 at 11:39
have you got this answer @user15917
– Devidas
Oct 27 '18 at 7:23
have you got this answer @user15917
– Devidas
Oct 27 '18 at 7:23
add a comment |
3 Answers
3
active
oldest
votes
The MagentoCheckoutControllerCartAdd::execute()
method has support for the qty
request param. Try adding a new hidden input named qty
and value of 2
in the add-to-cart form template file.
Maybe there's a more elegant way of doing this, but I don't know about it yet.
1
I have added this code: <script type="text/x-magento-init"> "#product_addtocart_form": "Magento_Catalog/product/view/validation": "radioCheckboxClosest": ".nested" , "catalogAddToCart": "addToCartButtonTextDefault": "<?php echo __('Add to Cart'); ?>", "addToCartButtonTextWhileAdding": "<?php echo __('Adding...'); ?>", "addToCartButtonTextAdded": "<?php echo __('Added'); ?>" </script> in vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
– user15917
Apr 26 '16 at 11:50
add a comment |
from addtocart.phtml
<input type="number"
name="qty"
id="qty"
maxlength="12"
value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" />
change value to "2"
add a comment |
Hello it happen with me.
Solution for that:addtocart intilize two times on page so find out and remove it
add a comment |
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%2f112156%2fmagento-2-add-quantity-2-when-add-to-cart-from-product-view-page%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The MagentoCheckoutControllerCartAdd::execute()
method has support for the qty
request param. Try adding a new hidden input named qty
and value of 2
in the add-to-cart form template file.
Maybe there's a more elegant way of doing this, but I don't know about it yet.
1
I have added this code: <script type="text/x-magento-init"> "#product_addtocart_form": "Magento_Catalog/product/view/validation": "radioCheckboxClosest": ".nested" , "catalogAddToCart": "addToCartButtonTextDefault": "<?php echo __('Add to Cart'); ?>", "addToCartButtonTextWhileAdding": "<?php echo __('Adding...'); ?>", "addToCartButtonTextAdded": "<?php echo __('Added'); ?>" </script> in vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
– user15917
Apr 26 '16 at 11:50
add a comment |
The MagentoCheckoutControllerCartAdd::execute()
method has support for the qty
request param. Try adding a new hidden input named qty
and value of 2
in the add-to-cart form template file.
Maybe there's a more elegant way of doing this, but I don't know about it yet.
1
I have added this code: <script type="text/x-magento-init"> "#product_addtocart_form": "Magento_Catalog/product/view/validation": "radioCheckboxClosest": ".nested" , "catalogAddToCart": "addToCartButtonTextDefault": "<?php echo __('Add to Cart'); ?>", "addToCartButtonTextWhileAdding": "<?php echo __('Adding...'); ?>", "addToCartButtonTextAdded": "<?php echo __('Added'); ?>" </script> in vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
– user15917
Apr 26 '16 at 11:50
add a comment |
The MagentoCheckoutControllerCartAdd::execute()
method has support for the qty
request param. Try adding a new hidden input named qty
and value of 2
in the add-to-cart form template file.
Maybe there's a more elegant way of doing this, but I don't know about it yet.
The MagentoCheckoutControllerCartAdd::execute()
method has support for the qty
request param. Try adding a new hidden input named qty
and value of 2
in the add-to-cart form template file.
Maybe there's a more elegant way of doing this, but I don't know about it yet.
answered Apr 24 '16 at 10:25
nevvermindnevvermind
1,3101118
1,3101118
1
I have added this code: <script type="text/x-magento-init"> "#product_addtocart_form": "Magento_Catalog/product/view/validation": "radioCheckboxClosest": ".nested" , "catalogAddToCart": "addToCartButtonTextDefault": "<?php echo __('Add to Cart'); ?>", "addToCartButtonTextWhileAdding": "<?php echo __('Adding...'); ?>", "addToCartButtonTextAdded": "<?php echo __('Added'); ?>" </script> in vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
– user15917
Apr 26 '16 at 11:50
add a comment |
1
I have added this code: <script type="text/x-magento-init"> "#product_addtocart_form": "Magento_Catalog/product/view/validation": "radioCheckboxClosest": ".nested" , "catalogAddToCart": "addToCartButtonTextDefault": "<?php echo __('Add to Cart'); ?>", "addToCartButtonTextWhileAdding": "<?php echo __('Adding...'); ?>", "addToCartButtonTextAdded": "<?php echo __('Added'); ?>" </script> in vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
– user15917
Apr 26 '16 at 11:50
1
1
I have added this code: <script type="text/x-magento-init"> "#product_addtocart_form": "Magento_Catalog/product/view/validation": "radioCheckboxClosest": ".nested" , "catalogAddToCart": "addToCartButtonTextDefault": "<?php echo __('Add to Cart'); ?>", "addToCartButtonTextWhileAdding": "<?php echo __('Adding...'); ?>", "addToCartButtonTextAdded": "<?php echo __('Added'); ?>" </script> in vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
– user15917
Apr 26 '16 at 11:50
I have added this code: <script type="text/x-magento-init"> "#product_addtocart_form": "Magento_Catalog/product/view/validation": "radioCheckboxClosest": ".nested" , "catalogAddToCart": "addToCartButtonTextDefault": "<?php echo __('Add to Cart'); ?>", "addToCartButtonTextWhileAdding": "<?php echo __('Adding...'); ?>", "addToCartButtonTextAdded": "<?php echo __('Added'); ?>" </script> in vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
– user15917
Apr 26 '16 at 11:50
add a comment |
from addtocart.phtml
<input type="number"
name="qty"
id="qty"
maxlength="12"
value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" />
change value to "2"
add a comment |
from addtocart.phtml
<input type="number"
name="qty"
id="qty"
maxlength="12"
value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" />
change value to "2"
add a comment |
from addtocart.phtml
<input type="number"
name="qty"
id="qty"
maxlength="12"
value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" />
change value to "2"
from addtocart.phtml
<input type="number"
name="qty"
id="qty"
maxlength="12"
value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" />
change value to "2"
answered Oct 17 '17 at 15:41
Slava YurthevSlava Yurthev
628
628
add a comment |
add a comment |
Hello it happen with me.
Solution for that:addtocart intilize two times on page so find out and remove it
add a comment |
Hello it happen with me.
Solution for that:addtocart intilize two times on page so find out and remove it
add a comment |
Hello it happen with me.
Solution for that:addtocart intilize two times on page so find out and remove it
Hello it happen with me.
Solution for that:addtocart intilize two times on page so find out and remove it
answered Nov 23 '17 at 17:10
Sunil PatelSunil Patel
1,3781612
1,3781612
add a comment |
add a comment |
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%2f112156%2fmagento-2-add-quantity-2-when-add-to-cart-from-product-view-page%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
Have you customize anything or extended any js ?
– Codrain Technolabs Pvt Ltd
Apr 22 '16 at 11:39
have you got this answer @user15917
– Devidas
Oct 27 '18 at 7:23