Customize Square product names during sync

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 top

With 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 top

Sync 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.

Related Products

WooCommerce Subscriptions is a WooCommerce extension that lets customers subscribe to your products or...

Offer Royal Mail shipping rates to your customers.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.