Product List - Configurable swatchs don't update price Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraConfigurable Products - update price by selected simple productAdd to Cart overlapping Product Price - How to fix? (Magento Product List Widget)Configurable product priceHow to stop changing of base image when size is selected in details page?configurable product price not change on product pageGet associated products Price and Size from configurable producthow to update product preview image on product page like the functionality on list page , magento2How to change price for configurable products in Product Listing in a modalConfigurable Product Attribute Price “undefined”Price change for Configurable products in list

What is it called when you ride around on your front wheel?

Is it OK if I do not take the receipt in Germany?

How would I use different systems of magic when they are capable of the same effects?

Error: Syntax error. Missing ')' for CASE Statement

How do I check if a string is entirely made of the same substring?

Can you stand up from being prone using Skirmisher outside of your turn?

Israeli soda type drink

Why did Israel vote against lifting the American embargo on Cuba?

How to not starve gigantic beasts

Check if a string is entirely made of the same substring

Does Feeblemind produce an ongoing magical effect that can be dispelled?

Are there moral objections to a life motivated purely by money? How to sway a person from this lifestyle?

Is Electric Central Heating worth it if using Solar Panels?

My admission is revoked after accepting the admission offer

What is the ongoing value of the Kanban board to the developers as opposed to management

Why does the Cisco show run command not show the full version, while the show version command does?

Is it acceptable to use working hours to read general interest books?

std::is_constructible on incomplete types

What *exactly* is electrical current, voltage, and resistance?

Raising a bilingual kid. When should we introduce the majority language?

Align column where each cell has two decimals with siunitx

What is the term for a person whose job is to place products on shelves in stores?

Are these square matrices always diagonalisable?

What’s with the clanks in Endgame?



Product List - Configurable swatchs don't update price



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraConfigurable Products - update price by selected simple productAdd to Cart overlapping Product Price - How to fix? (Magento Product List Widget)Configurable product priceHow to stop changing of base image when size is selected in details page?configurable product price not change on product pageGet associated products Price and Size from configurable producthow to update product preview image on product page like the functionality on list page , magento2How to change price for configurable products in Product Listing in a modalConfigurable Product Attribute Price “undefined”Price change for Configurable products in list



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have a configurable product with a size attribute that I am showing in the products list and in the product page and depending on the size of the product, the image and the price is changed.



But I am facing two problems



In the product page, everything is working OK, the price is changing and the image is changing.



1 problem) However in the products list/grid just the image change when I select the product size in the swatch. The price don't update.



2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either.



Anybody can help?



Thanks in advance



Update:



I contact the theme support and they fix the second problem



"2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either."



But the first problem looks like Magento don't update this price in the product list page, so this is not a theme problem.



How can I implement this price update?










share|improve this question
























  • Please mark whether you are using Magento2 or 1x

    – Phil M
    Nov 23 '16 at 22:37











  • Magento 1.9.2.4

    – Murillo
    Nov 25 '16 at 12:50

















1















I have a configurable product with a size attribute that I am showing in the products list and in the product page and depending on the size of the product, the image and the price is changed.



But I am facing two problems



In the product page, everything is working OK, the price is changing and the image is changing.



1 problem) However in the products list/grid just the image change when I select the product size in the swatch. The price don't update.



2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either.



Anybody can help?



Thanks in advance



Update:



I contact the theme support and they fix the second problem



"2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either."



But the first problem looks like Magento don't update this price in the product list page, so this is not a theme problem.



How can I implement this price update?










share|improve this question
























  • Please mark whether you are using Magento2 or 1x

    – Phil M
    Nov 23 '16 at 22:37











  • Magento 1.9.2.4

    – Murillo
    Nov 25 '16 at 12:50













1












1








1


0






I have a configurable product with a size attribute that I am showing in the products list and in the product page and depending on the size of the product, the image and the price is changed.



But I am facing two problems



In the product page, everything is working OK, the price is changing and the image is changing.



1 problem) However in the products list/grid just the image change when I select the product size in the swatch. The price don't update.



2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either.



Anybody can help?



Thanks in advance



Update:



I contact the theme support and they fix the second problem



"2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either."



But the first problem looks like Magento don't update this price in the product list page, so this is not a theme problem.



How can I implement this price update?










share|improve this question
















I have a configurable product with a size attribute that I am showing in the products list and in the product page and depending on the size of the product, the image and the price is changed.



But I am facing two problems



In the product page, everything is working OK, the price is changing and the image is changing.



1 problem) However in the products list/grid just the image change when I select the product size in the swatch. The price don't update.



2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either.



Anybody can help?



Thanks in advance



Update:



I contact the theme support and they fix the second problem



"2 problem) Still in the products list/grid when I press the button 'Buy' in a product with this size attribute, a modal window appear to select the size but the price in this window doesn't change either."



But the first problem looks like Magento don't update this price in the product list page, so this is not a theme problem.



How can I implement this price update?







configurable-product product-list swatches pricing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '16 at 10:35







Murillo

















asked Nov 23 '16 at 22:11









MurilloMurillo

64




64












  • Please mark whether you are using Magento2 or 1x

    – Phil M
    Nov 23 '16 at 22:37











  • Magento 1.9.2.4

    – Murillo
    Nov 25 '16 at 12:50

















  • Please mark whether you are using Magento2 or 1x

    – Phil M
    Nov 23 '16 at 22:37











  • Magento 1.9.2.4

    – Murillo
    Nov 25 '16 at 12:50
















Please mark whether you are using Magento2 or 1x

– Phil M
Nov 23 '16 at 22:37





Please mark whether you are using Magento2 or 1x

– Phil M
Nov 23 '16 at 22:37













Magento 1.9.2.4

– Murillo
Nov 25 '16 at 12:50





Magento 1.9.2.4

– Murillo
Nov 25 '16 at 12:50










2 Answers
2






active

oldest

votes


















0














Obviously there is a customization in place, and that customization does not account for changes in price based on configurable options. Figure out what that customization is.



If its a commercial module, then find out if an update is released that fixes this issue... if not then report the issue to their support team.



If its your own custom development, then there is a lot of work required in order to support this. Magento product.js includes a lot of the pricing adjustments that you see on the Product View page, but that is not loaded on the category pages -- and in fact, it cannot be loaded because it is designed as a singleton style object that assumes only a single product loaded per page.



Commercial extensions such as Belvg Quick View or Amasty Ajax Shopping Cart resolve the problem above by loading the configurable product in a lightbox and only a single instance of the product.js object is active at a time.






share|improve this answer























  • Yes, I have a theme. I thought that could be a Magento problem and not a theme problem. I'll try with the theme's support team. Thank you

    – Murillo
    Nov 23 '16 at 22:43












  • Do you know how to turn on template path hints?

    – Phil M
    Nov 23 '16 at 22:45











  • No, never heard about it. What is it for?

    – Murillo
    Nov 23 '16 at 22:57











  • It allows you to see what files and classes are being used to render the page. Its a very handy tool to fix errors and make modifications.

    – Phil M
    Nov 23 '16 at 22:59











  • Very good. It will help me a lot. Thank you so much

    – Murillo
    Nov 25 '16 at 13:55


















0














I found a little solution for this bug.



On the category product list page the pricebox is not being initialized.
It work on the product detail page because the initialization happens here:
app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml



I could not find anything equal on the product listing page so I tried to get it inside somehow. I changed
app/design/CUSTOM/THEME/Magento_Swatches/templates/product/listing/renderer.phtml



from:



require(["jquery", "jquery/ui", "Magento_Swatches/js/swatch-renderer"], function ($) 
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);


to



require(["jquery", "jquery/ui","priceBox", "Magento_Swatches/js/swatch-renderer"], function ($) 
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?php echo $block->getProduct()->getId()?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

priceBoxes = priceBoxes.filter(function(index, elem)
return !$(elem).find('.price-from').length;
);

priceBoxes.priceBox();
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);







share|improve this answer























  • i do above solution but price is not formatted, $ sign is remove

    – Nikhil Vaghela
    Nov 22 '17 at 4:12











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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f147239%2fproduct-list-configurable-swatchs-dont-update-price%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Obviously there is a customization in place, and that customization does not account for changes in price based on configurable options. Figure out what that customization is.



If its a commercial module, then find out if an update is released that fixes this issue... if not then report the issue to their support team.



If its your own custom development, then there is a lot of work required in order to support this. Magento product.js includes a lot of the pricing adjustments that you see on the Product View page, but that is not loaded on the category pages -- and in fact, it cannot be loaded because it is designed as a singleton style object that assumes only a single product loaded per page.



Commercial extensions such as Belvg Quick View or Amasty Ajax Shopping Cart resolve the problem above by loading the configurable product in a lightbox and only a single instance of the product.js object is active at a time.






share|improve this answer























  • Yes, I have a theme. I thought that could be a Magento problem and not a theme problem. I'll try with the theme's support team. Thank you

    – Murillo
    Nov 23 '16 at 22:43












  • Do you know how to turn on template path hints?

    – Phil M
    Nov 23 '16 at 22:45











  • No, never heard about it. What is it for?

    – Murillo
    Nov 23 '16 at 22:57











  • It allows you to see what files and classes are being used to render the page. Its a very handy tool to fix errors and make modifications.

    – Phil M
    Nov 23 '16 at 22:59











  • Very good. It will help me a lot. Thank you so much

    – Murillo
    Nov 25 '16 at 13:55















0














Obviously there is a customization in place, and that customization does not account for changes in price based on configurable options. Figure out what that customization is.



If its a commercial module, then find out if an update is released that fixes this issue... if not then report the issue to their support team.



If its your own custom development, then there is a lot of work required in order to support this. Magento product.js includes a lot of the pricing adjustments that you see on the Product View page, but that is not loaded on the category pages -- and in fact, it cannot be loaded because it is designed as a singleton style object that assumes only a single product loaded per page.



Commercial extensions such as Belvg Quick View or Amasty Ajax Shopping Cart resolve the problem above by loading the configurable product in a lightbox and only a single instance of the product.js object is active at a time.






share|improve this answer























  • Yes, I have a theme. I thought that could be a Magento problem and not a theme problem. I'll try with the theme's support team. Thank you

    – Murillo
    Nov 23 '16 at 22:43












  • Do you know how to turn on template path hints?

    – Phil M
    Nov 23 '16 at 22:45











  • No, never heard about it. What is it for?

    – Murillo
    Nov 23 '16 at 22:57











  • It allows you to see what files and classes are being used to render the page. Its a very handy tool to fix errors and make modifications.

    – Phil M
    Nov 23 '16 at 22:59











  • Very good. It will help me a lot. Thank you so much

    – Murillo
    Nov 25 '16 at 13:55













0












0








0







Obviously there is a customization in place, and that customization does not account for changes in price based on configurable options. Figure out what that customization is.



If its a commercial module, then find out if an update is released that fixes this issue... if not then report the issue to their support team.



If its your own custom development, then there is a lot of work required in order to support this. Magento product.js includes a lot of the pricing adjustments that you see on the Product View page, but that is not loaded on the category pages -- and in fact, it cannot be loaded because it is designed as a singleton style object that assumes only a single product loaded per page.



Commercial extensions such as Belvg Quick View or Amasty Ajax Shopping Cart resolve the problem above by loading the configurable product in a lightbox and only a single instance of the product.js object is active at a time.






share|improve this answer













Obviously there is a customization in place, and that customization does not account for changes in price based on configurable options. Figure out what that customization is.



If its a commercial module, then find out if an update is released that fixes this issue... if not then report the issue to their support team.



If its your own custom development, then there is a lot of work required in order to support this. Magento product.js includes a lot of the pricing adjustments that you see on the Product View page, but that is not loaded on the category pages -- and in fact, it cannot be loaded because it is designed as a singleton style object that assumes only a single product loaded per page.



Commercial extensions such as Belvg Quick View or Amasty Ajax Shopping Cart resolve the problem above by loading the configurable product in a lightbox and only a single instance of the product.js object is active at a time.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 '16 at 22:36









Phil MPhil M

67328




67328












  • Yes, I have a theme. I thought that could be a Magento problem and not a theme problem. I'll try with the theme's support team. Thank you

    – Murillo
    Nov 23 '16 at 22:43












  • Do you know how to turn on template path hints?

    – Phil M
    Nov 23 '16 at 22:45











  • No, never heard about it. What is it for?

    – Murillo
    Nov 23 '16 at 22:57











  • It allows you to see what files and classes are being used to render the page. Its a very handy tool to fix errors and make modifications.

    – Phil M
    Nov 23 '16 at 22:59











  • Very good. It will help me a lot. Thank you so much

    – Murillo
    Nov 25 '16 at 13:55

















  • Yes, I have a theme. I thought that could be a Magento problem and not a theme problem. I'll try with the theme's support team. Thank you

    – Murillo
    Nov 23 '16 at 22:43












  • Do you know how to turn on template path hints?

    – Phil M
    Nov 23 '16 at 22:45











  • No, never heard about it. What is it for?

    – Murillo
    Nov 23 '16 at 22:57











  • It allows you to see what files and classes are being used to render the page. Its a very handy tool to fix errors and make modifications.

    – Phil M
    Nov 23 '16 at 22:59











  • Very good. It will help me a lot. Thank you so much

    – Murillo
    Nov 25 '16 at 13:55
















Yes, I have a theme. I thought that could be a Magento problem and not a theme problem. I'll try with the theme's support team. Thank you

– Murillo
Nov 23 '16 at 22:43






Yes, I have a theme. I thought that could be a Magento problem and not a theme problem. I'll try with the theme's support team. Thank you

– Murillo
Nov 23 '16 at 22:43














Do you know how to turn on template path hints?

– Phil M
Nov 23 '16 at 22:45





Do you know how to turn on template path hints?

– Phil M
Nov 23 '16 at 22:45













No, never heard about it. What is it for?

– Murillo
Nov 23 '16 at 22:57





No, never heard about it. What is it for?

– Murillo
Nov 23 '16 at 22:57













It allows you to see what files and classes are being used to render the page. Its a very handy tool to fix errors and make modifications.

– Phil M
Nov 23 '16 at 22:59





It allows you to see what files and classes are being used to render the page. Its a very handy tool to fix errors and make modifications.

– Phil M
Nov 23 '16 at 22:59













Very good. It will help me a lot. Thank you so much

– Murillo
Nov 25 '16 at 13:55





Very good. It will help me a lot. Thank you so much

– Murillo
Nov 25 '16 at 13:55













0














I found a little solution for this bug.



On the category product list page the pricebox is not being initialized.
It work on the product detail page because the initialization happens here:
app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml



I could not find anything equal on the product listing page so I tried to get it inside somehow. I changed
app/design/CUSTOM/THEME/Magento_Swatches/templates/product/listing/renderer.phtml



from:



require(["jquery", "jquery/ui", "Magento_Swatches/js/swatch-renderer"], function ($) 
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);


to



require(["jquery", "jquery/ui","priceBox", "Magento_Swatches/js/swatch-renderer"], function ($) 
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?php echo $block->getProduct()->getId()?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

priceBoxes = priceBoxes.filter(function(index, elem)
return !$(elem).find('.price-from').length;
);

priceBoxes.priceBox();
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);







share|improve this answer























  • i do above solution but price is not formatted, $ sign is remove

    – Nikhil Vaghela
    Nov 22 '17 at 4:12















0














I found a little solution for this bug.



On the category product list page the pricebox is not being initialized.
It work on the product detail page because the initialization happens here:
app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml



I could not find anything equal on the product listing page so I tried to get it inside somehow. I changed
app/design/CUSTOM/THEME/Magento_Swatches/templates/product/listing/renderer.phtml



from:



require(["jquery", "jquery/ui", "Magento_Swatches/js/swatch-renderer"], function ($) 
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);


to



require(["jquery", "jquery/ui","priceBox", "Magento_Swatches/js/swatch-renderer"], function ($) 
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?php echo $block->getProduct()->getId()?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

priceBoxes = priceBoxes.filter(function(index, elem)
return !$(elem).find('.price-from').length;
);

priceBoxes.priceBox();
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);







share|improve this answer























  • i do above solution but price is not formatted, $ sign is remove

    – Nikhil Vaghela
    Nov 22 '17 at 4:12













0












0








0







I found a little solution for this bug.



On the category product list page the pricebox is not being initialized.
It work on the product detail page because the initialization happens here:
app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml



I could not find anything equal on the product listing page so I tried to get it inside somehow. I changed
app/design/CUSTOM/THEME/Magento_Swatches/templates/product/listing/renderer.phtml



from:



require(["jquery", "jquery/ui", "Magento_Swatches/js/swatch-renderer"], function ($) 
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);


to



require(["jquery", "jquery/ui","priceBox", "Magento_Swatches/js/swatch-renderer"], function ($) 
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?php echo $block->getProduct()->getId()?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

priceBoxes = priceBoxes.filter(function(index, elem)
return !$(elem).find('.price-from').length;
);

priceBoxes.priceBox();
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);







share|improve this answer













I found a little solution for this bug.



On the category product list page the pricebox is not being initialized.
It work on the product detail page because the initialization happens here:
app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml



I could not find anything equal on the product listing page so I tried to get it inside somehow. I changed
app/design/CUSTOM/THEME/Magento_Swatches/templates/product/listing/renderer.phtml



from:



require(["jquery", "jquery/ui", "Magento_Swatches/js/swatch-renderer"], function ($) 
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);


to



require(["jquery", "jquery/ui","priceBox", "Magento_Swatches/js/swatch-renderer"], function ($) 
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?php echo $block->getProduct()->getId()?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

priceBoxes = priceBoxes.filter(function(index, elem)
return !$(elem).find('.price-from').length;
);

priceBoxes.priceBox();
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').SwatchRenderer(
selectorProduct: '.product-item-details',
onlySwatches: true,
enableControlLabel: false,
numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
);
);








share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 14 '17 at 23:12









Johnny LongneckJohnny Longneck

17619




17619












  • i do above solution but price is not formatted, $ sign is remove

    – Nikhil Vaghela
    Nov 22 '17 at 4:12

















  • i do above solution but price is not formatted, $ sign is remove

    – Nikhil Vaghela
    Nov 22 '17 at 4:12
















i do above solution but price is not formatted, $ sign is remove

– Nikhil Vaghela
Nov 22 '17 at 4:12





i do above solution but price is not formatted, $ sign is remove

– Nikhil Vaghela
Nov 22 '17 at 4:12

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f147239%2fproduct-list-configurable-swatchs-dont-update-price%23new-answer', 'question_page');

);

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







Popular posts from this blog

Sum ergo cogito? 1 nng

419 nièngy_Soadمي 19bal1.5o_g

Queiggey Chernihivv 9NnOo i Zw X QqKk LpB