-
Notifications
You must be signed in to change notification settings - Fork 63
Added queue clearing #170
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
base: dev
Are you sure you want to change the base?
Added queue clearing #170
Conversation
JavaScript events considered: - updateCart - changedCheckoutStep - updatedProduct - updateProductList
controllers/front/ajax.php
Outdated
| /** | ||
| * @var Ps_Googleanalytics | ||
| */ | ||
| public $module; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? I think it should be automatic when you are extending ModuleFrontController.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not necessary; I added it to make the type explicit, i.e., "Ps_Googleanalytics", so that there are no warnings in the editor.
However, if you consider it "redundant", I can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove this please, your IDE complains because it lacks the context of a parent class. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.
Thanks!
Co-authored-by: Nicolas Lœuillet <nicolas@loeuillet.org>
Hlavtox
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block to prevent accidental merge, I want to check and test it. 👍
|
@Hlavtox, |
|
awesome, waiting for merge |
|
@Hlavtox, have you had a chance to review this PR? Also, if it's okay, I could create a second PR with the changes related to updating the product list (e.g., on the category page when filtering). Thanks, and sorry for bothering you. |
Hlavtox
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment but I think its good.
ping @kpodemski for check
controllers/front/ajax.php
Outdated
| /** | ||
| * @var Ps_Googleanalytics | ||
| */ | ||
| public $module; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove this please, your IDE complains because it lacks the context of a parent class. :-)
|
@Hlavtox, Initially, I had added the type declaration in the class definition like this (since my IDE suggested it): /**
* @var Ps_Googleanalytics
*/
public $module;But you rightly advised me to remove it (#170 (comment)). I'd like to fix these issues since I'm preparing videos to demonstrate the functionality - this way we can work toward closing this PR. Thanks! |
|
Open up this file - https://github.com/PrestaShop/ps_googleanalytics/blob/dev/tests/phpstan/phpstan-8.0.neon And add this to
And probably the same for https://github.com/PrestaShop/ps_googleanalytics/blob/dev/tests/phpstan/phpstan-latest.neon, not sure. Should work 🎉 |
cf51d26 to
55b954c
Compare
55b954c to
07dd3d0
Compare
|
@Hlavtox, I also had to modify:
After several attempts, I finally got it working 😄 I think it should be good now. Thanks a lot! |
|
Below are some videos and screenshots showing how the changes work.
triggers an AJAX call to the ajax.php file with the parameter Screenshot of adding to cart without the modificationVideo of adding to cart without the modificationAdd.to.cart.-.without.fix.webmScreenshot of adding to cart with the modificationVideo of adding to cart with the modificationAdd.to.cart.-.with.fix.webmVideo of updateCart and changedCheckoutStep eventsupdateCart.-.changedCheckoutStep.webmVideo of updateProductList, clickQuickView, and updatedProduct eventsupdateProductList.-.clickQuickView.-.updatedProduct.webm |
|
Hi @PrestaShop/qa-functional, Thanks in advance! 🙏 |
paulnoelcholot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Codencode,
Thank you for your suggestion. We indeed lack competent resources on the subject of Google Analytics. Could you provide us with a clear and precise step-to-reproduce to test the issue, then the PR?
Thanks you very much!
|
Hello @paulnoelcholot The issue is that some Google Analytics events are not tracked at the time the action is performed but are instead tracked when the page is reloaded. To test these events, you need to use Google Tag Assistant: https://tagassistant.google.com/ 1. Google Tag Assistant setup01.-.init.webm2. Using Google Tag Assistant to verify that the event is sent on page refresh and not when clicking "Add to cart"02.-.problem.-.add.to.cart.webm3. Using Google Tag Assistant with the new code to confirm that the event is sent when clicking "Add to cart"03.-.fix.-.add.to.cart.webmIn the videos, the text is in Italian, and the "Add to cart" event is labeled as "Aggiungi al carrello." Let me know if you need any further clarification. |
|
@paulnoelcholot |
|
@paulnoelcholot, were you able to run the tests in the end? |
|
ping @PrestaShop/qa-functional |
|
@Hlavtox @kpodemski, I think testing this change is a bit 'complicated.' I tried my best to explain how to do it and even added some videos. Do you have any suggestions? I'm afraid these changes won't get merged, and that's a shame. |



JavaScript events considered: