Remove WooCommerce Mapped Content Elements

⌘K
  1. Home
  2. Docs
  3. Developers “How To&...
  4. Remove WooCommerce Mapped Content Elements

Remove WooCommerce Mapped Content Elements

WooCommerce content elements “mapped” into WPBakery Page Builder interface using a different technique, we call it “Vendor scripts”. As a result different approach should be used in order to remove them from available content elements list.

Remove WooCommerce from “Add Element” List

<?php
function your_name_vc_remove_woocommerce() {
  if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
  vc_remove_element( 'woocommerce_cart' );
  vc_remove_element( 'woocommerce_checkout' );
  vc_remove_element( 'woocommerce_order_tracking' );
  // Add other elements that should be removed here
  }
}
// Hook for admin editor.
add_action( 'vc_build_admin_page', 'your_name_vc_remove_woocommerce', 11 );
// Hook for frontend editor.
add_action( 'vc_load_shortcode', 'your_name_vc_remove_woocommerce', 11 );

 

Was this article helpful to you? No Yes

How can we help?