PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 1.6.4
Kubio AI Page Builder v1.6.4
2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / integrations / woocommerce-basic / woocommerce-basic.php
kubio / lib / integrations / woocommerce-basic Last commit date
block-editor-settings.php 4 years ago sidebar.php 4 years ago templates-filters.php 3 years ago utils.php 4 years ago woocommerce-basic.php 4 years ago
woocommerce-basic.php
80 lines
1 <?php
2
3 use IlluminateAgnostic\Arr\Support\Arr;
4
5 require_once __DIR__ . '/utils.php';
6 require_once __DIR__ . '/sidebar.php';
7
8 function kubio_enqueue_woocommerce_style() {
9
10 wp_enqueue_style(
11 'kubio-woocommerce',
12 kubio_url( 'build/woocommerce-styles/style.css' ),
13 array( 'woocommerce-general' ),
14 KUBIO_VERSION
15 );
16 }
17
18 function kubio_woocommerce_support_editor_assets() {
19 wp_enqueue_style( 'kubio-woocommerce-styles' );
20 wp_enqueue_script( 'kubio-woocommerce-styles' );
21 }
22
23
24 function kubio_add_woocommerce_support() {
25
26 if ( ! class_exists( 'WooCommerce' ) ) {
27 return;
28 }
29
30 if ( kubio_has_kubio_woocommerce_support() ) {
31 add_action( 'wp_enqueue_scripts', 'kubio_enqueue_woocommerce_style' );
32 add_action( 'kubio/editor/enqueue_assets', 'kubio_woocommerce_support_editor_assets' );
33
34 require_once __DIR__ . '/block-editor-settings.php';
35 require_once __DIR__ . '/templates-filters.php';
36
37 if ( kubio_is_hybdrid_theme_iframe_preview() ) {
38 add_filter( 'woocommerce_checkout_redirect_empty_cart', '__return_false' );
39 }
40 }
41 }
42
43
44 function kubio_woocommerce_products_page_edit( $args ) {
45 if ( function_exists( 'is_shop' ) && is_shop() && wc_get_page_id( 'shop' ) ) {
46 $args = array(
47 'postId' => wc_get_page_id( 'shop' ),
48 'postType' => 'page',
49 );
50 }
51
52 return $args;
53 }
54
55
56 function kubio_add_woocommerce_global_style_types( $types ) {
57 $style_types = json_decode( file_get_contents( KUBIO_BUILD_DIR . '/woocommerce-styles/style-types.json' ), true );
58
59 $global_style_root_path = 'definitions.globalStyle';
60 $styles_enum = array_merge(
61 Arr::get( $types, "{$global_style_root_path}.elementsEnum", array() ),
62 Arr::get( $style_types, 'elementsEnum', array() )
63 );
64
65 $styles_by_name = array_merge(
66 Arr::get( $types, "{$global_style_root_path}.elementsByName", array() ),
67 Arr::get( $style_types, 'elementsByName', array() )
68 );
69
70 Arr::set( $types, "{$global_style_root_path}.elementsEnum", $styles_enum );
71 Arr::set( $types, "{$global_style_root_path}.elementsByName", $styles_by_name );
72
73 return $types;
74 }
75
76 add_action( 'init', 'kubio_add_woocommerce_support' );
77
78 add_filter( 'kubio/frontend/edit-in-kubio-args', 'kubio_woocommerce_products_page_edit' );
79 add_filter( 'kubio/style-types', 'kubio_add_woocommerce_global_style_types' );
80