-
-
Notifications
You must be signed in to change notification settings - Fork 105
Feature/rework ajax cart #1032
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
Feature/rework ajax cart #1032
Conversation
Refactors the mini-cart template into three separate files (item, footer, main) to enable independent AJAX calls for each section. This improves modularity and allows for more efficient updates to specific parts of the mini-cart.
Refactors the mini-cart to use fragments for more granular updates, improves the user experience, and prevents full page reloads. Adds support for displaying WooCommerce notices as toasts in the mini-cart and implements a filter to enable or disable toasts. Improves quantity update functionality in the mini-cart, including validation and handling of cart updates and error messages. Adds a container for WooCommerce messages for improved handling and animation capabilities. Show removal of products as well.
Updates the CSS selector used to refresh the total amount in the mini-cart, ensuring it targets the correct element after recent template changes.
Implements button loader for products in the loop using a PHP filter instead of JavaScript. Should improve performance and cacheability.
Streamlines quantity button handling by using filters for enabling/disabling buttons, removing the need for JavaScript validation. Improves cart updating process by consolidating quantity update logic into a single function. Addresses issues with quantity input focus and blur events, ensuring proper value handling and validation.
Reimplements the quantity button logic for single product pages and legacy cart forms, ensuring correct value updates and button state management. Refactors the existing quantity button handling to differentiate between single product/legacy cart forms and the AJAX mini-cart, preventing conflicts and ensuring proper functionality in both contexts.
Refactors the mini-cart template into three separate files (item, footer, main) to enable independent AJAX calls for each section. This improves modularity and allows for more efficient updates to specific parts of the mini-cart.
Refactors the mini-cart to use fragments for more granular updates, improves the user experience, and prevents full page reloads. Adds support for displaying WooCommerce notices as toasts in the mini-cart and implements a filter to enable or disable toasts. Improves quantity update functionality in the mini-cart, including validation and handling of cart updates and error messages. Adds a container for WooCommerce messages for improved handling and animation capabilities. Show removal of products as well.
Updates the CSS selector used to refresh the total amount in the mini-cart, ensuring it targets the correct element after recent template changes.
Implements button loader for products in the loop using a PHP filter instead of JavaScript. Should improve performance and cacheability.
Streamlines quantity button handling by using filters for enabling/disabling buttons, removing the need for JavaScript validation. Improves cart updating process by consolidating quantity update logic into a single function. Addresses issues with quantity input focus and blur events, ensuring proper value handling and validation.
Reimplements the quantity button logic for single product pages and legacy cart forms, ensuring correct value updates and button state management. Refactors the existing quantity button handling to differentiate between single product/legacy cart forms and the AJAX mini-cart, preventing conflicts and ensuring proper functionality in both contexts.
… into feature/rework-ajax-add-to-cart
Consolidates quantity button handling into woocommerce.js for single product and legacy cart forms. Disables toast messages in the mini cart and reverts to normal messages.
Looks great! We should fix the translations at the end https://www.vdzev.de/service/broschueren-und-arbeitsmaterial/#anlagentechnik-oder-heizungsanlagen |
i would do that in one step with the js extraction. |
Filters in ajax-cart.php file: ajax-cart.php file: ajax-cart.php file: ajax-cart.php file: ajax-cart.php file: ajax-cart.php file: ajax-cart.php file: ajax-cart.php |
Renames filters to align with Bootscore naming conventions, improving code maintainability and readability.
Moves AJAX cart JavaScript to an external file for better organization and maintainability. Fixes quantity button behavior in the mini-cart, ensuring correct increment/decrement operations. Removes duplicated line of code and updates translation strings.
Disables the quantity input field when it is set to readonly, improving the user experience by preventing interaction with a non-editable field. Improves the display when only one item remains in stock by ensuring the quantity buttons are correctly disabled.
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.
Nice job! 🙏
New Filters
Docs
file: ajax-cart.php
file: ajax-cart.php
file: ajax-cart.php
file: ajax-cart.php
file: ajax-cart.php
file: ajax-cart.php
file: ajax-cart.php