Change ‘My cart’ text
-
Hi there,
Is there a setting to change the drawer title text?
If possible I’d like to change it to ‘Shopping Cart’.
Thank you for your help!
-
Also, is it possible to hide ‘cpops-cart-item__quantity-selector’ is there is only 1 item in stock?
And / or edit the error message too.
The ‘Sorry, “Product with only 1 in stock” is not in stock.‘ message when using the quantity selector on a product with one in stock is potentially confusing.
- This reply was modified 5 months, 2 weeks ago by JapeNZ.
And final one ??
Is it possible to change the checkout button text from ‘Checkout now’ to ‘Checkout’?
I tried using the standard:
function my_custom_checkout_button_text() {
return 'Checkout';
}
add_filter( 'woocommerce_order_button_text', 'my_custom_checkout_button_text' );Which initially worked, but if I remove an item from the checkout the button text returns to ‘Checkout now’.
Thank you for all your help!
- This reply was modified 5 months, 2 weeks ago by JapeNZ.
Hi there,
Thank you for reaching out!
Currently, there is no native option to change the drawer title text directly. However, you can try using the Loco Translate plugin to manipulate the text. This plugin allows you to translate and modify strings within your WordPress site.
For your second concern, there is no native option to hide the ‘cpops-cart-item__quantity-selector’ when there is only 1 item in stock or to edit the error message. However, you can achieve this by modifying the code. Please note that implementing custom scripts is beyond our support scope.
Let us know if you have any further questions.
Best,
Niel, Cartpops
Hi Niel,
I assume the same applies for changing the ‘Checkout now’ text too?
Thanks for your help ??
Hi Niel,
I was able to resolve these using the Branda plugins Text Replacement utility ??
Thanks again for your help!
Hi Niel,
I was able to resolve the issue with the quantity selector on products with only 1 in stock by using this code:
// Mark product as Sold Individually if only one is in stock
add_filter( 'woocommerce_is_sold_individually', 'woocommerce_custom_is_sold_individually', 10, 2 );
function woocommerce_custom_is_sold_individually( $individually, $product ) {
if ( $product->get_stock_quantity() === 1 ) {
$individually = true;
}
return $individually;
}Now when there’s only 1 the quantity selector isn’t shown, it was more a happy coincidence as I was trying this out for something else… but hey it seems to work ??
But, when there’s more than one but not infinite, if adding one more than is in stock I’m getting the out of stock error message.
I was looking through ‘class-cartpops-ajax.php’ and it looks like it should be showing a different message:
if ( $product->managing_stock() && !$product->backorders_allowed() && $product->get_stock_quantity() < $held_stock + $required_stock ) {
$in_stock = false;
/* translators: 1: product name 2: quantity in stock */
$message = sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order (%2$s available). We apologize for any inconvenience caused.', 'cartpops' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity() - $held_stock, $product ) );
$message_type = 'error';
}This would be perfect if I could get it to work.
Are there any known conflicts I should be aware of?
I’ve tried with just Woocommerce and Twenty Four theme but the message from this code doesn;t seem to be firing for me.Thanks for all your help!
- This reply was modified 5 months, 2 weeks ago by JapeNZ.
Hi there,
Thanks for sharing the code you used to fix the quantity selector issue. It’s great that it’s working for you!
For the out-of-stock error when there’s more than one item in stock, here are some suggestions:
- Deactivate Other Plugins: Even though you tested with just WooCommerce and the Twenty Twenty-Four theme, try deactivating all other plugins to ensure there’s no conflict.
- Check for Custom Overrides: Look for any custom code in your theme or other customizations that might affect WooCommerce’s stock management messages.
If the issue still persists after these checks, you might need to look deeper into the WooCommerce code or get help from their support forums or a developer familiar with WooCommerce.
I hope this helps!
Best,
Niel, Cartpops
Hi @cartpopsteam,
Yeah I have a staging site running and have just tested with the Storefront theme, Woocommerce and Cartpops active only.
I’m still not seeing the ”Sorry, we do not have enough “%1$s” in stock to fulfill your order…’ message.
Are you able to test that it’s working on your end?
I have a product with 2 instock that is added to cart, and am using the quantity selector in the cart to try and add a third to test the message response.
Perhaps you could limit the stock amount of one of the products in your demo?Thanks again!
- This reply was modified 5 months, 2 weeks ago by JapeNZ.
Hi there,
Thanks for testing that on your staging site.
The issue seems to be related to a custom setup. Custom scripting and configurations are beyond our support scope.
I recommend consulting with a developer who can help with your specific setup.
Thanks for understanding!
Best,
Niel, Cartpops
- You must be logged in to reply to this topic.