This commit is contained in:
nguyen dung
2022-02-18 16:43:41 +07:00
commit 39b8cb3612
4470 changed files with 1378320 additions and 0 deletions

View File

@@ -0,0 +1,218 @@
<?php
// CART
Flatsome_Option::add_section( 'cart-checkout', array(
'title' => __( 'Cart', 'flatsome-admin' ),
'panel' => 'woocommerce',
'priority' => 1000
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'cart_layout',
'label' => __( 'Cart layout', 'flatsome-admin' ),
'section' => 'cart-checkout',
'default' => '',
'choices' => array(
'' => __( 'Default', 'flatsome-admin' ),
'simple' => __( 'Simple', 'flatsome-admin' ),
'focused' => __( 'Focused', 'flatsome-admin' ),
),
));
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'cart_sticky_sidebar',
'label' => __( 'Sticky sidebar', 'flatsome-admin' ),
'section' => 'cart-checkout',
'default' => 0
));
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'cart_auto_refresh',
'label' => __( 'Auto update on quantity change', 'flatsome-admin' ),
'section' => 'cart-checkout',
'default' => 0,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'cart_boxed_shipping_labels',
'label' => __( 'Boxed Shipping labels', 'flatsome' ),
'section' => 'cart-checkout',
'default' => 0
));
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'cart_estimate_text',
'label' => __( 'Show shipping estimate destination', 'flatsome' ),
'section' => 'cart-checkout',
'default' => 1
));
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'cart_steps_title',
'label' => '',
'section' => 'cart-checkout',
'default' => '<div class="options-title-divider">Steps</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'cart_steps_size',
'label' => __( 'Steps size', 'flatsome-admin' ),
'section' => 'cart-checkout',
'default' => 'h2',
'choices' => array(
'h2' => __( 'Default', 'flatsome-admin' ),
'h3' => __( 'Small', 'flatsome-admin' ),
'h4' => __( 'Smaller', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'cart_steps_case',
'label' => esc_attr__( 'Steps letter case', 'flatsome-admin' ),
'section' => 'cart-checkout',
'default' => 'uppercase',
'choices' => array(
'uppercase' => 'UPPERCASE',
'none' => 'Normal',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'cart_steps_numbers',
'label' => __( 'Step numbers', 'flatsome-admin' ),
'section' => 'cart-checkout',
'default' => 0,
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'html_cart_title',
'label' => '',
'section' => 'cart-checkout',
'default' => '<div class="options-title-divider">Custom Content</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'html_cart_sidebar',
'transport' => $transport,
'label' => __( 'Cart Sidebar content', 'flatsome-admin' ),
'help' => __( 'Enter HTML that will show on bottom of cart sidebar' ),
'section' => 'cart-checkout',
'default' => '',
));
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'html_cart_footer',
'transport' => $transport,
'label' => __( 'After Cart content', 'flatsome-admin' ),
'help' => __( 'Enter HTML or Shortcodes that will show after cart here.' ),
'section' => 'cart-checkout',
'default' => '',
));
// CHECKOUT
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'checkout_layout',
'priority' => 1,
'label' => __( 'Checkout layout', 'flatsome-admin' ),
'section' => 'woocommerce_checkout',
'default' => '',
'choices' => array(
'' => __( 'Default', 'flatsome-admin' ),
'simple' => __( 'Simple', 'flatsome-admin' ),
'focused' => __( 'Focused', 'flatsome-admin' ),
),
));
if ( is_nextend_facebook_login() || is_nextend_google_login() ) {
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'facebook_login_checkout',
'label' => __( 'Social Login Buttons', 'flatsome-admin' ),
'section' => 'woocommerce_checkout',
'default' => 0
));
}
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'checkout_terms_and_conditions',
'label' => __( 'Terms and conditions link style', 'flatsome-admin' ),
'section' => 'woocommerce_checkout',
'default' => '',
'choices' => array(
'' => __( 'Default', 'flatsome-admin' ),
'tab' => __( 'New Tab', 'flatsome-admin' ),
'lightbox' => __( 'Lightbox', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'terms_and_conditions_lightbox_buttons',
'transport' => $transport,
'label' => __( 'Terms and conditions "Agree" button', 'flatsome-admin' ),
'section' => 'woocommerce_checkout',
'default' => 1,
'active_callback' => array(
array(
'setting' => 'checkout_terms_and_conditions',
'operator' => '==',
'value' => 'lightbox',
),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'checkout_floating_labels',
'label' => __( 'Floating field labels', 'flatsome-admin' ),
'section' => 'woocommerce_checkout',
'default' => 0
));
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'checkout_fields_email_first',
'label' => __( 'Move E-mail field to first position', 'flatsome-admin' ),
'section' => 'woocommerce_checkout',
'default' => 0
));
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'checkout_sticky_sidebar',
'label' => __( 'Sticky sidebar', 'flatsome-admin' ),
'section' => 'woocommerce_checkout',
'default' => 0
));
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'html_checkout_sidebar',
'transport' => $transport,
'label' => __( 'Checkout Sidebar content', 'flatsome-admin' ),
'help' => __( 'Enter HTML that will show on bottom of checkout sidebar' ),
'section' => 'woocommerce_checkout',
'default' => '',
));

View File

@@ -0,0 +1,53 @@
<?php
Flatsome_Option::add_section( 'catalog-mode', array(
'title' => __( 'Catalog Mode', 'flatsome-admin' ),
'panel' => 'woocommerce',
'description' => __( 'Enable Catalog Mode', 'flatsome-admin' ),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'catalog_mode',
'label' => __( 'Enable Catalogue Mode.', 'flatsome-admin' ),
'section' => 'catalog-mode',
'default' => 0,
));
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'catalog_mode_prices',
'label' => __( 'Disable Prices', 'flatsome-admin' ),
'description' => 'Select to disable prices on category pages and product page.',
'section' => 'catalog-mode',
'default' => 0,
));
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'catalog_mode_header',
'transport' => $transport,
'label' => __( 'Header Cart replacement', 'flatsome-admin' ),
'help' => __( "Enter content you want to display instad of Account / Cart. Shortcodes are allowed.", 'flatsome-admin'),
'section' => 'catalog-mode',
'default' => '',
));
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'catalog_mode_product',
'transport' => $transport,
'label' => __( 'Product page Add to cart replacement.', 'flatsome-admin' ),
'help' => __( 'Enter contact information or enquery form shortcode here.', 'flatsome-admin'),
'section' => 'catalog-mode',
'default' => 'Add any HTML or Shortcode here...',
));
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'catalog_mode_lightbox',
'transport' => $transport,
'label' => __( 'Add to cart replacement - Product Quick View', 'flatsome-admin' ),
'help' => __( 'Enter text that will show in product quick view', 'flatsome-admin'),
'section' => 'catalog-mode',
'default' => '',
));

View File

@@ -0,0 +1,794 @@
<?php
Flatsome_Option::add_section( 'woocommerce_product_catalog', array(
'title' => __( 'Product Catalog', 'woocommerce' ),
'panel' => 'woocommerce',
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_category_homepage',
'label' => __( '', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '<div class="options-title-divider">Shop Page</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'html_shop_page',
'label' => __( 'Shop Page Header', 'flatsome-admin' ),
'description' => __( 'Enter HTML that should be placed on top of main shop page. Shortcodes are allowed. This will replace Shop Homepage Header', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'html_shop_page_content',
'label' => __( 'Shop Page Content', 'flatsome-admin' ),
'description' => __( 'Enter HTML/Shortcodes that should replace Shop Homepage content.', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '',
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_category_layout',
'label' => __( '', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '<div class="options-title-divider">Catalog Layout</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'category_sidebar',
'label' => __( 'Layout', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 'left-sidebar',
'choices' => array(
'none' => $image_url . 'category-no-sidebar.svg',
'left-sidebar' => $image_url . 'category-left-sidebar.svg',
'right-sidebar' => $image_url . 'category-right-sidebar.svg',
'off-canvas' => $image_url . 'category-off-canvas.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'category_sticky_sidebar',
'label' => __( 'Sticky sidebar', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'category_sidebar',
'operator' => '!==',
'value' => 'none',
),
array(
'setting' => 'category_sidebar',
'operator' => '!==',
'value' => 'off-canvas',
),
),
'default' => 0,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'category_grid_style',
'label' => __( 'List Style', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 'grid',
'choices' => array(
'grid' => $image_url . 'category-style-grid.svg',
'list' => $image_url . 'category-style-list.svg',
'masonry' => $image_url . 'category-style-masonry.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'category_force_image_height',
// 'transport' => $transport,
'label' => __( 'EQUAL IMAGE HEIGHTS', 'flatsome-admin' ),
'description' => 'Force all images to have the same height',
'section' => 'woocommerce_product_catalog',
'default' => false,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'category_image_height',
'label' => __( 'Equal Image height', 'flatsome-admin' ),
'description' => 'Change the image height in %. (100% = 1:1)',
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'category_force_image_height',
'operator' => '==',
'value' => true,
),
),
'transport' => $transport,
'default' => 100,
'choices' => array(
'min' => 50,
'max' => 200,
'step' => 1,
),
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_html_woocommerce_image_shortcut_category',
'label' => __( '', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '<button style="margin-top: 15px; margin-bottom:15px" class="button button-primary" data-to-section="woocommerce_product_images">Thumbnail Image Settings →</button>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'text',
'settings' => 'products_pr_page',
'transport' => $transport,
'label' => __( 'Products per Page', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 12,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'category_row_count',
'transport' => $transport,
'label' => __( 'Products per row - Desktop', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 3,
'choices' => array(
'min' => 1,
'max' => 6,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'category_row_count_tablet',
'label' => __( 'Products per row - Tablet', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 3,
'choices' => array(
'min' => 1,
'max' => 4,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'category_row_count_mobile',
'label' => __( 'Products per row - Mobile', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 2,
'choices' => array(
'min' => 1,
'max' => 3,
'step' => 1,
),
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_category_header',
'label' => __( '', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '<div class="options-title-divider">Header</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'category_title_style',
'label' => __( 'Title Style', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => '',
'choices' => array(
'' => $image_url . 'category-title.svg',
'featured' => $image_url . 'category-title-featured.svg',
'featured-center' => $image_url . 'category-title-featured-center.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'category_show_title',
'transport' => $transport,
'label' => __( 'Show title', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '0',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'breadcrumb_home',
'transport' => $transport,
'label' => __( 'Show home link in breadcrumb', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => function () {
$wpseo = class_exists( 'WPSEO_Options' ) && get_theme_mod( 'wpseo_breadcrumb' ) ? true : false;
$rank_math = class_exists( 'RankMath' ) && get_theme_mod( 'rank_math_breadcrumb' ) ? true : false;
return ! $wpseo && ! $rank_math;
},
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'category_header_transparent',
'label' => __( 'Transparent Header', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '0',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'header_shop_bg_featured',
'transport' => $transport,
'help' => __( 'Use Featured Images from categories and products as background. Will fallback to default Shop Title background if nothing is set.', 'flatsome-admin' ),
'label' => __( 'Featured Image as Background', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'image',
'settings' => 'header_shop_bg_image',
'transport' => $transport,
'label' => __( 'Shop Title Background', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'color-alpha',
'alpha' => true,
'settings' => 'header_shop_bg_color',
'transport' => $transport,
'label' => __( 'Title Background Color', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 'rgba(0,0,0,.3)',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'text',
'settings' => 'category_filter_text',
'transport' => $transport,
'label' => __( 'Custom Filter Text', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '',
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_category_breadcrumbs',
'label' => __( '', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '<div class="options-title-divider">Breadcrumbs</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'breadcrumb_size',
'label' => __( 'Breadcrumb Size', 'flatsome-admin' ),
'help' => __( 'Change size of breadcrumb on product categories. Useful if you have long breadcrumbs.', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 'large',
'choices' => $sizes,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'breadcrumb_case',
'label' => esc_attr__( 'Breadcrumbs Case', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 'uppercase',
'choices' => array(
'uppercase' => 'UPPERCASE',
'' => 'Normal',
),
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_category_category_box',
'label' => __( '', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '<div class="options-title-divider">Category Box</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'cat_style',
'label' => __( 'Category Box Style', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 'badge',
'choices' => array(
'normal' => $image_url . 'category-box.svg',
'badge' => $image_url . 'category-box-badge.svg',
'overlay' => $image_url . 'category-box-overlay.svg',
'label' => $image_url . 'category-box-label.svg',
'shade' => $image_url . 'category-box-shade.svg',
'bounce' => $image_url . 'category-box-bounce.svg',
'push' => $image_url . 'category-box-push.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'category_show_count',
'transport' => $transport,
'label' => __( 'Show product count', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 1,
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_category_product_box',
'label' => __( '', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '<div class="options-title-divider">Product Box</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'grid_style',
'label' => __( 'Grid Style', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 'grid1',
'choices' => array(
'grid1' => $image_url . 'product-box.svg',
'grid2' => $image_url . 'product-box-center.svg',
'grid3' => $image_url . 'product-box-wide.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'product_hover',
'transport' => $transport,
'label' => __( 'Product Image Hover style', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 'fade_in_back',
'choices' => array(
'none' => __( 'None', 'flatsome-admin' ),
'fade_in_back' => __( 'Back Image - Fade In', 'flatsome-admin' ),
'zoom_in' => __( 'Back Image - Zoom In', 'flatsome-admin' ),
'zoom' => 'Zoom',
'zoom-fade' => 'Zoom Fade',
'blur' => 'Blur',
'fade-in' => 'Fade In',
'fade-out' => 'Fade Out',
'glow' => 'Glow',
'color' => 'Add Color',
'grayscale' => 'Grayscale',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'category_shadow',
'label' => __( 'Drop Shadow', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 0,
'choices' => array(
'min' => 0,
'max' => 5,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'category_shadow_hover',
'label' => __( 'Drop Shadow :hover', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 0,
'choices' => array(
'min' => 0,
'max' => 5,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'add_to_cart_icon',
'label' => __( 'Add To Cart Button', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 'disable',
'choices' => array(
'disable' => $image_url . 'product-box.svg',
'show' => $image_url . 'product-box-add-to-cart-icon.svg',
'button' => $image_url . 'product-box-add-to-cart-button.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'add_to_cart_style',
'label' => __( 'Button Style', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 'outline',
'choices' => array(
'flat' => __( 'Plain', 'flatsome-admin' ),
'outline' => __( 'Outline', 'flatsome-admin' ),
'underline' => __( 'Underline', 'flatsome-admin' ),
'shade' => __( 'Shade', 'flatsome-admin' ),
'bevel' => __( 'Bevel', 'flatsome-admin' ),
'gloss' => __( 'Gloss', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_box_category',
'transport' => $transport,
'label' => __( 'Show Category', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_box_rating',
'transport' => $transport,
'label' => __( 'Show Ratings', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'short_description_in_grid',
'transport' => $transport,
'label' => __( 'Show Short Description', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '0',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'disable_quick_view',
'transport' => $transport,
'label' => __( 'Disable Quick View', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => 0,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'equalize_product_box',
'transport' => $transport,
'label' => esc_attr__( 'Equalize Items', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '0',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'bubble_style',
'label' => __( 'Bubble Style', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 'style1',
'choices' => array(
'style1' => $image_url . 'badge-circle.svg',
'style2' => $image_url . 'badge-square.svg',
'style3' => $image_url . 'badge-border.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'text',
'settings' => 'sale_bubble_text',
'transport' => $transport,
'label' => __( 'Custom Sale Bubble Text', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'sanitize_callback' => 'wp_kses_post',
'default' => '',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'sale_bubble_percentage',
'label' => __( 'Enable % instead of "Sale!"', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '0',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'text',
'settings' => 'sale_bubble_percentage_formatting',
'transport' => $transport,
'label' => __( 'Sale Bubble % Formatting', 'flatsome-admin' ),
'description' => __( 'How the discount should be displayed. e.g. -{value}%', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'sanitize_callback' => 'wp_kses_post',
'active_callback' => array(
array(
'setting' => 'sale_bubble_percentage',
'operator' => '==',
'value' => true,
),
),
'default' => '-{value}%',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'number',
'settings' => 'new_bubble_auto',
'label' => __( 'Auto "New" bubble', 'flatsome-admin' ),
'description' => __( 'Shown on products witch age is x and lower in days.', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'default' => 0,
'choices' => array(
'min' => 0,
'step' => 1,
),
) );
if ( get_theme_mod( 'swatches' ) ) :
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_category_swatches',
'label' => '',
'section' => 'woocommerce_product_catalog',
'default' => '<div class="options-title-divider">Swatches</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'swatches_box_attribute',
'label' => __( 'Product attribute', 'flatsome-admin' ),
'tooltip' => __( 'The product (variation) atrribute that swatches will be populated for (usually an attribute that determines colors).', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'default' => '',
'choices' => flatsome_get_product_attribute_taxonomies_list_by_id( array( 'option_none' => '-- None --' ) ),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'swatches_box_layout',
'label' => __( 'Layout', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => '',
'choices' => array(
'' => 'Normal',
'limit' => 'Limited',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'swatches_box_limit',
'label' => __( 'Limit', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
array(
'setting' => 'swatches_box_layout',
'operator' => '===',
'value' => 'limit',
),
),
'default' => 5,
'choices' => array(
'min' => 1,
'max' => 30,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'swatches_box_size',
'label' => __( 'Size', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => '',
'choices' => array(
'x-small' => 'X Small',
'small' => 'Small',
'' => 'Medium',
'large' => 'Large',
'x-large' => 'X Large',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'swatches_box_shape',
'label' => __( 'Shape', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'transport' => $transport,
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => '',
'choices' => array(
'' => 'Square',
'rounded' => 'Rounded',
'circle' => 'Circle',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'swatches_box_select_event',
'label' => __( 'Select event - Desktop', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => '',
'choices' => array(
'' => 'On hover',
'click' => 'On click',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'color',
'settings' => 'swatches_box_color_selected',
'transport' => 'postMessage',
'label' => __( 'Color :selected', 'flatsome' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => Flatsome_Default::COLOR_SECONDARY,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'swatches_box_behavior_selected',
'label' => __( 'Behavior :selected', 'flatsome-admin' ),
'description' => __( 'When clicking an already selected swatch.', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => '',
'choices' => array(
'' => 'Go to product page',
'unselect' => 'Unselect swatch',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'swatches_box_update_urls',
'label' => __( 'Update links to selected variation', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'swatches_box_reset',
'label' => __( 'Auto reset selection', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
),
'default' => 0,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'swatches_box_reset_extent',
'label' => __( 'Reset extent', 'flatsome-admin' ),
'description' => __( 'The area the pointer should leave for a reset.', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
array(
'setting' => 'swatches_box_reset',
'operator' => '!=',
'value' => 0,
),
),
'default' => '',
'choices' => array(
'' => __( 'Swatch', 'flatsome-admin' ),
'product-box' => __( 'Product box', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'swatches_box_reset_time',
'label' => __( 'Reset time', 'flatsome-admin' ),
'description' => __( 'In milliseconds (1000ms = 1sec).', 'flatsome-admin' ),
'section' => 'woocommerce_product_catalog',
'active_callback' => array(
array(
'setting' => 'swatches_box_attribute',
'operator' => '!=',
'value' => '',
),
array(
'setting' => 'swatches_box_reset',
'operator' => '!=',
'value' => 0,
),
),
'default' => 300,
'choices' => array(
'min' => 100,
'max' => 10000,
'step' => 100,
),
) );
endif;

View File

@@ -0,0 +1,97 @@
<?php
global $wc;
Flatsome_Option::add_section( 'fl-my-account', array(
'title' => __( 'My Account', 'flatsome-admin' ),
'description' => 'Note: Register form/link is only visible for non logged in users and the WooCommerce setting, "Allow customers to create an account on the "My account" page" is enabled.',
'panel' => 'woocommerce',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'color-alpha',
'alpha' => true,
'settings' => 'my_account_title_bg_color',
'label' => __( 'Title Background Color', 'flatsome-admin' ),
'section' => 'fl-my-account',
'default' => '',
'transport' => $transport,
));
Flatsome_Option::add_field( 'option', array(
'type' => 'image',
'settings' => 'facebook_login_bg',
'label' => __( 'Title Background Image', 'flatsome-admin' ),
'section' => 'fl-my-account',
'transport' => $transport,
'default' => ''
));
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'my_account_title_align',
'label' => __( 'Title Align', 'flatsome-admin' ),
'description' => __( 'For logged in users only.', 'flatsome-admin' ),
'section' => 'fl-my-account',
'default' => 'left',
'transport' => $transport,
'choices' => array(
'left' => $image_url . 'align-left.svg',
'center' => $image_url . 'align-center.svg',
'right' => $image_url . 'align-right.svg',
),
));
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'my_account_title_text_color',
'label' => __( 'Text color', 'flatsome-admin' ),
'section' => 'fl-my-account',
'default' => 'dark',
'transport' => $transport,
'choices' => array(
'light' => $image_url . 'text-light.svg',
'dark' => $image_url . 'text-dark.svg',
),
));
Flatsome_Option::add_field( 'option', array(
'type' => 'text',
'settings' => 'facebook_login_text',
'transport' => $transport,
'label' => __( 'Login Text', 'flatsome-admin' ),
'description' => __( '', 'flatsome-admin' ),
'section' => 'fl-my-account',
'sanitize_callback' => 'flatsome_custom_sanitize',
));
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'social_login_pos',
'label' => __( 'Social Button', 'flatsome-admin' ),
'description' => __( 'Change position of Social Login Buttons in lightbox.', 'flatsome-admin' ),
'section' => 'fl-my-account',
'default' => 'top',
'choices' => array(
'top' => __( 'Top', 'flatsome-admin' ),
'bottom' => __( 'Bottom', 'flatsome-admin' ),
),
));
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'wc_account_links',
'label' => __( 'Enable default WooCommerce Account links in Dropdown and Account Sidebar. You can create a custom my account menu instead if you want.', 'flatsome-admin' ),
'section' => 'fl-my-account',
'default' => 1,
));
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_html_header_account_shortcut',
'label' => __( '', 'flatsome-admin' ),
'section' => 'fl-my-account',
'default' => '<button style="margin-top:30px; margin-bottom:15px" class="button button-primary" data-to-section="header_account">Header Element →</button>',
) );

View File

@@ -0,0 +1,41 @@
<?php
Flatsome_Option::add_section( 'payment-icons', array(
'title' => __( 'Payments Icons', 'flatsome-admin' ),
'description' => 'Note: This is not where you select payment methods. These are graphical icons that show which payment methods your shop supports. You can add these anywhere by using the shortcode [ux_payment_icons]',
'panel' => 'woocommerce',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'sortable',
'settings' => 'payment_icons',
'label' => __( 'Payment Icons', 'flatsome-admin' ),
'section' => 'payment-icons',
'transport' => $transport,
'multiple' => 99,
'default' => array( 'visa', 'paypal', 'stripe', 'mastercard', 'cashondelivery' ),
'choices' => flatsome_get_payment_icons_list(),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'image',
'settings' => 'payment_icons_custom',
'label' => __( 'Custom Icons (Replace)', 'flatsome-admin' ),
'section' => 'payment-icons',
'default' => '',
'transport' => $transport,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'multicheck',
'settings' => 'payment_icons_placement',
'label' => __( 'Placement', 'flatsome-admin' ),
'description' => __( 'Select where you want to show the payment icons', 'flatsome-admin' ),
'section' => 'payment-icons',
'default' => '',
'choices' => array(
'footer' => __( 'Absolute Footer', 'flatsome-admin' ),
'cart' => __( 'Cart Sidebar', 'flatsome-admin' ),
),
) );

View File

@@ -0,0 +1,544 @@
<?php
Flatsome_Option::add_section( 'product-page', array(
'title' => __( 'Product Page', 'flatsome-admin' ),
'panel' => 'woocommerce',
) );
function flatsome_customizer_shop_product_page_options() {
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_product_layout',
'label' => __( '', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '<div class="options-title-divider">Layout</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'product_layout',
'label' => __( 'Product Layout', 'flatsome-admin' ),
'section' => 'product-page',
'default' => flatsome_product_layout(),
'choices' => array(
'no-sidebar' => flatsome_customizer_images_uri() . '/layout-no-sidebar.svg',
'left-sidebar' => flatsome_customizer_images_uri() . '/layout-left.svg',
'left-sidebar-full' => flatsome_customizer_images_uri() . '/layout-left-full.svg',
'left-sidebar-small' => flatsome_customizer_images_uri() . '/layout-left-small.svg',
'right-sidebar' => flatsome_customizer_images_uri() . '/layout-right.svg',
'right-sidebar-small' => flatsome_customizer_images_uri() . '/layout-right-small.svg',
'right-sidebar-full' => flatsome_customizer_images_uri() . '/layout-right-full.svg',
'gallery-wide' => flatsome_customizer_images_uri() . '/layout-wide-gallery.svg',
'stacked-right' => flatsome_customizer_images_uri() . '/product-stacked.svg',
'custom' => flatsome_customizer_images_uri() . '/layout-custom.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'product_custom_layout',
'label' => __( 'Custom product layout', 'flatsome' ),
'description' => __( 'Create a custom product layout by using the UX Builder. You need to select a Block and then open it in the UX Builder from a product page in the front-end.', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => array(
array(
'setting' => 'product_layout',
'operator' => '==',
'value' => 'custom',
),
),
'default' => false,
'choices' => flatsome_customizer_blocks(),
) );
$hide_on_gallery_wide = array(
'setting' => 'product_layout',
'operator' => '!==',
'value' => 'gallery-wide',
);
$hide_on_custom_product = array(
'setting' => 'product_layout',
'operator' => '!==',
'value' => 'custom',
);
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_offcanvas_sidebar',
'label' => __( 'Off-canvas Sidebar for Mobile', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 0,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'product_header',
'label' => __( 'Product Header', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '',
'active_callback' => array(
$hide_on_gallery_wide,
$hide_on_custom_product,
),
'choices' => array(
'' => flatsome_customizer_images_uri() . '/product-title.svg',
'top' => flatsome_customizer_images_uri() . '/product-title-top.svg',
'featured' => flatsome_customizer_images_uri() . '/product-title-featured.svg',
'featured-center' => flatsome_customizer_images_uri() . '/product-title-featured-center.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_header_transparent',
'label' => __( 'Transparent Header', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 0,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_next_prev_nav',
'active_callback' => array(
$hide_on_gallery_wide,
$hide_on_custom_product,
),
'label' => __( 'Next / Prev Navigation', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 1,
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_product_gallery',
'label' => __( '', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '<div class="options-title-divider">Gallery</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'product_image_width',
'label' => __( 'Product Image Width', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => function () {
return ! get_theme_mod( 'product_gallery_woocommerce' )
&& get_theme_mod( 'product_layout' ) !== 'gallery-wide'
&& get_theme_mod( 'product_layout' ) !== 'custom';
},
'transport' => 'postMessage',
'default' => '6',
'choices' => array(
'8' => __( '8/12', 'flatsome-admin' ),
'7' => __( '7/12', 'flatsome-admin' ),
'6' => __( '6/12 (50%)', 'flatsome-admin' ),
'5' => __( '5/12', 'flatsome-admin' ),
'4' => __( '4/12', 'flatsome-admin' ),
'3' => __( '3/12', 'flatsome-admin' ),
'2' => __( '2/12', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'product_image_style',
'label' => __( 'Product Image Style', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => function () {
return ! get_theme_mod( 'product_gallery_woocommerce' )
&& get_theme_mod( 'product_layout' ) !== 'gallery-wide'
&& get_theme_mod( 'product_layout' ) !== 'custom'
&& get_theme_mod( 'product_layout' ) !== 'stacked-right';
},
'default' => 'normal',
'choices' => array(
'normal' => flatsome_customizer_images_uri() . '/product-gallery.svg',
'vertical' => flatsome_customizer_images_uri() . '/product-gallery-vertical.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'product_lightbox',
'active_callback' => function() {
return ! get_theme_mod( 'product_gallery_woocommerce' );
},
'label' => __( 'Product Image Lightbox', 'flatsome-admin' ),
'description' => __( 'Show images in a lightbox when clicking on image in gallery. You might need to save and close Customizer for this to work properly.', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 'default',
'choices' => array(
'default' => __( 'New WooCommerce 3.0 Lightbox', 'flatsome-admin' ),
'flatsome' => __( 'Flatsome Lightbox', 'flatsome-admin' ),
'woocommerce' => __( 'Old WooCommerce Lightbox', 'flatsome-admin' ),
'disabled' => __( 'Disable Lightbox', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_zoom',
'active_callback' => function () {
return ! get_theme_mod( 'product_gallery_woocommerce' )
&& get_theme_mod( 'product_layout' ) !== 'gallery-wide';
},
'label' => __( 'Product Image Hover Zoom', 'flatsome-admin' ),
'description' => __( 'Show a zoomed version of image when hovering gallery', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 0,
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_html_woocommerce_image_shortcut_product',
'label' => __( '', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '<button style="margin-top: 15px; margin-bottom:15px" class="button button-primary" data-to-section="woocommerce_product_images">WooCommerce Image Settings →</button>',
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_section_gallery_message',
'label' => __( '', 'flatsome-admin' ),
'active_callback' => function () {
return get_theme_mod( 'product_gallery_woocommerce' ) ? true : false;
},
'section' => 'product-page',
'default' => '<span style="margin-top: -10px" class="description customize-control-description">The default WooCommerce gallery has been activated in section Advanced → WooCommerce. Multiple Flatsome gallery options are disabled.</span>',
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_product_info',
'label' => __( '', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '<div class="options-title-divider">Product Summary</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'product_info_align',
'label' => __( 'Text Align', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => array(
$hide_on_gallery_wide,
$hide_on_custom_product,
),
'default' => 'left',
'choices' => array(
'left' => __( 'Left', 'flatsome-admin' ),
'center' => __( 'Center', 'flatsome-admin' ),
'right' => __( 'Right', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'product_info_form',
'active_callback' => array(
$hide_on_custom_product,
),
'label' => __( 'Form Style', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '',
'choices' => array(
'' => __( 'Default', 'flatsome-admin' ),
'flat' => __( 'Flat', 'flatsome-admin' ),
'minimal' => __( 'Minimal', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_title_divider',
'label' => __( 'Product Title divider', 'flatsome-admin' ),
'active_callback' => array(
$hide_on_custom_product,
),
'section' => 'product-page',
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_sticky_cart',
'label' => __( 'Sticky add to cart', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 0,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_info_review_count',
'active_callback' => array(
$hide_on_custom_product,
),
'label' => __( 'Show Review Count', 'flatsome-admin' ),
'section' => 'product-page',
'default' => false,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'product_info_review_count_style',
'label' => __( 'Review Count Style', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => array(
$hide_on_custom_product,
array(
'setting' => 'product_info_review_count',
'operator' => '==',
'value' => true,
),
),
'default' => 'inline',
'choices' => array(
'tooltip' => __( 'Tooltip', 'flatsome-admin' ),
'stacked' => __( 'Stacked', 'flatsome-admin' ),
'inline' => __( 'Inline', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_info_meta',
'active_callback' => array(
$hide_on_gallery_wide,
$hide_on_custom_product,
),
'label' => __( 'Show Meta / Categories', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'product_info_share',
'active_callback' => array(
$hide_on_custom_product,
),
'label' => __( 'Show Share Icons', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 1,
) );
if ( get_theme_mod( 'swatches' ) ) :
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_swatches',
'label' => '',
'section' => 'product-page',
'default' => '<div class="options-title-divider">Swatches</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-image',
'settings' => 'swatches_layout',
'label' => __( 'Layout', 'flatsome' ),
'section' => 'product-page',
'default' => '',
'choices' => array(
'' => flatsome_customizer_images_uri() . '/product-swatches.svg',
'stacked' => flatsome_customizer_images_uri() . '/product-swatches-stacked.svg',
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'swatches_tooltip',
'label' => __( 'Tooltip', 'flatsome' ),
'description' => __( 'Show a tooltip with the term or term description.', 'flatsome' ),
'section' => 'product-page',
'default' => 1,
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'color',
'settings' => 'swatches_color_selected',
'transport' => 'postMessage',
'label' => __( 'Color :selected', 'flatsome' ),
'section' => 'product-page',
'default' => Flatsome_Default::COLOR_SECONDARY,
) );
endif;
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_product_tabs',
'label' => __( '', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '<div class="options-title-divider">Tabs</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'product_display',
'label' => __( 'Product Tabs Style', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => array(
$hide_on_custom_product,
),
'default' => 'tabs',
'choices' => array(
'tabs' => __( 'Line Tabs', 'flatsome-admin' ),
'tabs_normal' => __( 'Tabs Normal', 'flatsome-admin' ),
'line-grow' => __( 'Line Tabs - Grow', 'flatsome-admin' ),
'tabs_vertical' => __( 'Tabs vertical', 'flatsome-admin' ),
'tabs_pills' => __( 'Pills', 'flatsome-admin' ),
'tabs_outline' => __( 'Outline', 'flatsome-admin' ),
'sections' => __( 'Sections', 'flatsome-admin' ),
'accordian' => __( 'Accordion', 'flatsome-admin' ),
'accordian-collapsed' => __( 'Accordion - Collapsed', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'radio-buttonset',
'settings' => 'product_tabs_align',
'label' => __( 'Product Tabs Align', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => array(
$hide_on_custom_product,
),
'default' => 'left',
'choices' => array(
'left' => __( 'Left', 'flatsome-admin' ),
'center' => __( 'Center', 'flatsome-admin' ),
'right' => __( 'Right', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'text',
'settings' => 'tab_title',
'label' => __( 'Global custom tab title', 'flatsome-admin' ),
'section' => 'product-page',
'sanitize_callback' => 'flatsome_custom_sanitize',
'default' => '',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'tab_content',
'label' => __( 'Global custom tab content', 'flatsome-admin' ),
'section' => 'product-page',
'sanitize_callback' => 'flatsome_custom_sanitize',
'default' => '',
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_product_related',
'label' => __( '', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '<div class="options-title-divider">Related / Upsell</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'product_upsell',
'label' => __( 'Product Upsell', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => array(
$hide_on_gallery_wide,
$hide_on_custom_product,
),
'default' => 'sidebar',
'choices' => array(
'sidebar' => __( 'In Sidebar', 'flatsome-admin' ),
'bottom' => __( 'Below Description', 'flatsome-admin' ),
'disabled' => __( 'Disabled', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'select',
'settings' => 'related_products',
'label' => __( 'Related Products Style', 'flatsome-admin' ),
'section' => 'product-page',
'active_callback' => array(
$hide_on_custom_product,
),
'default' => 'slider',
'choices' => array(
'slider' => __( 'Slider', 'flatsome-admin' ),
'grid' => __( 'Grid', 'flatsome-admin' ),
'hidden' => __( 'Disabled', 'flatsome-admin' ),
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'related_products_pr_row',
'label' => __( 'Products per row - Desktop', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 4,
'choices' => array(
'min' => 1,
'max' => 6,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'related_products_pr_row_tablet',
'label' => __( 'Products per row - Tablet', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 3,
'choices' => array(
'min' => 1,
'max' => 4,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'slider',
'settings' => 'related_products_pr_row_mobile',
'label' => __( 'Products per row - Mobile', 'flatsome-admin' ),
'section' => 'product-page',
'default' => 2,
'choices' => array(
'min' => 1,
'max' => 3,
'step' => 1,
),
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'text',
'settings' => 'max_related_products',
'label' => __( 'Max number of Related Products', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '12',
) );
Flatsome_Option::add_field( '', array(
'type' => 'custom',
'settings' => 'custom_title_product_html',
'label' => __( '', 'flatsome-admin' ),
'section' => 'product-page',
'default' => '<div class="options-title-divider">Custom HTML</div>',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'html_before_add_to_cart',
'label' => __( 'HTML before Add To Cart button', 'flatsome-admin' ),
'section' => 'product-page',
'sanitize_callback' => 'flatsome_custom_sanitize',
'default' => '',
) );
Flatsome_Option::add_field( 'option', array(
'type' => 'textarea',
'settings' => 'html_after_add_to_cart',
'label' => __( 'HTML after Add To Cart button', 'flatsome-admin' ),
'section' => 'product-page',
'sanitize_callback' => 'flatsome_custom_sanitize',
'default' => '',
) );
}
add_action( 'init', 'flatsome_customizer_shop_product_page_options' );

View File

@@ -0,0 +1,9 @@
<?php
Flatsome_Option::add_field( 'option', array(
'type' => 'checkbox',
'settings' => 'woocommerce_store_notice_top',
'label' => __( 'Move store notice to the top', 'flatsome-admin' ),
'section' => 'woocommerce_store_notice',
'default' => 0
) );

View File

@@ -0,0 +1,113 @@
<?php
/*************
* Shop Panel
*************/
Flatsome_Option::add_panel( 'woocommerce', array(
'title' => __( 'WooCommerce', 'flatsome-admin' ),
) );
include_once(dirname( __FILE__ ).'/options-shop-category.php');
include_once(dirname( __FILE__ ).'/options-shop-product-page.php');
include_once(dirname( __FILE__ ).'/options-shop-my-account.php');
include_once(dirname( __FILE__ ).'/options-shop-cart-checkout.php');
include_once(dirname( __FILE__ ).'/options-shop-payments-icons.php');
include_once(dirname( __FILE__ ).'/options-shop-store-notice.php');
//include_once(dirname( __FILE__ ).'/options-shop-catalog-mode.php');
function flatsome_refresh_shop_partials( WP_Customize_Manager $wp_customize ) {
// Abort if selective refresh is not available.
if ( ! isset( $wp_customize->selective_refresh ) ) {
return;
}
$wp_customize->selective_refresh->add_partial( 'product-layout', array(
'selector' => '.product-container',
'settings' => array('product_layout'),
'fallback_refresh' => false,
'container_inclusive' => true,
'render_callback' => function() {
wc_get_template_part( 'single-product/layouts/product', get_theme_mod( 'product_layout', flatsome_product_layout() ) );
},
) );
$wp_customize->selective_refresh->add_partial( 'shop-header', array(
'selector' => '.woocommerce .category-page-title',
'fallback_refresh' => false,
'settings' => array('html_shop_page','category_title_style','category_show_title','breadcrumb_home','category_filter_text'),
'container_inclusive' => true,
'render_callback' => function() {
flatsome_category_header();
},
) );
$wp_customize->selective_refresh->add_partial( 'shop-grid', array(
'selector' => '.category-page-row',
'fallback_refresh' => false,
'settings' => array('sale_bubble_text','category_grid_style','short_description_in_grid','cat_style','category_show_count','sale_bubble_percentage_formatting','new_bubble_auto','add_to_cart_style','add_to_cart_icon','product_box_category','product_box_rating','product_hover','bubble_style','grid_style','category_sidebar','products_pr_page','category_row_count','category_row_count_mobile','category_row_count_tablet','category_shadow','category_shadow_hover','equalize_product_box','disable_quick_view'),
'container_inclusive' => true,
'render_callback' => function() {
wc_get_template_part( 'layouts/category', get_theme_mod( 'category_sidebar', 'left-sidebar' ) );
},
) );
$wp_customize->selective_refresh->add_partial( 'account-header', array(
'selector' => '.my-account-header',
'fallback_refresh' => false,
'settings' => array( 'my_account_title_bg_color', 'facebook_login_bg', 'facebook_login_text', 'my_account_title_text_color', 'my_account_title_align' ),
'container_inclusive' => true,
'render_callback' => function() {
wc_get_template( 'myaccount/header.php' );
},
) );
$wp_customize->selective_refresh->add_partial( 'html_cart_footer', array(
'selector' => '.cart-footer-content',
'settings' => array('html_cart_footer'),
'container_inclusive' => true,
'render_callback' => function() {
flatsome_html_cart_footer();
}
) );
$wp_customize->selective_refresh->add_partial( 'html_cart_sidebar', array(
'selector' => '.cart-sidebar-content',
'settings' => array('html_cart_sidebar'),
'container_inclusive' => true,
'render_callback' => function() {
flatsome_html_cart_sidebar();
}
) );
$wp_customize->selective_refresh->add_partial( 'html_checkout_sidebar', array(
'selector' => '.html-checkout-sidebar',
'settings' => array('html_checkout_sidebar'),
'container_inclusive' => true,
'render_callback' => function() {
flatsome_html_checkout_sidebar();
}
) );
$wp_customize->selective_refresh->add_partial( 'payment-icons', array(
'selector' => '.payment-icons',
'settings' => array('payment_icons', 'payment_icons_custom'),
'container_inclusive' => true,
'render_callback' => function() {
return do_shortcode('[ux_payment_icons]');
}
) );
$wp_customize->selective_refresh->add_partial( 'refresh_css_shop', array(
'selector' => 'head > style#custom-css',
'container_inclusive' => true,
'settings' => array('category_image_height','color_new_bubble','color_new_bubble_auto','color_checkout','color_sale','color_review','color_regular_price','color_sale_price'),
'render_callback' => function() {
flatsome_custom_css();
},
) );
}
add_action( 'customize_register', 'flatsome_refresh_shop_partials' );