st_types_disable['template'])) {
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-template.php'));
}
if (! isset($post_types_disable['client'])) {
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-client.php'));
}
if (! isset($post_types_disable['offer'])) {
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-offer.php'));
}
if (! isset($post_types_disable['portfolio'])) {
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-portfolio.php'));
}
if (! isset($post_types_disable['slide'])) {
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-slide.php'));
}
if (! isset($post_types_disable['testimonial'])) {
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-testimonial.php'));
}
if (! isset($post_types_disable['layout'])) {
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-layout.php'));
}
if(function_exists('is_woocommerce')){
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-product.php'));
}
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-page.php'));
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-post.php'));
// includes
require_once(get_theme_file_path('/includes/content-post.php'));
require_once(get_theme_file_path('/includes/content-portfolio.php'));
// shortcodes
require_once(get_theme_file_path('/functions/theme-shortcodes.php'));
// hooks
require_once(get_theme_file_path('/functions/theme-hooks.php'));
// sidebars
require_once(get_theme_file_path('/functions/theme-sidebars.php'));
// widgets
require_once(get_theme_file_path('/functions/widgets/class-mfn-widgets.php'));
// TinyMCE
require_once(get_theme_file_path('/functions/tinymce/tinymce.php'));
// plugins
require_once(get_theme_file_path('/functions/class-mfn-love.php'));
require_once(get_theme_file_path('/functions/plugins/visual-composer.php'));
require_once(get_theme_file_path('/functions/plugins/elementor/class-mfn-elementor.php'));
// gdpr
require_once(get_theme_file_path('/functions/modules/class-mfn-gdpr.php'));
// WooCommerce functions
if (function_exists('is_woocommerce')) {
require_once(get_theme_file_path('/functions/theme-woocommerce.php'));
}
// dashboard
if ( is_admin() || apply_filters('is_bebuilder_demo', false) ) {
$bebuilder_access = apply_filters('bebuilder_access', false);
require_once(get_theme_file_path('/functions/admin/class-mfn-helper.php'));
require_once(get_theme_file_path('/functions/admin/class-mfn-update.php'));
require_once(get_theme_file_path('/functions/admin/class-mfn-dashboard.php'));
$mfn_dashboard = new Mfn_Dashboard();
require_once(get_theme_file_path('/functions/importer/class-mfn-importer-helper.php'));
require_once(get_theme_file_path('/functions/admin/setup/class-mfn-setup.php'));
require_once(get_theme_file_path('/functions/importer/class-mfn-importer.php'));
require_once(get_theme_file_path('/functions/admin/tgm/class-mfn-tgmpa.php'));
require_once(get_theme_file_path('/functions/admin/class-mfn-plugins.php'));
require_once(get_theme_file_path('/functions/admin/class-mfn-status.php'));
require_once(get_theme_file_path('/functions/admin/class-mfn-support.php'));
require_once(get_theme_file_path('/functions/admin/class-mfn-changelog.php'));
require_once(get_theme_file_path('/functions/admin/class-mfn-tools.php'));
if( $bebuilder_access ){
require_once(get_theme_file_path('/visual-builder/visual-builder.php'));
}
}
/**
* @deprecated 21.0.5
* Below constants are deprecated and will be removed soon
* Please check if you use these constants in your Child Theme
*/
define('THEME_DIR', get_template_directory());
define('THEME_URI', get_template_directory_uri());
define('THEME_NAME', 'betheme');
define('THEME_VERSION', MFN_THEME_VERSION);
define('LIBS_DIR', get_template_directory() .'/functions');
define('LIBS_URI', get_template_directory() .'/functions');
//Hide Price Range for WooCommerce Variable Products
add_filter( 'woocommerce_variable_sale_price_html',
'lw_variable_product_price', 10, 2 );
add_filter( 'woocommerce_variable_price_html',
'lw_variable_product_price', 10, 2 );
function lw_variable_product_price( $v_price, $v_product ) {
// Product Price
$prod_prices = array( $v_product->get_variation_price( 'min', true ),
$v_product->get_variation_price( 'max', true ) );
$prod_price = $prod_prices[0]!==$prod_prices[1] ? sprintf(__(' %1$s', 'woocommerce'),
wc_price( $prod_prices[0] ) ) : wc_price( $prod_prices[0] );
// Regular Price
$regular_prices = array( $v_product->get_variation_regular_price( 'min', true ),
$v_product->get_variation_regular_price( 'max', true ) );
sort( $regular_prices );
$regular_price = $regular_prices[0]!==$regular_prices[1] ? sprintf(__(' %1$s','woocommerce')
, wc_price( $regular_prices[0] ) ) : wc_price( $regular_prices[0] );
if ( $prod_price !== $regular_price ) {
$prod_price = ''.$regular_price.$v_product->get_price_suffix() . ' ' .
$prod_price . $v_product->get_price_suffix() . '';
}
return $prod_price;
}
add_filter('posts_clauses', 'sin_stock_al_final_woocommerce');
function sin_stock_al_final_woocommerce($posts_clauses) {
global $wpdb;
// Solo cambiar la consulta en los bucles de WooCommerce
if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy())) {
$posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
$posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
$posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
}
return $posts_clauses;
}
/**
* Change a currency symbol
*/
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'USD': $currency_symbol = 'U$D'; break;
}
return $currency_symbol;
}
XML-RPC server accepts POST requests only.