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

Refactor tier price table rendering and sorting logic #89

Merged

Conversation

MatBonnin
Copy link
Contributor

The changes fix an Issue where the tier price table was not properly sorted when the page was loaded. :

  • Replacing jQuery selectors with native JavaScript methods

This commit refactors the JavaScript code responsible for rendering and sorting the tier price table. It improves the readability and maintainability of the code by introducing better variable names and using modern JavaScript syntax. The changes include:
- Replacing jQuery selectors with native JavaScript methods

The changes also fix a bug where the tier price table was not properly sorted when the page was loaded.
Comment on lines 43 to 45
* @ORM\OneToMany(targetEntity="Brille24\SyliusTierPricePlugin\Entity\TierPrice", mappedBy="productVariant", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"customerGroup" = "ASC", "qty" = "ASC"})
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you migrate this back to annotations?

@@ -17,9 +17,6 @@
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20201014111513 extends AbstractMigration
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you're already at it remove the entire migration directory. They should be run in the project installing it.

@MatBonnin
Copy link
Contributor Author

Oh no, I’m sorry. The first commit (4c341b4) was the one I intended to submit, but 9752156 contains changes I need for my personal project, which I didn’t mean to include. Sorry about that, this is my first time contributing to a GitHub project. I have made a new commit, and now the only remaining changes are the conversion of the file from jQuery to native JavaScript, and the import of itemCollectionRender.js in _tierprice.html.twig since the Twig file wasn’t detecting the JavaScript file properly.

@mamazu mamazu merged commit e7393b9 into Brille24:master Oct 21, 2024
@mamazu
Copy link
Collaborator

mamazu commented Oct 21, 2024

Thank you again for your contribution, I have merged and tagged it now. If you require 3.0.1 in your project of this plugin you'll get your fixes natively. 🎉

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

Successfully merging this pull request may close these issues.

2 participants