Hi @chengjianping,
You know that the Product Filter is a complete widget; there is no option to delete or split any individual controller.
I appreciate your understanding.
Kind Regards
Which one should I use for price filtering and product filtering? The price selection is the same as this template. I can choose these two settings separately.
How should I enter this code for the sharing function so that no additional plug-ins are required? url:https://imgur.com/a/jB8muUm
Hi@chengjianping,
You can add social share buttons to a single product page with the following code snippet. This example includes links for 4 social platforms, and you can add more as needed. To ensure the changes persist through theme updates, add this code to your child theme’s functions.php file or use a code snippet plugin.
add_action('woocommerce_share', 'custom_woocommerce_share_buttons', 45);
function custom_woocommerce_share_buttons() {
global $product;
$product_url = get_permalink($product->get_id());
$product_title = get_the_title($product->get_id());
$share_text = 'Check out this product: ';
?>
<div class="custom-share-buttons">
<h3>Share this product</h3>
<a href="https://www.facebook.com/sharer.php?u=<?php echo urlencode($product_url); ?>" target="_blank">Share on Facebook | </a>
<a href="https://twitter.com/share?url=<?php echo urlencode($product_url); ?>&text=<?php echo urlencode($share_text . $product_title); ?>" target="_blank">Share on Twitter |</a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode($product_url); ?>&title=<?php echo urlencode($product_title); ?>" target="_blank">Share on LinkedIn |</a>
<a href="mailto:?subject=<?php echo urlencode($product_title); ?>&body=<?php echo urlencode($share_text . $product_url); ?>">Share via Email</a>
</div>
<?php
}
This code snippet will add social share buttons on single product pages [screenshot]. Customize the social share links and icons as needed.
Regards
Can I share it on TikTok platform? How should I do this?
Hi,
TikTok doesn’t have a dedicated URL sharing scheme like Facebook or Twitter. Since TikTok is a video-sharing platform, you can add the link manually to the above code if you find a TikTok URL. If you’re unable to edit the code, please consider installing a social share plugin.
Regards