running WooCommerce When on the website, merchants may encounter some interface issues such as unnecessary borders around the cart icon. Meanwhile, the WooCommerce shopping cart snippet of the Ajax Requests, while capable of dynamically updating shopping cart content, may affect page load speed on low-profile hosts. In this article, we'll provide you with a guide to removing thecartDetailed steps for borders and disabling cart snippets help optimize site performance, improve loading speeds, and ensure a smoother user experience.
![图片[1]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414224300473-image.png)
Remove Cart Border
Astra Customization options are provided to adjust the style of the shopping cart icon. If you find a border around the cart icon, you can remove the border by following these steps:
![图片[2]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414162843429-image.png)
- Go to Customize Settings: from WordPress Dashboard, enter Appearance > CustomizationThe
- Open the header builder: In the Customization panel, click Header builderThe
![图片[3]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414162903177-image.png)
- Select Shopping Cart Options: In the header builder, click cart Elements.
![图片[4]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414162910449-image.png)
- Go to the Design tab: Under the Design tab, find the Border radius option, set it to 0, or use the slider to manually enter a value.
![图片[5]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414162918103-image.png)
This removes the cart icon's border and restores the page's clean design.
Disable WooCommerce Shopping Cart Snippet
WooCommerce The shopping cart clip is Ajax request for dynamically displaying the contents of the shopping cart. When a user adds items to the cart and clicks on the cart icon, the page displays the items in the cart. These requests may cause the page to take longer to load if the host is slow.
![图片[6]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414163056194-image.png)
Why are shopping cart snippets disabled?
WooCommerce The shopping cart snippet feature is enabled by default to dynamically update the cart content, but on low profile hosts, using this feature may increase page load time. Disabling this feature can improve site loading speed.
Disable WooCommerce Shopping Cart Snippet
Follow the steps below to disable the WooCommerce shopping cart snippet script:
- Go to WooCommerce Settings: from WordPress Dashboard, enter WooCommerce > SettingsClick offeringsThe
- prohibit the use of sth. Ajax Add to cart button: Unchecked Enable Ajax Add to Cart button on product archive pageThe
![图片[7]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414163113588-image.png)
- Enable shopping cart page redirection: Check the box Jump to the shopping cart page after adding successfullyThe
![图片[8]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414163119453-image.png)
This can help bypass installed cache plugins.
- removes JavaScript: To disable the shopping cart snippet completely, add the following code snippet to the child theme's functions.php Documentation.
![图片[9]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414163132494-image.png)
go into Appearance > Theme File Editor, click on the subtopic's functions.php file and paste the following code at the bottom of the file:
/** Disable Ajax calls for WooCommerce */
function sert_dequeue_woocommerce_cart_fragments() {
wp_dequeue_script('wc-cart-fragments'); }
}
add_action( 'wp_enqueue_scripts', 'sert_dequeue_woocommerce_cart_fragments', PHP_INT_MAX);
![图片[10]-如何移除购物车边框并禁用 WooCommerce 购物车片段提升网站加载速度](https://www.361sale.com/wp-content/uploads/2025/04/20250414163141282-image.png)
This code will unload the WooCommerce Shopping cart snippet scripts that will boost your site's loading speed.
summarize
By adjusting the settings, you can easily remove the cart icon's border and disable the WooCommerce Shopping cart snippet functionality. Disabling cart snippets is especially useful for sites with slower hosts to help improve overall loading speed and performance.
Related articles
Link to this article:https://www.361sale.com/en/50101/The article is copyrighted and must be reproduced with attribution.


















![表情[wozuimei]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![表情[baoquan]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments