Skip to content

Magento 2.3 - Issue to override price-box.js using mixin(In Firefox 66.0.2 version) #22338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
miteshdhaduk opened this issue Apr 15, 2019 · 23 comments
Labels
Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@miteshdhaduk
Copy link

miteshdhaduk commented Apr 15, 2019

Preconditions (*)

  1. Magento 2.3 (Firefox 66.0.2 (64-bit) version)
  2. Magento 2.3.1 (Firefox 66.0.2 (64-bit) version)
  3. Magento 2.2.8 (Firefox 66.0.2 (64-bit) version)

Steps to reproduce (*)

  1. Override updatePrice function(Magento_Catalog/js/price-box) using a mixin.
  2. File call using mixin properly but the updatePrice function is not called. (In chrome working fine, but in Firefox not working.)

Expected result (*)

  1. updatePrice function is call properly in all browser.

Actual result (*)

  1. updatePrice function is not call in Firefox.
@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2019

Hi @miteshdhaduk. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@miteshdhaduk do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 15, 2019
@raumatbel
Copy link
Contributor

We are making a mix of priceBox and exactly the same thing happens to us. In Chrome it works but in Firefox it does not.

@miteshdhaduk
Copy link
Author

@raumatbel Have you fix it or not?

@lionelalvarez
Copy link
Contributor

Hello, I have had the same problem in Magento 2.2.6

@miteshdhaduk
Copy link
Author

Hello, I have had the same problem in Magento 2.2.6

Have you fix it or not?

@raumatbel
Copy link
Contributor

At this time, the problem is not fixed @miteshdhaduk

@niravkrish niravkrish self-assigned this Apr 15, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2019

Hi @niravkrish. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.
    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

@mageprashant
Copy link

mageprashant commented Apr 15, 2019

@lionelalvarez @miteshdhaduk
It's my code and working fine to me.

requirejs-config.js

var config = 
{
    config: 
    {
        mixins: 
        {
            'Magento_Catalog/js/price-box':
            {
            	'Vendor_Module/js/price-box': true
            }
        }
    }
};

price-box.js

define([
	'jquery',
	'Magento_Catalog/js/price-utils',
	'underscore',
	'mage/template',
	'jquery/ui'
], function ($, utils, _, mageTemplate) 
{
	'use strict';
	
	return function (widget) 
	{
		$.widget('mage.priceBox', widget, 
		{
			updatePrice: function updatePrice(newPrices) {
			{
				// Custom code
			}
		});
		
		return $.mage.priceBox;
	}
});

@miteshdhaduk
Copy link
Author

@mageprashant Yes, you are right. But this is not working in Magento 2.2.8 and Magento 2.3.*(Not working in Firefox).

@niravkrish
Copy link
Contributor

@lionelalvarez @miteshdhaduk
It's my code and working fine to me.

requirejs-config.js

var config = 
{
    config: 
    {
        mixins: 
        {
            'Magento_Catalog/js/price-box':
            {
            	'Vendor_Module/js/price-box': true
            }
        }
    }
};

price-box.js

define([
	'jquery',
	'Magento_Catalog/js/price-utils',
	'underscore',
	'mage/template',
	'jquery/ui'
], function ($, utils, _, mageTemplate) 
{
	'use strict';
	
	return function (widget) 
	{
		$.widget('mage.priceBox', widget, 
		{
			updatePrice: function updatePrice(newPrices) {
			{
				// Custom code
			}
		});
		
		return $.mage.priceBox;
	}
});

Code Is working Fine with Magento 2.3.
I am also check in Firefox Browser.

@niravkrish niravkrish removed their assignment Apr 16, 2019
@ajijshekh123 ajijshekh123 reopened this Apr 16, 2019
@miteshdhaduk
Copy link
Author

@mageprashant @niravkrish Yes you are right. But this is not work in Firefox 66.0.2 (64-bit) version.

@miteshdhaduk
Copy link
Author

@ajijshekh123 Why you closed it?

@ajijshekh123
Copy link

Sorry, @miteshdhaduk It was by mistake close the issue.

@miteshdhaduk miteshdhaduk changed the title Magento 2.3 - Issue to override price-box.js using mixin Magento 2.3 - Issue to override price-box.js using mixin(In Firefox 66.0.2 version) Apr 16, 2019
@ghost ghost self-assigned this Apr 19, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 19, 2019

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost
Copy link

ghost commented Apr 19, 2019

Hi @miteshdhaduk thank you for you report, iєm not able to reproduce followings steps you described on clean magento 2.3-develop and Firefox 66.0.2 (64-bit) version. please refer to -> Community Forums or the Magento Stack Exchange

@ghost ghost closed this as completed Apr 19, 2019
@miteshdhaduk
Copy link
Author

@engcom-backlog-nazar I used php7.2.17. And currently I also checked and it is not working. I override updatePrice function using mixin. File execute but the function is not called.

@DeepPopat
Copy link

Hello @engcom-backlog-nazar

I have checked this issue with the fresh installation (Magento 2.3.*) in my local system. with the Firefox latest version. I have also attached the gif over here.

ezgif com-video-to-gif

@nimitaemipro nimitaemipro reopened this Apr 20, 2019
@ghost ghost removed their assignment Apr 20, 2019
@ghost
Copy link

ghost commented Apr 22, 2019

Hi @DeepPopat so please provide exact steps to reproduce not a gif.

@ghost ghost self-assigned this Apr 22, 2019
@miketaylr
Copy link

Hi all - Firefox engineer here. In 66 we added support for window.event and changed the value of keyCode inside a keypress event handler (to match what Chrome does). So rather than be 0, it will be set to the same value as charCode.

We also don't dispatch keypress for non-printable keys: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Compatibility_notes

So if you had Firefox-specific keypress handling, you should be able to just use whatever you were sending to Chrome for 66+. For older versions, you can use the absence of window.event as a signal it will need the legacy behavior.

I'm not familiar with magento code, or if this component uses keypress... but I'm happy to help if someone who is more familiar with magento can help me. :)

@AlexWorking
Copy link

Hi, @miteshdhaduk. We are closing this issue due to inactivity.

@pravalitera
Copy link

pravalitera commented Jul 5, 2019

@AlexWorking
I understand that you need to clean the backlog, but really. Stop closing every issue wih "no activity" or "i can't reproduce it". It's fucking not true. I've already read the same exact pb on 2 anothers tickets :

#7322
#14118

It's really annoying when you encounter a real problem, to see that it's as nobody cares about community...

edit: and hooray, a guy found a "fix"
https://magento.stackexchange.com/questions/267502/price-box-js-overriding-via-mixin-bug-magento-2-3
edit2: i had to put another selector than the one written in the stackExchange, but definetly, the mixin is working properly this way.
But still, does not work the way it should work...

@srenon
Copy link
Member

srenon commented Aug 8, 2019

@miteshdhaduk... is this issue fixed?

This should fix the filtering issue

<script type="text/x-magento-init">
    {
        "[data-role=priceBox][data-price-box=product-id-<?= $block->escapeHtml($_product->getId()) ?>]": {
            "Magento_Catalog/js/price-box": {
                "priceConfig":  <?= /* @escapeNotVerified */ $block->getJsonConfig() ?>
            }
        }
    }
</script>

See /app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml and #12929

srenon added a commit to srenon/magento2 that referenced this issue Aug 8, 2019
@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Aug 20, 2019
@magento-engcom-team
Copy link
Contributor

Hi @miteshdhaduk. Thank you for your report.
The issue has been fixed in #24054 by @srenon in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests