Skip to content
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

feat: created magic-cart-vanilla.js #509

Open
wants to merge 3 commits into
base: magic_integration_latest
Choose a base branch
from

Conversation

alex-rzp
Copy link

Note :- Please follow the below points while attaching test cases document link below:

- If label Tested is added then test cases document URL is mandatory.

- Link added should be a valid URL and accessible throughout the org.

- If the branch name contains hotfix / revert by default the BVT workflow check will pass.

Test Case Document URL
Please paste test case document link here....

Copy link

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Your implementation introduces excessive performance overhead to the page load.

@@ -46,5 +46,6 @@ $cartDataCount = count($cartData);
</div>
<link rel="stylesheet" type="text/css"
href="<?php echo $block->getViewFileUrl('Razorpay_Magento::css/magic.css'); ?>">

<script type="text/javascript" src="<?php echo $block->getViewFileUrl('Razorpay_Magento::js/magic-cart-vanilla.js'); ?>">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. type="text/javascript" is redundant,
  2. Use quick echo
  3. Add missing escaping.
Suggested change
<script type="text/javascript" src="<?php echo $block->getViewFileUrl('Razorpay_Magento::js/magic-cart-vanilla.js'); ?>">
<script src="<?= $escaper->escapeUrl($block->getViewFileUrl('Razorpay_Magento::js/magic-cart-vanilla.js')) ?>">

@@ -1,15 +1,23 @@
#cart-occ-template {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way you introduce CSS changes is incorrect and does not allow proper customization.
Instead, your changes should be located in web/css/_source/_magic.less then included in the _module.less, compiled and minified on the go, instead of causing performance overhead of loading additional CSS files.

@@ -0,0 +1,385 @@
(function () {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why you don't use UI Components?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants