AdventureTours
1 month ago
Aurum
1 month ago
FacebookForWc
1 month ago
Flatsome
1 month ago
GravityForms
1 month ago
KlarnaPayments
1 month ago
MaxStorePro
1 month ago
PerProductShipping
1 month ago
Relevanssi
1 month ago
Sensei
1 month ago
TableRateShipping
1 month ago
TheEventsCalendar
1 month ago
TmExtraProductOptions
1 month ago
WcAjaxLayeredNav
1 month ago
WcBookings
1 month ago
WcBulkStockManagement
1 month ago
WcCheckoutAddons
1 month ago
WcCheckoutFieldEditor
1 month ago
WcCompositeProducts
1 month ago
WcDynamicPricing
1 month ago
WcExporter
1 month ago
WcMemberships
1 month ago
WcMixAndMatch
1 month ago
WcNameYourPrice
1 month ago
WcOrderStatusManager
1 month ago
WcPip
1 month ago
WcProductAddons
1 month ago
WcProductBundles
1 month ago
WcProductTypeColumn
1 month ago
WcShowSingleVariations
1 month ago
WcSubscriptions
1 month ago
WcSwatches
1 month ago
WcTabManager
1 month ago
WooVariationsTable
1 month ago
WoobeBulkEditor
1 month ago
WoofWcProductFilter
1 month ago
WpBakery
1 month ago
WpFastestCache
1 month ago
WpSeo
1 month ago
WpSuperCache
1 month ago
YikesCustomProductTabs
1 month ago
YithWcQuickView
1 month ago
res
1 year ago
ComponentFactory.php
1 month ago
class-wcml-compatibility-helper.php
4 years ago
class-wcml-compatibility-helper.php
20 lines
| 1 | <?php |
| 2 | |
| 3 | class WCML_Compatibility_Helper { |
| 4 | |
| 5 | public static function get_product_type( $product_id ) { |
| 6 | |
| 7 | if ( $terms = wp_get_object_terms( $product_id, 'product_type' ) ) { |
| 8 | $product_type = sanitize_title( current( $terms )->name ); |
| 9 | } else { |
| 10 | $product_type = apply_filters( 'default_product_type', 'simple' ); |
| 11 | } |
| 12 | |
| 13 | return $product_type; |
| 14 | |
| 15 | } |
| 16 | |
| 17 | } |
| 18 | |
| 19 | |
| 20 |