Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/feature
File: woocommerce-modules.php
$breadcrumb_separator = str_replace( '”', '', $breadcrumb_separator );
[500] Fix | Delete
[501] Fix | Delete
woocommerce_breadcrumb( array(
[502] Fix | Delete
'delimiter' => ' ' . $breadcrumb_separator . ' ',
[503] Fix | Delete
'home' => et_()->array_get( $args, 'breadcrumb_home_text', '' ),
[504] Fix | Delete
) );
[505] Fix | Delete
break;
[506] Fix | Delete
case 'woocommerce_show_product_images':
[507] Fix | Delete
// WC Images module needs to modify global variable's property. Thus it is performed
[508] Fix | Delete
// here instead at module's class since the $product global might be modified
[509] Fix | Delete
$gallery_ids = $product->get_gallery_image_ids();
[510] Fix | Delete
$image_id = $product->get_image_id();
[511] Fix | Delete
$show_image = 'on' === $args['show_product_image'];
[512] Fix | Delete
$show_gallery = 'on' === $args['show_product_gallery'];
[513] Fix | Delete
$show_sale_badge = 'on' === $args['show_sale_badge'];
[514] Fix | Delete
[515] Fix | Delete
// If featured image is disabled, replace it with first gallery image's id (if gallery
[516] Fix | Delete
// is enabled) or replaced it with empty string (if gallery is disabled as well)
[517] Fix | Delete
if ( ! $show_image ) {
[518] Fix | Delete
if ( $show_gallery && isset( $gallery_ids[0] ) ) {
[519] Fix | Delete
$product->set_image_id( $gallery_ids[0] );
[520] Fix | Delete
[521] Fix | Delete
// Remove first image from the gallery because it'll be added as thumbnail and will be duplicated.
[522] Fix | Delete
unset( $gallery_ids[0] );
[523] Fix | Delete
$product->set_gallery_image_ids( $gallery_ids );
[524] Fix | Delete
} else {
[525] Fix | Delete
$product->set_image_id( '' );
[526] Fix | Delete
}
[527] Fix | Delete
}
[528] Fix | Delete
[529] Fix | Delete
// Replaced gallery image ids with empty array
[530] Fix | Delete
if ( ! $show_gallery ) {
[531] Fix | Delete
$product->set_gallery_image_ids( array() );
[532] Fix | Delete
}
[533] Fix | Delete
[534] Fix | Delete
if ( $show_sale_badge && function_exists( 'woocommerce_show_product_sale_flash' ) ) {
[535] Fix | Delete
woocommerce_show_product_sale_flash();
[536] Fix | Delete
}
[537] Fix | Delete
[538] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[539] Fix | Delete
call_user_func( $function_name );
[540] Fix | Delete
[541] Fix | Delete
// Reset product's actual featured image id
[542] Fix | Delete
if ( ! $show_image ) {
[543] Fix | Delete
$product->set_image_id( $image_id );
[544] Fix | Delete
}
[545] Fix | Delete
[546] Fix | Delete
// Reset product's actual gallery image id
[547] Fix | Delete
if ( ! $show_gallery ) {
[548] Fix | Delete
$product->set_gallery_image_ids( $gallery_ids );
[549] Fix | Delete
}
[550] Fix | Delete
[551] Fix | Delete
break;
[552] Fix | Delete
case 'wc_get_stock_html':
[553] Fix | Delete
echo wc_get_stock_html( $product );
[554] Fix | Delete
break;
[555] Fix | Delete
case 'wc_print_notice':
[556] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[557] Fix | Delete
call_user_func( $function_name, wc_add_to_cart_message( $product->get_id(), false, true ) );
[558] Fix | Delete
break;
[559] Fix | Delete
case 'wc_print_notices':
[560] Fix | Delete
// Save existing notices to restore them as many times as we need.
[561] Fix | Delete
$et_wc_cached_notices = WC()->session->get( 'wc_notices', array() );
[562] Fix | Delete
[563] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[564] Fix | Delete
call_user_func( $function_name );
[565] Fix | Delete
[566] Fix | Delete
// Restore notices which were removed after wc_print_notices() executed to render multiple modules on page.
[567] Fix | Delete
if ( ! empty( $et_wc_cached_notices ) && empty( WC()->session->get( 'wc_notices', array() ) ) ) {
[568] Fix | Delete
WC()->session->set( 'wc_notices', $et_wc_cached_notices );
[569] Fix | Delete
}
[570] Fix | Delete
break;
[571] Fix | Delete
case 'woocommerce_upsell_display':
[572] Fix | Delete
$order = isset( $args['order'] ) ? $args['order'] : '';
[573] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[574] Fix | Delete
call_user_func( $function_name, '', '', '', $order );
[575] Fix | Delete
break;
[576] Fix | Delete
default:
[577] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[578] Fix | Delete
call_user_func( $function_name );
[579] Fix | Delete
}
[580] Fix | Delete
[581] Fix | Delete
$output = ob_get_clean();
[582] Fix | Delete
[583] Fix | Delete
// Reset original product variable to global $product
[584] Fix | Delete
if ( $is_tb ) {
[585] Fix | Delete
et_theme_builder_wc_reset_global_objects();
[586] Fix | Delete
} else if ( $overwrite_global ) {
[587] Fix | Delete
// Reset $product global
[588] Fix | Delete
if ( $overwrite_product ) {
[589] Fix | Delete
$product = $original_product;
[590] Fix | Delete
}
[591] Fix | Delete
[592] Fix | Delete
// Reset post
[593] Fix | Delete
if ( $overwrite_post ) {
[594] Fix | Delete
$post = $original_post;
[595] Fix | Delete
}
[596] Fix | Delete
[597] Fix | Delete
// Reset wp_query
[598] Fix | Delete
if ( $overwrite_wp_query ) {
[599] Fix | Delete
$wp_query = $original_wp_query;
[600] Fix | Delete
}
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
return $output;
[604] Fix | Delete
}
[605] Fix | Delete
[606] Fix | Delete
/**
[607] Fix | Delete
* Renders the content.
[608] Fix | Delete
*
[609] Fix | Delete
* Rendering the content will enable Divi Builder to take over the entire
[610] Fix | Delete
* post content area.
[611] Fix | Delete
*
[612] Fix | Delete
* @since 3.29
[613] Fix | Delete
*/
[614] Fix | Delete
function et_builder_wc_product_render_layout() {
[615] Fix | Delete
do_action( 'et_builder_wc_product_before_render_layout' );
[616] Fix | Delete
[617] Fix | Delete
the_content();
[618] Fix | Delete
[619] Fix | Delete
do_action( 'et_builder_wc_product_after_render_layout' );
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
/**
[623] Fix | Delete
* Force WooCommerce to load default template over theme's custom template when builder's
[624] Fix | Delete
* et_builder_from_scratch is used to prevent unexpected custom layout which makes builder
[625] Fix | Delete
* experience inconsistent
[626] Fix | Delete
*
[627] Fix | Delete
* @since 3.29
[628] Fix | Delete
*
[629] Fix | Delete
* @param string $template
[630] Fix | Delete
* @param string $slug
[631] Fix | Delete
* @param string $name
[632] Fix | Delete
*
[633] Fix | Delete
* @return string
[634] Fix | Delete
*/
[635] Fix | Delete
function et_builder_wc_override_template_part( $template, $slug, $name ) {
[636] Fix | Delete
// Only force load default `content-single-product.php` template
[637] Fix | Delete
$is_content_single_product = 'content' === $slug && 'single-product' === $name;
[638] Fix | Delete
[639] Fix | Delete
return $is_content_single_product ? WC()->plugin_path() . "/templates/{$slug}-{$name}.php" : $template;
[640] Fix | Delete
}
[641] Fix | Delete
[642] Fix | Delete
/**
[643] Fix | Delete
* Disable all default WooCommerce single layout hooks.
[644] Fix | Delete
*
[645] Fix | Delete
* @since 4.0.10
[646] Fix | Delete
*/
[647] Fix | Delete
function et_builder_wc_disable_default_layout() {
[648] Fix | Delete
// To remove a hook, the $function_to_remove and $priority arguments must match
[649] Fix | Delete
// with which the hook was added.
[650] Fix | Delete
remove_action(
[651] Fix | Delete
'woocommerce_before_main_content',
[652] Fix | Delete
'woocommerce_breadcrumb',
[653] Fix | Delete
20
[654] Fix | Delete
);
[655] Fix | Delete
[656] Fix | Delete
remove_action(
[657] Fix | Delete
'woocommerce_before_single_product_summary',
[658] Fix | Delete
'woocommerce_show_product_sale_flash',
[659] Fix | Delete
10
[660] Fix | Delete
);
[661] Fix | Delete
remove_action(
[662] Fix | Delete
'woocommerce_before_single_product_summary',
[663] Fix | Delete
'woocommerce_show_product_images',
[664] Fix | Delete
20
[665] Fix | Delete
);
[666] Fix | Delete
remove_action(
[667] Fix | Delete
'woocommerce_single_product_summary',
[668] Fix | Delete
'woocommerce_template_single_title',
[669] Fix | Delete
5
[670] Fix | Delete
);
[671] Fix | Delete
remove_action(
[672] Fix | Delete
'woocommerce_single_product_summary',
[673] Fix | Delete
'woocommerce_template_single_rating',
[674] Fix | Delete
10
[675] Fix | Delete
);
[676] Fix | Delete
remove_action(
[677] Fix | Delete
'woocommerce_single_product_summary',
[678] Fix | Delete
'woocommerce_template_single_price',
[679] Fix | Delete
10
[680] Fix | Delete
);
[681] Fix | Delete
remove_action(
[682] Fix | Delete
'woocommerce_single_product_summary',
[683] Fix | Delete
'woocommerce_template_single_excerpt',
[684] Fix | Delete
20
[685] Fix | Delete
);
[686] Fix | Delete
remove_action(
[687] Fix | Delete
'woocommerce_single_product_summary',
[688] Fix | Delete
'woocommerce_template_single_add_to_cart',
[689] Fix | Delete
30
[690] Fix | Delete
);
[691] Fix | Delete
remove_action(
[692] Fix | Delete
'woocommerce_single_product_summary',
[693] Fix | Delete
'woocommerce_template_single_meta',
[694] Fix | Delete
40
[695] Fix | Delete
);
[696] Fix | Delete
remove_action(
[697] Fix | Delete
'woocommerce_single_product_summary',
[698] Fix | Delete
'woocommerce_template_single_sharing',
[699] Fix | Delete
50
[700] Fix | Delete
);
[701] Fix | Delete
remove_action(
[702] Fix | Delete
'woocommerce_after_single_product_summary',
[703] Fix | Delete
'woocommerce_output_product_data_tabs',
[704] Fix | Delete
10
[705] Fix | Delete
);
[706] Fix | Delete
remove_action(
[707] Fix | Delete
'woocommerce_after_single_product_summary',
[708] Fix | Delete
'woocommerce_upsell_display',
[709] Fix | Delete
15
[710] Fix | Delete
);
[711] Fix | Delete
remove_action(
[712] Fix | Delete
'woocommerce_after_single_product_summary',
[713] Fix | Delete
'woocommerce_output_related_products',
[714] Fix | Delete
20
[715] Fix | Delete
);
[716] Fix | Delete
}
[717] Fix | Delete
[718] Fix | Delete
/**
[719] Fix | Delete
* Overrides the default WooCommerce layout.
[720] Fix | Delete
*
[721] Fix | Delete
* @see woocommerce/includes/wc-template-functions.php
[722] Fix | Delete
*
[723] Fix | Delete
* @since 3.29
[724] Fix | Delete
*/
[725] Fix | Delete
function et_builder_wc_override_default_layout() {
[726] Fix | Delete
if ( ! is_singular( 'product' ) ) {
[727] Fix | Delete
return;
[728] Fix | Delete
}
[729] Fix | Delete
[730] Fix | Delete
// global $post won't be available with `after_setup_theme` hook and hence `wp` hook is used.
[731] Fix | Delete
global $post;
[732] Fix | Delete
[733] Fix | Delete
if ( ! et_pb_is_pagebuilder_used( $post->ID ) ) {
[734] Fix | Delete
return;
[735] Fix | Delete
}
[736] Fix | Delete
[737] Fix | Delete
$product_page_layout = et_builder_wc_get_product_layout( $post->ID );
[738] Fix | Delete
$is_product_content_modified = 'modified' === get_post_meta( $post->ID, ET_BUILDER_WC_PRODUCT_PAGE_CONTENT_STATUS_META_KEY, true );
[739] Fix | Delete
$is_preview_loading = is_preview();
[740] Fix | Delete
[741] Fix | Delete
// BFB was enabled but page content wasn't saved yet. Load default layout on FE.
[742] Fix | Delete
if ( 'et_build_from_scratch' === $product_page_layout && ! $is_product_content_modified && ! $is_preview_loading ) {
[743] Fix | Delete
return;
[744] Fix | Delete
}
[745] Fix | Delete
[746] Fix | Delete
/*
[747] Fix | Delete
* The `has_shortcode()` check does not work here. Hence solving the need using `strpos()`.
[748] Fix | Delete
*
[749] Fix | Delete
* The WHY behind the check is explained in the following issue.
[750] Fix | Delete
* @see https://github.com/elegantthemes/Divi/issues/16155
[751] Fix | Delete
*/
[752] Fix | Delete
if ( ! $product_page_layout && ! et_core_is_fb_enabled()
[753] Fix | Delete
|| ( $product_page_layout && 'et_build_from_scratch' !== $product_page_layout )
[754] Fix | Delete
) {
[755] Fix | Delete
return;
[756] Fix | Delete
}
[757] Fix | Delete
[758] Fix | Delete
// Force use WooCommerce's default template if current theme is not Divi or Extra (handling
[759] Fix | Delete
// possible custom template on DBP / Child Theme)
[760] Fix | Delete
if ( ! in_array( wp_get_theme()->get( 'Name' ), array( 'Divi', 'Extra' ) ) ) {
[761] Fix | Delete
add_filter( 'wc_get_template_part', 'et_builder_wc_override_template_part', 10, 3 );
[762] Fix | Delete
}
[763] Fix | Delete
[764] Fix | Delete
et_builder_wc_disable_default_layout();
[765] Fix | Delete
[766] Fix | Delete
do_action( 'et_builder_wc_product_before_render_layout_registration' );
[767] Fix | Delete
[768] Fix | Delete
// Add render content on product page
[769] Fix | Delete
add_action( 'woocommerce_after_single_product_summary', 'et_builder_wc_product_render_layout', 5 );
[770] Fix | Delete
}
[771] Fix | Delete
[772] Fix | Delete
/**
[773] Fix | Delete
* Skips setting default content on Product post type during Builder activation.
[774] Fix | Delete
*
[775] Fix | Delete
* Otherwise, the description would be shown in both Product Tabs and at the end of the
[776] Fix | Delete
* default WooCommerce layout set at
[777] Fix | Delete
* @see et_builder_wc_get_initial_content()
[778] Fix | Delete
*
[779] Fix | Delete
* @since 3.29
[780] Fix | Delete
*
[781] Fix | Delete
* @param bool $flag
[782] Fix | Delete
* @param WP_Post $post
[783] Fix | Delete
*
[784] Fix | Delete
* @return bool
[785] Fix | Delete
*/
[786] Fix | Delete
function et_builder_wc_skip_initial_content( $flag, $post ) {
[787] Fix | Delete
if ( ! ( $post instanceof WP_Post ) ) {
[788] Fix | Delete
return $flag;
[789] Fix | Delete
}
[790] Fix | Delete
[791] Fix | Delete
if ( 'product' !== $post->post_type ) {
[792] Fix | Delete
return $flag;
[793] Fix | Delete
}
[794] Fix | Delete
[795] Fix | Delete
return true;
[796] Fix | Delete
}
[797] Fix | Delete
[798] Fix | Delete
/**
[799] Fix | Delete
* Determine whether given content has WooCommerce module inside it or not
[800] Fix | Delete
*
[801] Fix | Delete
* @since 4.0 Added ET_Builder_Element class exists check.
[802] Fix | Delete
* @since 3.29
[803] Fix | Delete
*
[804] Fix | Delete
* @param string $content
[805] Fix | Delete
*
[806] Fix | Delete
* @return bool
[807] Fix | Delete
*/
[808] Fix | Delete
function et_builder_has_woocommerce_module( $content = '' ) {
[809] Fix | Delete
if ( ! class_exists( 'ET_Builder_Element' ) ) {
[810] Fix | Delete
return false;
[811] Fix | Delete
}
[812] Fix | Delete
[813] Fix | Delete
$has_woocommerce_module = false;
[814] Fix | Delete
$woocommerce_modules = ET_Builder_Element::get_woocommerce_modules();
[815] Fix | Delete
[816] Fix | Delete
foreach ( $woocommerce_modules as $module ) {
[817] Fix | Delete
if ( has_shortcode( $content, $module ) ) {
[818] Fix | Delete
$has_woocommerce_module = true;
[819] Fix | Delete
[820] Fix | Delete
// Stop the loop once any shortcode is found
[821] Fix | Delete
break;
[822] Fix | Delete
}
[823] Fix | Delete
}
[824] Fix | Delete
[825] Fix | Delete
return apply_filters( 'et_builder_has_woocommerce_module', $has_woocommerce_module );
[826] Fix | Delete
}
[827] Fix | Delete
[828] Fix | Delete
/**
[829] Fix | Delete
* Check if current global $post uses builder / layout block, not `product` CPT, and contains
[830] Fix | Delete
* WooCommerce module inside it. This check is needed because WooCommerce by default only adds
[831] Fix | Delete
* scripts and style to `product` CPT while WooCommerce Modules can be used at any CPT
[832] Fix | Delete
*
[833] Fix | Delete
* @since 3.29
[834] Fix | Delete
* @since 4.1.0 check if layout block is used instead of builder
[835] Fix | Delete
*
[836] Fix | Delete
* @since bool
[837] Fix | Delete
*/
[838] Fix | Delete
function et_builder_wc_is_non_product_post_type() {
[839] Fix | Delete
global $post;
[840] Fix | Delete
[841] Fix | Delete
if ( $post && 'product' === $post->post_type ) {
[842] Fix | Delete
return false;
[843] Fix | Delete
}
[844] Fix | Delete
[845] Fix | Delete
$types = et_theme_builder_get_layout_post_types();
[846] Fix | Delete
$layouts = et_theme_builder_get_template_layouts();
[847] Fix | Delete
[848] Fix | Delete
foreach ( $types as $type ) {
[849] Fix | Delete
if ( ! isset( $layouts[ $type ] ) ) {
[850] Fix | Delete
continue;
[851] Fix | Delete
}
[852] Fix | Delete
[853] Fix | Delete
if ( $layouts[ $type ]['override'] && et_builder_has_woocommerce_module( get_post_field( 'post_content', $layouts[ $type ]['id'] ) ) ) {
[854] Fix | Delete
return true;
[855] Fix | Delete
}
[856] Fix | Delete
}
[857] Fix | Delete
[858] Fix | Delete
// If no post found, bail early
[859] Fix | Delete
if ( ! $post ) {
[860] Fix | Delete
return false;
[861] Fix | Delete
}
[862] Fix | Delete
[863] Fix | Delete
$is_builder_used = et_pb_is_pagebuilder_used( $post->ID );
[864] Fix | Delete
$is_layout_block_used = has_block( 'divi/layout', $post->post_content );
[865] Fix | Delete
[866] Fix | Delete
// If no builder or layout block used, bail early
[867] Fix | Delete
if ( ! $is_builder_used && ! $is_layout_block_used ) {
[868] Fix | Delete
return false;
[869] Fix | Delete
}
[870] Fix | Delete
[871] Fix | Delete
$has_wc_module = et_builder_has_woocommerce_module( $post->post_content );
[872] Fix | Delete
[873] Fix | Delete
if ( ( $is_builder_used || $is_layout_block_used ) && $has_wc_module ) {
[874] Fix | Delete
return true;
[875] Fix | Delete
}
[876] Fix | Delete
[877] Fix | Delete
return false;
[878] Fix | Delete
}
[879] Fix | Delete
[880] Fix | Delete
/**
[881] Fix | Delete
* Load WooCommerce related scripts. This function basically redo what `WC_Frontend_Scripts::load_scripts()`
[882] Fix | Delete
* does without the `product` CPT limitation.
[883] Fix | Delete
*
[884] Fix | Delete
* @todo Once more WooCommerce Modules are added (checkout, account, etc), revisit this method and
[885] Fix | Delete
* compare it against `WC_Frontend_Scripts::load_scripts()`. Some of the script queues are
[886] Fix | Delete
* removed here because there is currently no WooCommerce module equivalent of them
[887] Fix | Delete
*
[888] Fix | Delete
* @since 3.29
[889] Fix | Delete
*
[890] Fix | Delete
* @since 4.3.3 Loads WC scripts on Shop, Product Category & Product Tags archives.
[891] Fix | Delete
*/
[892] Fix | Delete
function et_builder_wc_load_scripts() {
[893] Fix | Delete
global $post;
[894] Fix | Delete
[895] Fix | Delete
$is_shop = function_exists( 'is_shop' ) && is_shop();
[896] Fix | Delete
[897] Fix | Delete
// is_product_taxonomy() is not returning TRUE for Category & Tags.
[898] Fix | Delete
// Hence we check Category & Tag archives individually.
[899] Fix | Delete
$is_product_category = function_exists( 'is_product_category' ) && is_product_category();
[900] Fix | Delete
$is_product_tag = function_exists( 'is_product_tag' ) && is_product_tag();
[901] Fix | Delete
[902] Fix | Delete
// If current page is not non-`product` CPT which using builder, stop early
[903] Fix | Delete
if ( ( ! et_builder_wc_is_non_product_post_type()
[904] Fix | Delete
|| ! class_exists( 'WC_Frontend_Scripts' ) )
[905] Fix | Delete
&& function_exists( 'et_fb_enabled' )
[906] Fix | Delete
&& ! et_fb_enabled()
[907] Fix | Delete
&& ! $is_shop
[908] Fix | Delete
&& ! $is_product_category
[909] Fix | Delete
&& ! $is_product_tag
[910] Fix | Delete
) {
[911] Fix | Delete
return;
[912] Fix | Delete
}
[913] Fix | Delete
[914] Fix | Delete
// Simply enqueue the scripts; All of them have been registered
[915] Fix | Delete
if ( 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' ) ) {
[916] Fix | Delete
wp_enqueue_script( 'wc-add-to-cart' );
[917] Fix | Delete
}
[918] Fix | Delete
[919] Fix | Delete
if ( current_theme_supports( 'wc-product-gallery-zoom' ) ) {
[920] Fix | Delete
wp_enqueue_script( 'zoom' );
[921] Fix | Delete
}
[922] Fix | Delete
if ( current_theme_supports( 'wc-product-gallery-slider' ) ) {
[923] Fix | Delete
wp_enqueue_script( 'flexslider' );
[924] Fix | Delete
}
[925] Fix | Delete
if ( current_theme_supports( 'wc-product-gallery-lightbox' ) ) {
[926] Fix | Delete
wp_enqueue_script( 'photoswipe-ui-default' );
[927] Fix | Delete
wp_enqueue_style( 'photoswipe-default-skin' );
[928] Fix | Delete
[929] Fix | Delete
add_action( 'wp_footer', 'woocommerce_photoswipe' );
[930] Fix | Delete
}
[931] Fix | Delete
wp_enqueue_script( 'wc-single-product' );
[932] Fix | Delete
[933] Fix | Delete
if ( 'geolocation_ajax' === get_option( 'woocommerce_default_customer_address' ) ) {
[934] Fix | Delete
$ua = strtolower( wc_get_user_agent() ); // Exclude common bots from geolocation by user agent.
[935] Fix | Delete
[936] Fix | Delete
if ( ! strstr( $ua, 'bot' ) && ! strstr( $ua, 'spider' ) && ! strstr( $ua, 'crawl' ) ) {
[937] Fix | Delete
wp_enqueue_script( 'wc-geolocation' );
[938] Fix | Delete
}
[939] Fix | Delete
}
[940] Fix | Delete
[941] Fix | Delete
wp_enqueue_script( 'woocommerce' );
[942] Fix | Delete
wp_enqueue_script( 'wc-cart-fragments' );
[943] Fix | Delete
[944] Fix | Delete
// Enqueue style
[945] Fix | Delete
$wc_styles = WC_Frontend_Scripts::get_styles();
[946] Fix | Delete
[947] Fix | Delete
foreach ( $wc_styles as $style_handle => $wc_style ) {
[948] Fix | Delete
if ( ! isset( $wc_style['has_rtl'] ) ) {
[949] Fix | Delete
$wc_style['has_rtl'] = false;
[950] Fix | Delete
}
[951] Fix | Delete
[952] Fix | Delete
wp_enqueue_style( $style_handle, $wc_style['src'], $wc_style['deps'], $wc_style['version'], $wc_style['media'], $wc_style['has_rtl'] );
[953] Fix | Delete
}
[954] Fix | Delete
}
[955] Fix | Delete
[956] Fix | Delete
/**
[957] Fix | Delete
* Add WooCommerce body class name on non `product` CPT builder page
[958] Fix | Delete
*
[959] Fix | Delete
* @since 3.29
[960] Fix | Delete
*
[961] Fix | Delete
* @return array
[962] Fix | Delete
*/
[963] Fix | Delete
function et_builder_wc_add_body_class( $classes ) {
[964] Fix | Delete
if ( et_builder_wc_is_non_product_post_type() ) {
[965] Fix | Delete
$classes[] = 'woocommerce';
[966] Fix | Delete
$classes[] = 'woocommerce-page';
[967] Fix | Delete
}
[968] Fix | Delete
[969] Fix | Delete
return $classes;
[970] Fix | Delete
}
[971] Fix | Delete
[972] Fix | Delete
/**
[973] Fix | Delete
* Add product class name on inner content wrapper page on non `product` CPT builder page with woocommerce modules
[974] Fix | Delete
* And on Product posts
[975] Fix | Delete
*
[976] Fix | Delete
* @since 3.29
[977] Fix | Delete
*
[978] Fix | Delete
* @return array
[979] Fix | Delete
*/
[980] Fix | Delete
function et_builder_wc_add_inner_content_class( $classes ) {
[981] Fix | Delete
// The class is required on any post with woocommerce modules and on product pages.
[982] Fix | Delete
if ( et_builder_wc_is_non_product_post_type() || is_product() ) {
[983] Fix | Delete
$classes[] = 'product';
[984] Fix | Delete
}
[985] Fix | Delete
[986] Fix | Delete
return $classes;
[987] Fix | Delete
}
[988] Fix | Delete
[989] Fix | Delete
/**
[990] Fix | Delete
* Add WooCommerce class names on Divi Shop Page (not WooCommerce Shop).
[991] Fix | Delete
*
[992] Fix | Delete
* @since 4.0.7
[993] Fix | Delete
*
[994] Fix | Delete
* @param array $classes Array of Classes.
[995] Fix | Delete
*
[996] Fix | Delete
* @return array
[997] Fix | Delete
*/
[998] Fix | Delete
function et_builder_wc_add_outer_content_class( $classes ) {
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function