modified file bootstrap-buttons.css
This commit is contained in:
@ -1,607 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* This file handles the customizer fields for the WooCommerce colors.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
add_action('generate_customize_after_controls', 'generate_register_woocommerce_colors', 1000);
|
||||
|
||||
/**
|
||||
* Register the WooCommerce color fields.
|
||||
*/
|
||||
function generate_register_woocommerce_colors($wp_customize)
|
||||
{
|
||||
if ( ! class_exists('GeneratePress_Customize_Field') ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Section_Shortcut_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_colors_shortcuts',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'element' => __( 'WooCommerce', 'gp-premium' ),
|
||||
'shortcuts' => array(
|
||||
'layout' => 'generate_woocommerce_layout',
|
||||
'typography' => 'generate_woocommerce_typography',
|
||||
),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
'priority' => 0,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$color_defaults = generate_get_color_defaults();
|
||||
|
||||
$wp_customize->add_section(
|
||||
'generate_woocommerce_colors',
|
||||
array(
|
||||
'title' => __( 'Colors', 'gp-premium' ),
|
||||
'priority' => 40,
|
||||
'panel' => 'woocommerce',
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_woocommerce_button_colors_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Buttons', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'toggleId' => 'woocommerce-button-colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_alt_button_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-button-colors',
|
||||
array(
|
||||
'generate_settings[wc_alt_button_background]' => array(
|
||||
'default_value' => $color_defaults['wc_alt_button_background'],
|
||||
'label' => __( 'Alt Button Background', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Initial Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
'generate_settings[wc_alt_button_background_hover]' => array(
|
||||
'default_value' => $color_defaults['wc_alt_button_background_hover'],
|
||||
'label' => __( 'Alt Button Background Hover', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Hover Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_alt_button_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-button-colors',
|
||||
array(
|
||||
'generate_settings[wc_alt_button_text]' => array(
|
||||
'default_value' => $color_defaults['wc_alt_button_text'],
|
||||
'label' => __( 'Alt Button Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Initial Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
'generate_settings[wc_alt_button_text_hover]' => array(
|
||||
'default_value' => $color_defaults['wc_alt_button_text_hover'],
|
||||
'label' => __( 'Alt Button Text Hover', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Hover Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover',
|
||||
'property' => 'color',
|
||||
'hide_label' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_woocommerce_product_colors_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Products', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'toggleId' => 'woocommerce-product-colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_product_title',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-product-colors',
|
||||
array(
|
||||
'generate_settings[wc_product_title_color]' => array(
|
||||
'default_value' => $color_defaults['wc_product_title_color'],
|
||||
'label' => __( 'Product Title', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Initial Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce ul.products li.product .woocommerce-LoopProduct-link',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
'generate_settings[wc_product_title_color_hover]' => array(
|
||||
'default_value' => $color_defaults['wc_product_title_color_hover'],
|
||||
'label' => __( 'Product Title Hover', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Hover Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover',
|
||||
'property' => 'color',
|
||||
'hide_label' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_rating_stars',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-product-colors',
|
||||
array(
|
||||
'generate_settings[wc_rating_stars]' => array(
|
||||
'default_value' => $color_defaults['wc_rating_stars'],
|
||||
'label' => __( 'Star Ratings', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce .star-rating span:before, .woocommerce p.stars:hover a::before',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_sale_sticker_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-product-colors',
|
||||
array(
|
||||
'generate_settings[wc_sale_sticker_background]' => array(
|
||||
'default_value' => $color_defaults['wc_sale_sticker_background'],
|
||||
'label' => __( 'Sale Sticker Background', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce span.onsale',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_sale_sticker_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-product-colors',
|
||||
array(
|
||||
'generate_settings[wc_sale_sticker_text]' => array(
|
||||
'default_value' => $color_defaults['wc_sale_sticker_text'],
|
||||
'label' => __( 'Sale Sticker Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce span.onsale',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_price_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-product-colors',
|
||||
array(
|
||||
'generate_settings[wc_price_color]' => array(
|
||||
'default_value' => $color_defaults['wc_price_color'],
|
||||
'label' => __( 'Price', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce ul.products li.product .price, .woocommerce div.product p.price',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_woocommerce_panel_cart_colors_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Sticky Panel Cart', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'toggleId' => 'woocommerce-panel-cart-colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_panel_cart_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-panel-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_panel_cart_background_color]' => array(
|
||||
'default_value' => $color_defaults['wc_panel_cart_background_color'],
|
||||
'label' => __( 'Background Color', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.add-to-cart-panel',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_panel_cart_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-panel-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_panel_cart_text_color]' => array(
|
||||
'default_value' => $color_defaults['wc_panel_cart_text_color'],
|
||||
'label' => __( 'Text Color', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.add-to-cart-panel, .add-to-cart-panel a:not(.button)',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_panel_cart_button_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-panel-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_panel_cart_button_background]' => array(
|
||||
'default_value' => $color_defaults['wc_panel_cart_button_background'],
|
||||
'label' => __( 'Button Background', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Initial Color', 'gp-premium' ),
|
||||
'element' => '#wc-sticky-cart-panel .button',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
'generate_settings[wc_panel_cart_button_background_hover]' => array(
|
||||
'default_value' => $color_defaults['wc_panel_cart_button_background_hover'],
|
||||
'label' => __( 'Button Background Hover', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Hover Color', 'gp-premium' ),
|
||||
'element' => '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_panel_cart_button_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-panel-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_panel_cart_button_text]' => array(
|
||||
'default_value' => $color_defaults['wc_panel_cart_button_text'],
|
||||
'label' => __( 'Button Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Initial Color', 'gp-premium' ),
|
||||
'element' => '#wc-sticky-cart-panel .button',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
'generate_settings[wc_panel_cart_button_text_hover]' => array(
|
||||
'default_value' => $color_defaults['wc_panel_cart_button_text_hover'],
|
||||
'label' => __( 'Button Text Hover', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Hover Color', 'gp-premium' ),
|
||||
'element' => '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active',
|
||||
'property' => 'color',
|
||||
'hide_label' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_woocommerce_mini_cart_colors_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Menu Mini Cart', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'toggleId' => 'woocommerce-mini-cart-colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_mini_cart_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-mini-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_mini_cart_background_color]' => array(
|
||||
'default_value' => $color_defaults['wc_mini_cart_background_color'],
|
||||
'label' => __( 'Background Color', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '#wc-mini-cart',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_mini_cart_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-mini-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_mini_cart_text_color]' => array(
|
||||
'default_value' => $color_defaults['wc_mini_cart_text_color'],
|
||||
'label' => __( 'Text Color', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '#wc-mini-cart',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_mini_cart_button_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-mini-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_mini_cart_button_background]' => array(
|
||||
'default_value' => $color_defaults['wc_mini_cart_button_background'],
|
||||
'label' => __( 'Button Background', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Initial Color', 'gp-premium' ),
|
||||
'element' => '#wc-mini-cart .button',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
'generate_settings[wc_mini_cart_button_background_hover]' => array(
|
||||
'default_value' => $color_defaults['wc_mini_cart_button_background_hover'],
|
||||
'label' => __( 'Button Background Hover', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Hover Color', 'gp-premium' ),
|
||||
'element' => '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_mini_cart_button_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-mini-cart-colors',
|
||||
array(
|
||||
'generate_settings[wc_mini_cart_button_text]' => array(
|
||||
'default_value' => $color_defaults['wc_mini_cart_button_text'],
|
||||
'label' => __( 'Button Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Initial Color', 'gp-premium' ),
|
||||
'element' => '#wc-mini-cart .button',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
'generate_settings[wc_mini_cart_button_text_hover]' => array(
|
||||
'default_value' => $color_defaults['wc_mini_cart_button_text_hover'],
|
||||
'label' => __( 'Button Text Hover', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Hover Color', 'gp-premium' ),
|
||||
'element' => '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active',
|
||||
'property' => 'color',
|
||||
'hide_label' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_woocommerce_price_slider_colors_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Price Slider Widget', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'toggleId' => 'woocommerce-price-slider-colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_price_slider_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-price-slider-colors',
|
||||
array(
|
||||
'generate_settings[wc_price_slider_background_color]' => array(
|
||||
'default_value' => $color_defaults['wc_price_slider_background_color'],
|
||||
'label' => __( 'Slider Background Color', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_price_slider_bar',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-price-slider-colors',
|
||||
array(
|
||||
'generate_settings[wc_price_slider_bar_color]' => array(
|
||||
'default_value' => $color_defaults['wc_price_slider_bar_color'],
|
||||
'label' => __( 'Slider Bar Color', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_woocommerce_product_tabs_colors_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Product Tabs', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'toggleId' => 'woocommerce-product-tabs-colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_product_tab_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-product-tabs-colors',
|
||||
array(
|
||||
'generate_settings[wc_product_tab]' => array(
|
||||
'default_value' => $color_defaults['wc_product_tab'],
|
||||
'label' => __( 'Product Tab Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce div.product .woocommerce-tabs ul.tabs li a',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_product_tab_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-product-tabs-colors',
|
||||
array(
|
||||
'generate_settings[wc_product_tab_highlight]' => array(
|
||||
'default_value' => $color_defaults['wc_product_tab_highlight'],
|
||||
'label' => __( 'Product Tab Active', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_woocommerce_messages_colors_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Messages', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'toggleId' => 'woocommerce-messages-colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_success_message_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-messages-colors',
|
||||
array(
|
||||
'generate_settings[wc_success_message_background]' => array(
|
||||
'default_value' => $color_defaults['wc_success_message_background'],
|
||||
'label' => __( 'Success Message Background', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce-message',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_success_message_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-messages-colors',
|
||||
array(
|
||||
'generate_settings[wc_success_message_text]' => array(
|
||||
'default_value' => $color_defaults['wc_success_message_text'],
|
||||
'label' => __( 'Success Message Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce-message',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_info_message_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-messages-colors',
|
||||
array(
|
||||
'generate_settings[wc_info_message_background]' => array(
|
||||
'default_value' => $color_defaults['wc_info_message_background'],
|
||||
'label' => __( 'Info Message Background', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce-info',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_info_message_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-messages-colors',
|
||||
array(
|
||||
'generate_settings[wc_info_message_text]' => array(
|
||||
'default_value' => $color_defaults['wc_info_message_text'],
|
||||
'label' => __( 'Info Message Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce-info',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_error_message_background',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-messages-colors',
|
||||
array(
|
||||
'generate_settings[wc_error_message_background]' => array(
|
||||
'default_value' => $color_defaults['wc_error_message_background'],
|
||||
'label' => __( 'Error Message Background', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce-error',
|
||||
'property' => 'background-color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_color_field_group(
|
||||
'woocommerce_error_message_text',
|
||||
'generate_woocommerce_colors',
|
||||
'woocommerce-messages-colors',
|
||||
array(
|
||||
'generate_settings[wc_error_message_text]' => array(
|
||||
'default_value' => $color_defaults['wc_error_message_text'],
|
||||
'label' => __( 'Error Message Text', 'gp-premium' ),
|
||||
'tooltip' => __( 'Choose Color', 'gp-premium' ),
|
||||
'element' => '.woocommerce-error',
|
||||
'property' => 'color',
|
||||
'hide_label' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'woocommerce_colors_redirect',
|
||||
array(
|
||||
'section' => 'generate_colors_section',
|
||||
'title' => __( 'WooCommerce', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'sectionRedirect' => true,
|
||||
'toggleId' => 'generate_woocommerce_colors',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
GeneratePress_Customize_Field::add_title(
|
||||
'generate_colors_redirect',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'title' => __( 'Other Theme Colors', 'gp-premium' ),
|
||||
'choices' => array(
|
||||
'sectionRedirect' => true,
|
||||
'toggleId' => 'generate_colors_section',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
@ -1,201 +0,0 @@
|
||||
.woocommerce-product-gallery {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.woocommerce .woocommerce-ordering,
|
||||
.woocommerce-page .woocommerce-ordering {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.woocommerce .woocommerce-ordering select {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.woocommerce #wc-column-container.wc-mobile-columns-1 .products,
|
||||
.wc-related-upsell-mobile-columns-1 .related ul.products,
|
||||
.wc-related-upsell-mobile-columns-1 .up-sells ul.products {
|
||||
-ms-grid-columns: 1fr;
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.woocommerce #wc-column-container.wc-mobile-columns-2 .products,
|
||||
.wc-related-upsell-mobile-columns-2 .related ul.products,
|
||||
.wc-related-upsell-mobile-columns-2 .up-sells ul.products {
|
||||
-ms-grid-columns: 1fr 1fr;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.woocommerce #wc-column-container.wc-mobile-columns-3 .products,
|
||||
.wc-related-upsell-mobile-columns-3 .related ul.products,
|
||||
.wc-related-upsell-mobile-columns-3 .up-sells ul.products {
|
||||
-ms-grid-columns: 1fr 1fr 1fr;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.woocommerce ul.products li.product a img {
|
||||
width: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.woocommerce div.product .woocommerce-tabs ul.tabs,
|
||||
.woocommerce div.product .woocommerce-tabs .panel {
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.woocommerce div.product .woocommerce-tabs .panel {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.wc-tabs .active a:after {
|
||||
transform: rotate(90deg);
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
.woocommerce .col2-set,
|
||||
.woocommerce-page .col2-set {
|
||||
width: 100%;
|
||||
float: none;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#customer_details + #wc_checkout_add_ons,
|
||||
#order_review,
|
||||
#order_review_heading {
|
||||
width: 100%;
|
||||
float: none;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image,
|
||||
.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image {
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,
|
||||
.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.woocommerce .related ul.products li.product,
|
||||
.woocommerce-page .related ul.products li.product,
|
||||
.woocommerce-page[class*=columns-] .related ul.products li.product,
|
||||
.woocommerce[class*=columns-] .related ul.products li.product,
|
||||
.woocommerce .up-sells ul.products li.product,
|
||||
.woocommerce-page .up-sells ul.products li.product,
|
||||
.woocommerce-page[class*=columns-] .up-sells ul.products li.product,
|
||||
.woocommerce[class*=columns-] .up-sells ul.products li.product {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first,
|
||||
.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last,
|
||||
.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first,
|
||||
.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last {
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.woocommerce-account .woocommerce-MyAccount-navigation {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.woocommerce-MyAccount-navigation li.is-active a:after {
|
||||
content: "\e901";
|
||||
}
|
||||
|
||||
#wc-mini-cart {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.do-quantity-buttons div.quantity {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.woocommerce div.product .woocommerce-tabs ul.tabs {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.woocommerce div.product .woocommerce-tabs ul.tabs li {
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child {
|
||||
border-bottom-color: rgba(0, 0, 0, 0.08);
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
.woocommerce .coupon .button {
|
||||
font-size: 14px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.woocommerce .woocommerce-ordering {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.add-to-cart-panel {
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
transform: translateY(0px) !important;
|
||||
}
|
||||
|
||||
.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before {
|
||||
content: "\f00d";
|
||||
font-family: 'GP Premium';
|
||||
line-height: 1em;
|
||||
width: 1.28571429em;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#wc-sticky-cart-panel .quantity,
|
||||
.add-to-cart-panel .continue-shopping-link {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.add-to-cart-panel .continue-shopping {
|
||||
order: 5;
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
left: 10px;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
line-height: 50px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.add-to-cart-panel .continue-shopping .gp-icon {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.add-to-cart-panel .product-image,
|
||||
.add-to-cart-panel .cart {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.add-to-cart-panel .product-title {
|
||||
padding-right: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.add-to-cart-panel .cart-info {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.add-to-cart-panel .product-price {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart) {
|
||||
pointer-events: none;
|
||||
}
|
@ -1 +0,0 @@
|
||||
.woocommerce-product-gallery{margin-right:0}.woocommerce .woocommerce-ordering,.woocommerce-page .woocommerce-ordering{float:none}.woocommerce .woocommerce-ordering select{max-width:100%}.wc-related-upsell-mobile-columns-1 .related ul.products,.wc-related-upsell-mobile-columns-1 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-1 .products{-ms-grid-columns:1fr;grid-template-columns:repeat(1,minmax(0,1fr))}.wc-related-upsell-mobile-columns-2 .related ul.products,.wc-related-upsell-mobile-columns-2 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-2 .products{-ms-grid-columns:1fr 1fr;grid-template-columns:repeat(2,minmax(0,1fr))}.wc-related-upsell-mobile-columns-3 .related ul.products,.wc-related-upsell-mobile-columns-3 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-3 .products{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:repeat(3,minmax(0,1fr))}.woocommerce ul.products li.product a img{width:auto;margin-left:auto;margin-right:auto}.woocommerce div.product .woocommerce-tabs .panel,.woocommerce div.product .woocommerce-tabs ul.tabs{float:none;width:100%}.woocommerce div.product .woocommerce-tabs .panel{margin-top:20px}.wc-tabs .active a:after{transform:rotate(90deg);padding-right:3px}.woocommerce .col2-set,.woocommerce-page .col2-set{width:100%;float:none;margin-right:0}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading{width:100%;float:none;margin-right:0}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:100%}.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product,.woocommerce-page .related ul.products li.product,.woocommerce-page .up-sells ul.products li.product,.woocommerce-page[class*=columns-] .related ul.products li.product,.woocommerce-page[class*=columns-] .up-sells ul.products li.product,.woocommerce[class*=columns-] .related ul.products li.product,.woocommerce[class*=columns-] .up-sells ul.products li.product{width:100%;margin-left:0;margin-right:0}.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last{float:none;width:100%}.woocommerce-account .woocommerce-MyAccount-navigation{width:100%}.woocommerce-MyAccount-navigation li.is-active a:after{content:"\e901"}#wc-mini-cart{display:none}.do-quantity-buttons div.quantity{justify-content:flex-end}.woocommerce div.product .woocommerce-tabs ul.tabs{flex-direction:column}.woocommerce div.product .woocommerce-tabs ul.tabs li{border-left-width:1px}.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child{border-bottom-color:rgba(0,0,0,.08);border-bottom-width:1px}.woocommerce .coupon .button{font-size:14px;padding:10px}.woocommerce .woocommerce-ordering{margin-bottom:0}.add-to-cart-panel{bottom:0;top:auto;transform:translateY(0)!important}.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before{content:"\f00d";font-family:'GP Premium';line-height:1em;width:1.28571429em;text-align:center;display:inline-block;padding:10px}#wc-sticky-cart-panel .quantity,.add-to-cart-panel .continue-shopping-link{display:none}.add-to-cart-panel .continue-shopping{order:5;margin-left:auto;margin-right:0;position:absolute;top:-20px;left:10px;height:50px;width:50px;text-align:center;border-radius:50%;line-height:50px;cursor:pointer}.add-to-cart-panel .continue-shopping .gp-icon{display:block}.add-to-cart-panel .cart,.add-to-cart-panel .product-image{flex-shrink:0}.add-to-cart-panel .product-title{padding-right:20px;margin-left:10px}.add-to-cart-panel .cart-info{margin-right:auto}.add-to-cart-panel .product-price{font-size:13px}.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart){pointer-events:none}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
jQuery( function( $ ) {
|
||||
$( '#customize-control-generate_woocommerce_primary_button_message a' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
wp.customize.control( 'generate_settings[form_button_background_color]' ).focus();
|
||||
} );
|
||||
} );
|
File diff suppressed because it is too large
Load Diff
@ -1,285 +0,0 @@
|
||||
jQuery( function( $ ) {
|
||||
var debounce = function( callback, wait ) {
|
||||
var timeout;
|
||||
|
||||
return function() {
|
||||
clearTimeout( timeout );
|
||||
|
||||
timeout = setTimeout( function() {
|
||||
timeout = undefined;
|
||||
callback.call();
|
||||
}, wait );
|
||||
};
|
||||
};
|
||||
|
||||
$( 'body' ).on( 'added_to_cart', function() {
|
||||
if ( ! $( '.wc-menu-item' ).hasClass( 'has-items' ) ) {
|
||||
$( '.wc-menu-item' ).addClass( 'has-items' );
|
||||
}
|
||||
|
||||
if ( ! $( '.wc-mobile-cart-items' ).hasClass( 'has-items' ) ) {
|
||||
$( '.wc-mobile-cart-items' ).addClass( 'has-items' );
|
||||
}
|
||||
} );
|
||||
|
||||
$( 'body' ).on( 'removed_from_cart', function() {
|
||||
var numberOfItems = $( '.number-of-items' );
|
||||
|
||||
if ( numberOfItems.length ) {
|
||||
if ( numberOfItems.hasClass( 'no-items' ) ) {
|
||||
$( '.wc-menu-item' ).removeClass( 'has-items' );
|
||||
$( '.wc-mobile-cart-items' ).removeClass( 'has-items' );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
if ( generateWooCommerce.addToCartPanel ) {
|
||||
$( document.body ).on( 'added_to_cart', function() {
|
||||
var adminBar = $( '#wpadminbar' ),
|
||||
stickyNav = $( '.navigation-stick' ),
|
||||
top = 0;
|
||||
|
||||
if ( adminBar.length ) {
|
||||
top = adminBar.outerHeight();
|
||||
}
|
||||
|
||||
if ( stickyNav.length && '0px' === stickyNav.css( 'top' ) ) {
|
||||
top = top + stickyNav.outerHeight();
|
||||
}
|
||||
|
||||
$( '.add-to-cart-panel' ).addClass( 'item-added' ).css( {
|
||||
'-webkit-transform': 'translateY(' + top + 'px)',
|
||||
'-ms-transform': 'translateY(' + top + 'px)',
|
||||
transform: 'translateY(' + top + 'px)',
|
||||
} );
|
||||
} );
|
||||
|
||||
$( '.add-to-cart-panel .continue-shopping' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
$( '.add-to-cart-panel' ).removeClass( 'item-added' ).css( {
|
||||
'-webkit-transform': 'translateY(-100%)',
|
||||
'-ms-transform': 'translateY(-100%)',
|
||||
transform: 'translateY(-100%)',
|
||||
} );
|
||||
} );
|
||||
|
||||
$( window ).on( 'scroll', debounce( function() {
|
||||
var panel = $( '.add-to-cart-panel' );
|
||||
|
||||
if ( panel.hasClass( 'item-added' ) ) {
|
||||
panel.removeClass( 'item-added' ).css( {
|
||||
'-webkit-transform': 'translateY(-100%)',
|
||||
'-ms-transform': 'translateY(-100%)',
|
||||
transform: 'translateY(-100%)',
|
||||
} );
|
||||
}
|
||||
}, 250 ) );
|
||||
}
|
||||
|
||||
if ( generateWooCommerce.stickyAddToCart ) {
|
||||
var lastScroll = 0;
|
||||
var scrollDownTimeout = 300;
|
||||
|
||||
$( window ).on( 'scroll', debounce( function() {
|
||||
var adminBar = $( '#wpadminbar' ),
|
||||
stickyNav = $( '.navigation-stick' ),
|
||||
stuckElement = $( '.stuckElement' ),
|
||||
top = 0,
|
||||
scrollTop = $( window ).scrollTop(),
|
||||
panel = $( '.add-to-cart-panel' ),
|
||||
panelPosition = panel.offset().top + panel.outerHeight(),
|
||||
button = $( '.single_add_to_cart_button' ),
|
||||
buttonTop = button.offset().top,
|
||||
buttonHeight = button.outerHeight(),
|
||||
footerTop = $( '.site-footer' ).offset().top;
|
||||
|
||||
if ( stuckElement.length === 0 ) {
|
||||
scrollDownTimeout = 0;
|
||||
}
|
||||
|
||||
if ( scrollTop > ( buttonTop + buttonHeight ) && panelPosition < footerTop ) {
|
||||
setTimeout( function() {
|
||||
if ( adminBar.length ) {
|
||||
top = adminBar.outerHeight();
|
||||
}
|
||||
|
||||
if ( stickyNav.length ) {
|
||||
if ( stickyNav.hasClass( 'auto-hide-sticky' ) ) {
|
||||
if ( scrollTop < lastScroll && '0px' === stickyNav.css( 'top' ) ) {
|
||||
top = top + stickyNav.outerHeight();
|
||||
} else {
|
||||
top = top;
|
||||
}
|
||||
|
||||
lastScroll = scrollTop;
|
||||
} else {
|
||||
top = top + stickyNav.outerHeight();
|
||||
}
|
||||
}
|
||||
|
||||
panel.addClass( 'show-sticky-add-to-cart' ).css( {
|
||||
'-webkit-transform': 'translateY(' + top + 'px)',
|
||||
'-ms-transform': 'translateY(' + top + 'px)',
|
||||
transform: 'translateY(' + top + 'px)',
|
||||
} );
|
||||
}, scrollDownTimeout );
|
||||
} else {
|
||||
panel.removeClass( 'show-sticky-add-to-cart' ).css( {
|
||||
'-webkit-transform': '',
|
||||
'-ms-transform': '',
|
||||
transform: '',
|
||||
} );
|
||||
}
|
||||
}, 50 ) );
|
||||
|
||||
$( '.go-to-variables' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
var offset = 0,
|
||||
stickyNav = $( '.navigation-stick' ),
|
||||
adminBar = $( '#wpadminbar' );
|
||||
|
||||
if ( stickyNav.length ) {
|
||||
offset = stickyNav.outerHeight();
|
||||
}
|
||||
|
||||
if ( adminBar.length ) {
|
||||
offset = offset + adminBar.outerHeight();
|
||||
}
|
||||
|
||||
$( 'html, body' ).animate( {
|
||||
scrollTop: $( '.variations' ).offset().top - offset,
|
||||
}, 250 );
|
||||
} );
|
||||
}
|
||||
|
||||
$( function() {
|
||||
'use strict';
|
||||
|
||||
if ( generateWooCommerce.quantityButtons ) {
|
||||
generateQuantityButtons();
|
||||
}
|
||||
} );
|
||||
|
||||
$( document ).ajaxComplete( function() {
|
||||
'use strict';
|
||||
|
||||
if ( generateWooCommerce.quantityButtons ) {
|
||||
generateQuantityButtons();
|
||||
}
|
||||
} );
|
||||
|
||||
function generateQuantityButtons() {
|
||||
// Check if we have an overwrite hook for this function
|
||||
try {
|
||||
return generateWooCommerce.hooks.generateQuantityButtons();
|
||||
} catch ( e ) {
|
||||
// No hook in place, carry on
|
||||
}
|
||||
|
||||
// Grab the FIRST available cart form on the page
|
||||
var cart = $( '.woocommerce div.product form.cart' ).first();
|
||||
|
||||
// Check if we see elementor style classes
|
||||
if ( cart.closest( '.elementor-add-to-cart' ).length ) {
|
||||
// Found classes, remove them and finish here
|
||||
$( '.elementor.product' ).removeClass( 'do-quantity-buttons' );
|
||||
return;
|
||||
}
|
||||
|
||||
// Grab all the quantity boxes that need dynamic buttons adding
|
||||
var quantityBoxes;
|
||||
|
||||
try {
|
||||
// Is there a hook available?
|
||||
quantityBoxes = generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes;
|
||||
} catch ( e ) {
|
||||
// Use the default plugin selector functionality
|
||||
quantityBoxes = $( '.cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)' ).find( '.qty' );
|
||||
}
|
||||
|
||||
// Test the elements have length and greater than 0
|
||||
// Try, catch here to provide basic error checking on hooked data
|
||||
try {
|
||||
// Nothing found... stop here
|
||||
if ( quantityBoxes.length === 0 ) {
|
||||
return false;
|
||||
}
|
||||
} catch ( e ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Allow the each loop callback to be completely overwritten
|
||||
var quantityBoxesCallback;
|
||||
|
||||
try {
|
||||
// Try assign a hooked callback
|
||||
quantityBoxesCallback = generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes;
|
||||
} catch ( e ) {
|
||||
// Use the default callback handler
|
||||
quantityBoxesCallback = function( key, value ) {
|
||||
var box = $( value );
|
||||
|
||||
// Check allowed types
|
||||
if ( [ 'date', 'hidden' ].indexOf( box.prop( 'type' ) ) !== -1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add plus and minus icons
|
||||
box.parent().addClass( 'buttons-added' ).prepend( '<a href="javascript:void(0)" class="minus">-</a>' );
|
||||
box.after( '<a href="javascript:void(0)" class="plus">+</a>' );
|
||||
|
||||
// Enforce min value on the input
|
||||
var min = parseFloat( $( this ).attr( 'min' ) );
|
||||
|
||||
if ( min && min > 0 && parseFloat( $( this ).val() ) < min ) {
|
||||
$( this ).val( min );
|
||||
}
|
||||
|
||||
// Add event handlers to plus and minus (within this scope)
|
||||
box.parent().find( '.plus, .minus' ).on( 'click', function() {
|
||||
// Get values
|
||||
var currentQuantity = parseFloat( box.val() ),
|
||||
maxQuantity = parseFloat( box.attr( 'max' ) ),
|
||||
minQuantity = parseFloat( box.attr( 'min' ) ),
|
||||
step = box.attr( 'step' );
|
||||
|
||||
// Fallback default values
|
||||
if ( ! currentQuantity || '' === currentQuantity || 'NaN' === currentQuantity ) {
|
||||
currentQuantity = 0;
|
||||
}
|
||||
|
||||
if ( '' === maxQuantity || 'NaN' === maxQuantity ) {
|
||||
maxQuantity = '';
|
||||
}
|
||||
|
||||
if ( '' === minQuantity || 'NaN' === minQuantity ) {
|
||||
minQuantity = 0;
|
||||
}
|
||||
|
||||
if ( 'any' === step || '' === step || undefined === step || 'NaN' === parseFloat( step ) ) {
|
||||
step = 1;
|
||||
}
|
||||
|
||||
if ( $( this ).is( '.plus' ) ) {
|
||||
if ( maxQuantity && ( maxQuantity === currentQuantity || currentQuantity > maxQuantity ) ) {
|
||||
box.val( maxQuantity );
|
||||
} else {
|
||||
box.val( currentQuantity + parseFloat( step ) );
|
||||
}
|
||||
} else if ( minQuantity && ( minQuantity === currentQuantity || currentQuantity < minQuantity ) ) {
|
||||
box.val( minQuantity );
|
||||
} else if ( currentQuantity > 0 ) {
|
||||
box.val( currentQuantity - parseFloat( step ) );
|
||||
}
|
||||
|
||||
// Trigger change event
|
||||
box.trigger( 'change' );
|
||||
} );
|
||||
};
|
||||
}
|
||||
|
||||
$.each( quantityBoxes, quantityBoxesCallback );
|
||||
}
|
||||
} );
|
@ -1 +0,0 @@
|
||||
jQuery(function(d){function t(t,a){var e;return function(){clearTimeout(e),e=setTimeout(function(){e=void 0,t.call()},a)}}var m,u;function a(){try{return generateWooCommerce.hooks.generateQuantityButtons()}catch(t){}var a,e;if(d(".woocommerce div.product form.cart").first().closest(".elementor-add-to-cart").length)d(".elementor.product").removeClass("do-quantity-buttons");else{try{a=generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes}catch(t){a=d(".cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)").find(".qty")}try{if(0===a.length)return}catch(t){return}try{e=generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes}catch(t){e=function(t,a){var s=d(a);-1===["date","hidden"].indexOf(s.prop("type"))&&(s.parent().addClass("buttons-added").prepend('<a href="javascript:void(0)" class="minus">-</a>'),s.after('<a href="javascript:void(0)" class="plus">+</a>'),(a=parseFloat(d(this).attr("min")))&&0<a&&parseFloat(d(this).val())<a&&d(this).val(a),s.parent().find(".plus, .minus").on("click",function(){var t=parseFloat(s.val()),a=parseFloat(s.attr("max")),e=parseFloat(s.attr("min")),o=s.attr("step");t&&""!==t&&"NaN"!==t||(t=0),""!==a&&"NaN"!==a||(a=""),""!==e&&"NaN"!==e||(e=0),"any"!==o&&""!==o&&void 0!==o&&"NaN"!==parseFloat(o)||(o=1),d(this).is(".plus")?a&&(a===t||a<t)?s.val(a):s.val(t+parseFloat(o)):e&&(e===t||t<e)?s.val(e):0<t&&s.val(t-parseFloat(o)),s.trigger("change")}))}}d.each(a,e)}}d("body").on("added_to_cart",function(){d(".wc-menu-item").hasClass("has-items")||d(".wc-menu-item").addClass("has-items"),d(".wc-mobile-cart-items").hasClass("has-items")||d(".wc-mobile-cart-items").addClass("has-items")}),d("body").on("removed_from_cart",function(){var t=d(".number-of-items");t.length&&t.hasClass("no-items")&&(d(".wc-menu-item").removeClass("has-items"),d(".wc-mobile-cart-items").removeClass("has-items"))}),generateWooCommerce.addToCartPanel&&(d(document.body).on("added_to_cart",function(){var t=d("#wpadminbar"),a=d(".navigation-stick"),e=0;t.length&&(e=t.outerHeight()),a.length&&"0px"===a.css("top")&&(e+=a.outerHeight()),d(".add-to-cart-panel").addClass("item-added").css({"-webkit-transform":"translateY("+e+"px)","-ms-transform":"translateY("+e+"px)",transform:"translateY("+e+"px)"})}),d(".add-to-cart-panel .continue-shopping").on("click",function(t){t.preventDefault(),d(".add-to-cart-panel").removeClass("item-added").css({"-webkit-transform":"translateY(-100%)","-ms-transform":"translateY(-100%)",transform:"translateY(-100%)"})}),d(window).on("scroll",t(function(){var t=d(".add-to-cart-panel");t.hasClass("item-added")&&t.removeClass("item-added").css({"-webkit-transform":"translateY(-100%)","-ms-transform":"translateY(-100%)",transform:"translateY(-100%)"})},250))),generateWooCommerce.stickyAddToCart&&(m=0,u=300,d(window).on("scroll",t(function(){var t=d("#wpadminbar"),a=d(".navigation-stick"),e=d(".stuckElement"),o=0,s=d(window).scrollTop(),r=d(".add-to-cart-panel"),n=r.offset().top+r.outerHeight(),i=d(".single_add_to_cart_button"),c=i.offset().top,i=i.outerHeight(),l=d(".site-footer").offset().top;0===e.length&&(u=0),c+i<s&&n<l?setTimeout(function(){t.length&&(o=t.outerHeight()),a.length&&(a.hasClass("auto-hide-sticky")?(s<m&&"0px"===a.css("top")&&(o+=a.outerHeight()),m=s):o+=a.outerHeight()),r.addClass("show-sticky-add-to-cart").css({"-webkit-transform":"translateY("+o+"px)","-ms-transform":"translateY("+o+"px)",transform:"translateY("+o+"px)"})},u):r.removeClass("show-sticky-add-to-cart").css({"-webkit-transform":"","-ms-transform":"",transform:""})},50)),d(".go-to-variables").on("click",function(t){t.preventDefault();var t=0,a=d(".navigation-stick"),e=d("#wpadminbar");a.length&&(t=a.outerHeight()),e.length&&(t+=e.outerHeight()),d("html, body").animate({scrollTop:d(".variations").offset().top-t},250)})),d(function(){"use strict";generateWooCommerce.quantityButtons&&a()}),d(document).ajaxComplete(function(){"use strict";generateWooCommerce.quantityButtons&&a()})});
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The WooCommerce module.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*
|
||||
* @package GP Premium
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
// Define the version.
|
||||
define( 'GENERATE_WOOCOMMERCE_VERSION', GP_PREMIUM_VERSION );
|
||||
|
||||
// Include functions identical between standalone addon and GP Premium.
|
||||
require plugin_dir_path( __FILE__ ) . 'functions/functions.php';
|
||||
require plugin_dir_path( __FILE__ ) . 'fields/woocommerce-colors.php';
|
Reference in New Issue
Block a user