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

Use WC strings instead of bootScore in mini cart #410

Merged
merged 6 commits into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions woocommerce/ajax-cart/ajax-add-to-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ function bootscore_product_page_ajax_add_to_cart_js() {

let notice = '';
if (response.error == true) {
notice = `<div class='woocommerce-error'><?php _e('You cannot add another', 'bootscore'); ?> “${prod_title}” <?php _e('to your cart.', 'bootscore'); ?></div>`;
let message = `<?= sprintf( __( 'You cannot add another "%s" to your cart.', 'woocommerce' ), '{{product_title}}' ) ?>`;
notice = `<div class="woocommerce-error">${message.replace('{{product_title}}', prod_title)}</div>`;
} else {
notice = `<div class="woocommerce-message">“${prod_title}” <?php _e('has been added to your cart.', 'bootscore'); ?></div>`;
let message = `<?= sprintf( _n( '%s has been added to your cart.', '%s have been added to your cart.', 1, 'woocommerce' ), '“{{product_title}}”' ) ?>`;
notice = `<div class="woocommerce-message">${message.replace('{{product_title}}', prod_title)}</div>`;
}

// Add new notices to offcanvas
Expand Down