ThemeHigh
  • Plugins
  • Documentation
  • Support
  • Partners
  • Login
  • Getting Started
    • Overview...
    • Add/Edit Custom Fields
    • Set Display Rules
    • Set Repeat Rules
    • Price Fields & Types
    • User Meta Fields
    • Time Picker Settings
    • Why Your Checkout Fields Aren’...
    • Date Picker Settings
    • Display Custom Fields...
  • Advanced Settings
    • Include New Fields in Address Format?
    • Enable Address Autofill
    • Configure Locale Override Settings
    • Add Custom Fields to CSV Export
    • Display Custom Fields In PDF Invoices & Packing Slips
    • Zapier Support
    • Display Country & State Fields based on Conditional Rules
    • WPML Compatibility
    • Where do the Custom Fields get Saved or Displayed?
    • Backup & Import Settings
    • Enable Inline Validation...
    • WPML String Translations...
    • Custom Fields in WooCommerce Orders
    • Add a New Custom Validation Rule
    • Add a New Confirm Field Validator
    • Import/Export the Checkout Fields and Sections
  • For Developers
    • Hooks & References...
    • Display Rules: Use cases and mor...
    • Repeat Rules: More use cases and...
    • Based on Checkout Fields: Use ca...
    • Override HTML Content: Examples...
    • Compatibility with “WooCom...
  • Compatible Plugin & Themes
    • Plugins & Themes...
  • Frequently Asked Questions
    • Frequently Asked Questions...
  • How
    • How To Display Fields In Order D...
    • How To Customise The Shipping Se...
    • How To Add Custom Fields In The ...
    • How to Add Custom Price Fields o...
    • How To Add A New Section To The ...
    • How To Display Custom Fields In ...
    • How to Show/Hide Fields Based On...
    • How To Set Repeat Rules On The C...

Documentation/Checkout Field Editor for WooCommerce/Compatibility with “WooCommerce Chained Products” Plugin

Compatibility with “WooCommerce Chained Products” Plugin

Last updated on October 17, 2022

To get compatibility with “WooCommerce Chained Products” plugin use the below code snippet.

https://woocommerce.com/ products/chained-products/

 
add_filter('thwepo_product_price', 'thwepo45r_product_price', 3, 99);
function thwepo45r_product_price($price, $product, $is_default){
	$product_id = $product->get_id();
	global $wc_chained_products;
	$prices = array();
	$prices[$product_id] = $product->get_price();
	$chained_items  = $wc_chained_products->get_all_chained_product_details($product_id);
	if ( ! empty( $chained_items ) ) {
		foreach ( $chained_items as $chained_item_id => $chained_item_data ) {
			$chained_product     = wc_get_product( $chained_item_id );
			$priced_individually = ( ! empty( $chained_item_data['priced_individually'] ) ) ? $chained_item_data['priced_individually'] : 'no';
			if ( $chained_product instanceof WC_Product && 'yes' === $priced_individually ) {
				$chained_product_price = $chained_product->get_price();
				if ( ! empty( $chained_product_price ) ) {
					$prices[$chained_item_id] = $chained_product_price  * $chained_item_data['unit'];
				}
				$override_price = true;
			}
		}
	}
	if(!empty($prices)){
		$price = array_sum( $prices );
	}
	return $price;
}
add_filter('thwepo_skip_extra_options_for_cart_item', 'thwepo36t_skip_extra_options', 4, 99);
function thwepo36t_skip_extra_options($skip, $cart_item_data, $product_id, $variation_id){
	$skip = (isset($cart_item_data['chained_item_of'])) ? true : false;
	return $skip;
}
 

This article posted in Checkout Field Editor for WooCommerce, For Developers, Pro Documentation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

ThemeHigh

We develop innovative WordPress plugins and themes for e-commerce and other WordPress websites.

Resources
  • Documentation
  • Support
  • Blog
  • Bestsellers
  • Affiliates
  • Partners
Policy Information
  • Terms & Conditions
  • Privacy Policy
  • Support Policy
  • Refunds Policy
  • Licenses
Security
Payment Options

© 2026 ThemeHigh. All rights reserved.

Terms and conditions, features, support, pricing, and service options subject to change without notice.