Use this filter to customize product names received from Square when an existing WooCommerce product is updated.
Note:
This is a Developer level doc. If you are unfamiliar working with code and resolving potential conflicts, we recommend you work with a Woo Agency Partner for larger projects, or find a WooCommerce developer on Codeable for smaller customizations. We are unable to provide support for customizations under our Support Policy.
Add the filter
↑ Back to topWith Square selected as the Sync Setting, add this example to a custom plugin on a staging site. It appends “ – Online” to the name received from Square.
<?php
add_filter(
'wc_square_update_product_set_name',
function ( $name ) {
return $name . ' - Online';
}
);
Verify the result
↑ Back to topSync a linked test product from Square and check its name in WooCommerce. Remove the filter and sync again to stop applying the suffix. Changes can affect existing product names, so test before deploying.