You need to add a function in your theme’s functions.php
file that will find and remove those two words “shorts” and “longshorts” from a php string. Then you can add that function as a filter to the woocommerce_cart_item_name
event that is being applied in your mini-cart.php
Try something like:
function wpse_remove_shorts_from_cart_title( $product_name ) {
$product_name = str_ireplace( 'longshorts', '', $product_name ); // remove "longshorts";
$product_name = str_ireplace( 'shorts', '', $product_name ); // remove "shorts"
return $product_name;
}
add_filter( 'woocommerce_cart_item_name', 'wpse_remove_shorts_from_cart_title' );
Note, I’ve used str_ireplace()
to cover occurrences whether they’re capitalized or not (which is common in titles).
Related Posts:
- Order by rating not works in wp_query
- How to check if is in cart page? [closed]
- Display single product attribute value on Shop page (Woocommerce)
- Woocommerce 3.1 Add product image to order confirmation email not working
- Woocommerce: show default variation price is products list?
- Woocommerce checkout fields on the same line
- display available size on hover, in woocommerce shop page [closed]
- WooCommerce add_to_cart url not working [closed]
- How to Add Product Variation with Multiple Images via WooCommerce REST API
- How to build wordpress site which will have location based services & products?
- WooCommerce: Email Notifications
- How do you add custom metadata to WooCommerce orders? Specifically a second external order ID
- WooCommerce: Adding Order Item Meta Data That’s Hidden
- Redirect user after login through woocommerce login page to page with his/her username?
- WooCommerce restore stock on order cancel
- Woocoomerce product category count including subcategories
- WordPress select field – show current value?
- Get the category ID in checkout page woocomerce
- “Cannot read property ‘replace’ of undefined” Javascript error when trying to add attribute terms from add product page [closed]
- Order list woocommerce Orders based on meta for custom status
- Arranging Product Details on Shop Page
- WooCommerce product taxonomies and menu export
- Javascript / Ajax Error After Migrating To New Domain Name
- How can i stop woocommerce checkout event based on api request result?
- WordPress Twenty Seventeen header image size not responsive for mobile
- WooCommerce back-end very slow takes 10 seconds to load, slow queries
- Woocommerce custom meta fields, sort by date
- How to delete all customer user account that haven’t placed a single order?
- jquery.validation.js is not working in woocommerce checkout page form
- Backend users list – add Woocommerce meta to table
- Delete cookie when changing url (when navigating away from specific page of website)
- multi-vender wooCommerce ability to separate products based on zip code [closed]
- Hide account tab to certain users
- How to Update the Order-Items While Editing an Order on the WooCommerce Admin Order Screen [closed]
- Maintenance mode just for WooCommerce shop pages [closed]
- I want to run a script only once on a ‘thank you’ page
- search customers in front end by billing data
- Is it safe to have 2 mysql users?
- Custom email template for a specific product category
- update_post_meta not work [closed]
- How to set a default value in a meta box
- Can I have one picture for all sizes in a product with Woocommerce?
- Woocommerce password Reset
- WooCommerce Registration redirect based on page ID
- Woocommerce redirect “add to cart” button to a contact form with product information to get a inquiry
- How to remove WooCommerce Plugin some specific features [closed]
- How to remove product attribute row woocommerce using code
- override the default WooCommerce products search form
- How can I override wp_price woocommerce function in my theme
- Woocommerce : read [max_qty] using backorder
- I need to export all products and images but I don’t know which table the images are in
- Add only sku to product url woocoomerce
- What is better way to sync wp multisite woocommerce products
- Remove required from a custom field created from WooCommerce Checkout Field Editor plugin
- How to change status of woocommerce orders when post status is changed
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- How to send woocommerce emails in multiple languages
- Custom WooCommerce rewrite rules with comma delimiter
- Set city as required if country is Singapore
- Displaying Woocommerce Product Attributes on single product page
- WooCommerce – Child Category wont show, but Parent does
- WooCommerce Simple Auctions add username to auction finished email
- Enable Gutenberg for Woocommerce
- How to change product category permalinks programmatically?
- How to hide a random text with a div tag using a class on product pages with a specific tag
- Missing variable options on add to cart form
- Woocommerce digital download not working – database error Cannot add or update a child row: a foreign key constraint fails [closed]
- when product out of stock single page show button notify woo-commerce
- WooCommerce , Auto cancel orders status from processing after X days
- Change WooCommerce Word “Product” to Another Word
- How does a WooCommerce site integrate with the existing real world customer members?
- How can I send information when a order is completed to my own POS?
- Recently viewed products – Order by viewed
- How can i add product Accessories from front-end using custom php form?
- How to save order item custom attributes save into custom table
- Manually create an order with a product ID woocommerce
- How to filter result set in custom metaboxes?
- How to change lost password email text using custom plugin wordpress?
- WooCommerce subscriptions give option of manual renewal on checkout [closed]
- How to hide / remove duplicated Woocommerce products from Shop page
- How to add product variations for large number of products in WooCommerce?
- Change order status after checkout
- Is it safe to update an old site after backing it up and activating a child theme?
- How to add coupon expiry date into the followup emails?
- Disable Woocommerce main shop page, but not the product category archive pages
- access Woo commerce | WordPress methods externally
- How to store ACF from product in user_meta?
- Changing second user role while updating/downgrading membership level – s2member [closed]
- Woocommerce set single city to sell to
- Trying to link to a custom css file in a new folder
- How to edit schema.org markup of WooCommerce?
- How do I make a diagonal strikethrough on wordpress? [closed]
- Woocommerce – Remove ‘Buy Product’ Button from shop page [closed]
- Add woocommerce.css in template?
- How to change redirect code? [duplicate]
- How to dublicate WC Product title to shortdescription field? [closed]
- Add Additional 3 buttons next to “Add to cart” button in woocommerce product page
- Use a woocommerce hook to create a table and populate it with a query
- Woocommerce product and category in url [closed]
- Display product categories + child-categories on a single product page