| 1 |
<?php |
| 2 |
namespace Themefic\Instantio\Controller; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
|
| 6 |
class Assets { |
| 7 |
public function __construct() { |
| 8 |
WC()->frontend_includes(); |
| 9 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_custom_js_scripts' ), 99999 ); |
| 10 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_custom_css_scripts' ), 99999 ); |
| 11 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 20 ); |
| 12 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); |
| 13 |
} |
| 14 |
public function enqueue_scripts() { |
| 15 |
$ins_script_file = ! empty( instantio_get_option( 'js-min' ) ) |
| 16 |
? 'instantio-script.min.js' |
| 17 |
: 'instantio-script.js'; |
| 18 |
$ins_script_url = INSTANTIO_ASSETS_URL . '/app/js/' . $ins_script_file; |
| 19 |
$ins_script_path = INSTANTIO_PATH . 'assets/app/js/' . $ins_script_file; |
| 20 |
$ins_script_version = file_exists( $ins_script_path ) |
| 21 |
? INSTANTIO_VERSION . '-' . filemtime( $ins_script_path ) |
| 22 |
: INSTANTIO_VERSION; |
| 23 |
|
| 24 |
wp_enqueue_style( 'instantio-style', apply_filters( 'instantio_style_min_status_checked', INSTANTIO_ASSETS_URL . '/app/css/instantio-style.css' ), array(), INSTANTIO_VERSION ); |
| 25 |
// wp_enqueue_style( 'instantio-style-modern', INSTANTIO_ASSETS_URL.'/app/css/instantio-modern-style.css', array(), INSTANTIO_VERSION ); |
| 26 |
wp_enqueue_script( 'instantio-script', apply_filters( 'instantio_script_min_status_checked', $ins_script_url ), array( 'jquery' ), $ins_script_version, true ); |
| 27 |
wp_localize_script( 'instantio-script', 'instantio_params', |
| 28 |
array( |
| 29 |
'instantio_ajax_nonce' => wp_create_nonce( 'instantio_ajax_nonce' ), |
| 30 |
'ajax_url' => admin_url( 'admin-ajax.php' ), |
| 31 |
'cartajax_url' => WC()->ajax_url(), |
| 32 |
'wc_ajax_url' => \WC_AJAX::get_endpoint( '%%endpoint%%' ), |
| 33 |
'update_shipping_method_nonce' => wp_create_nonce( 'update-shipping-method' ), |
| 34 |
) |
| 35 |
); |
| 36 |
|
| 37 |
// Enqueue variation scripts. |
| 38 |
wp_enqueue_script( 'wc-add-to-cart-variation' ); |
| 39 |
|
| 40 |
} |
| 41 |
|
| 42 |
public function admin_enqueue_scripts() { |
| 43 |
wp_enqueue_style( 'instantio-admin', INSTANTIO_ASSETS_URL . '/admin/css/instantio-admin-style.css', array(), INSTANTIO_VERSION ); |
| 44 |
wp_enqueue_script( 'instantio-admin-script', INSTANTIO_ASSETS_URL . '/admin/js/instantio-admin-script.js', array( 'jquery' ), INSTANTIO_VERSION, true ); |
| 45 |
|
| 46 |
wp_localize_script( 'instantio-admin-script', 'instantio_admin_params', |
| 47 |
array( |
| 48 |
'ins_nonce' => wp_create_nonce( 'updates' ), |
| 49 |
'ajax_url' => admin_url( 'admin-ajax.php' ), |
| 50 |
) |
| 51 |
); |
| 52 |
|
| 53 |
wp_localize_script('instantio-admin-script', 'instantio_admin_data', [ |
| 54 |
'ins_nonce' => wp_create_nonce('instantio_admin_nonce'), |
| 55 |
'themefic_nonce' => wp_create_nonce('themefic_plugin_nonce'), |
| 56 |
]); |
| 57 |
|
| 58 |
} |
| 59 |
|
| 60 |
public function enqueue_custom_css_scripts() { |
| 61 |
$ins_checkout_theme = ! empty( instantio_get_option( 'ins-toggle-panel-tab' )['ins_panel_Theme_color'] ) ? instantio_get_option( 'ins-toggle-panel-tab' )['ins_panel_Theme_color'] : '#e9570a'; |
| 62 |
|
| 63 |
$ins_toggle_bg = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-bg-colors']['regular'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-bg-colors']['regular'] : $ins_checkout_theme; |
| 64 |
$ins_toggle_bg_hover = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-bg-colors']['hover'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-bg-colors']['hover'] : '#fffdfd'; |
| 65 |
$ins_toggle_border = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-border-colors']['regular'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-border-colors']['regular'] : '#FEF2EB'; |
| 66 |
$ins_toggle_border_hover = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-border-colors']['hover'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-border-colors']['hover'] : '#FEF2EB'; |
| 67 |
$ins_toggle_icon = ! empty( instantio_get_option( 'ins-toggle-tab' )['ins-tog-icon-colors']['regular'] ) ? instantio_get_option( 'ins-toggle-tab' )['ins-tog-icon-colors']['regular'] : '#fff'; |
| 68 |
$ins_toggle_icon_hover = ! empty( instantio_get_option( 'ins-toggle-tab' )['ins-tog-icon-colors']['hover'] ) ? instantio_get_option( 'ins-toggle-tab' )['ins-tog-icon-colors']['hover'] : $ins_checkout_theme; |
| 69 |
$ins_toggle_icon_size = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-icon-size'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-icon-size'] . 'px' : '24px'; |
| 70 |
$ins_toggle_item_bg = ! empty( instantio_get_option( 'ins-toggle-tab' )['ins-tog-item-bg']['regular'] ) ? instantio_get_option( 'ins-toggle-tab' )['ins-tog-item-bg']['regular'] : '#ffd200'; |
| 71 |
$ins_toggle_item_bg_hover = ! empty( instantio_get_option( 'ins-toggle-tab' )['ins-tog-item-bg']['hover'] ) ? instantio_get_option( 'ins-toggle-tab' )['ins-tog-item-bg']['hover'] : '#ffd200'; |
| 72 |
$ins_toggle_item_color = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-text-colors']['regular'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-text-colors']['regular'] : '#000'; |
| 73 |
$ins_toggle_item_color_hover = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-text-colors']['hover'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-text-colors']['hover'] : '#000'; |
| 74 |
$ins_toggle_item_size = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-header-text-size'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-header-text-size'] . 'px' : '14px'; |
| 75 |
|
| 76 |
$output = ''; |
| 77 |
$output .= ' |
| 78 |
:root { |
| 79 |
--ins_checkout_theme: ' . $ins_checkout_theme . '; |
| 80 |
--ins_toggle_bg: ' . $ins_toggle_bg . '; |
| 81 |
--ins_toggle_hover_bg: ' . $ins_toggle_bg_hover . '; |
| 82 |
--ins_toggle_border: ' . $ins_toggle_border . '; |
| 83 |
--ins_toggle_hover_border: ' . $ins_toggle_border_hover . '; |
| 84 |
--ins_toggle_icon: ' . $ins_toggle_icon . '; |
| 85 |
--ins_toggle_icon_hover: ' . $ins_toggle_icon_hover . '; |
| 86 |
--ins_toggle_icon_size: ' . $ins_toggle_icon_size . '; |
| 87 |
--ins_toggle_item_bg: ' . $ins_toggle_item_bg . '; |
| 88 |
--ins_toggle_item_bg_hover: ' . $ins_toggle_item_bg_hover . '; |
| 89 |
--ins_toggle_item_color: ' . $ins_toggle_item_color . '; |
| 90 |
--ins_toggle_item_color_hover: ' . $ins_toggle_item_color_hover . '; |
| 91 |
--ins_toggle_item_size: ' . $ins_toggle_item_size . '; |
| 92 |
} |
| 93 |
'; |
| 94 |
|
| 95 |
// ins-toggle-panel-tab |
| 96 |
$ins_toggle_panel_tab = instantio_get_option( 'ins-toggle-panel-tab' ); |
| 97 |
|
| 98 |
// ins-toggle-panel-tab |
| 99 |
$ins_panel_border_option = isset( instantio_get_option( 'ins-toggle-panel-tab' )['ins_panel_border_option'] ) && ! empty( instantio_get_option( 'ins-toggle-panel-tab' )['ins_panel_border_option'] ) ? instantio_get_option( 'ins-toggle-panel-tab' )['ins_panel_border_option'] : false; |
| 100 |
|
| 101 |
if ( $ins_panel_border_option == true ) { |
| 102 |
$ins_panel_border_top = ! empty( instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-top'] ) ? instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-top'] : '0'; |
| 103 |
$ins_panel_border_right = ! empty( instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-right'] ) ? instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-right'] : '0'; |
| 104 |
$ins_panel_border_bottom = ! empty( instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-bottom'] ) ? instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-bottom'] : '0'; |
| 105 |
$ins_panel_border_left = ! empty( instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-left'] ) ? instantio_get_option( 'ins-toggle-panel-tab' )['ins-panel-border-left'] : '0'; |
| 106 |
$ins_panel_border_color = ! empty( instantio_get_option( 'ins-toggle-panel-tab' )['ins_panel_border_color'] ) ? instantio_get_option( 'ins-toggle-panel-tab' )['ins_panel_border_color'] : 'transparent'; |
| 107 |
$totalleftButton = 90 + (int) $ins_panel_border_left; |
| 108 |
$totalleftButton2 = 80 + (int) $ins_panel_border_left; |
| 109 |
|
| 110 |
|
| 111 |
$output .= ' |
| 112 |
|
| 113 |
.ins-checkout-layout { |
| 114 |
border-left: ' . $ins_panel_border_left . 'px solid !important; |
| 115 |
border-right: ' . $ins_panel_border_right . 'px solid !important; |
| 116 |
border-top: ' . $ins_panel_border_top . 'px solid !important; |
| 117 |
border-bottom: ' . $ins_panel_border_bottom . 'px solid !important; |
| 118 |
border-color: ' . $ins_panel_border_color . ' !important; |
| 119 |
} |
| 120 |
.ins-checkout-layout.ins-hori-right .ins-toggle-btn.tog-1{ |
| 121 |
left: -' . $totalleftButton . 'px; |
| 122 |
} |
| 123 |
.ins-checkout-popup.ins-var-cart-bottom .ins-toggle-btn.tog-2{ |
| 124 |
left: -' . $totalleftButton2 . 'px; |
| 125 |
} |
| 126 |
'; |
| 127 |
} |
| 128 |
|
| 129 |
// Panel Style |
| 130 |
$wi_zindex = isset( $ins_toggle_panel_tab['wi-zindex'] ) ? $ins_toggle_panel_tab['wi-zindex'] : '9999'; |
| 131 |
$panel_width_1200 = isset( $ins_toggle_panel_tab['panel-width-1200'] ) ? $ins_toggle_panel_tab['panel-width-1200'] : '690'; |
| 132 |
$panel_width_1024 = isset( $ins_toggle_panel_tab['panel-width-1024'] ) ? $ins_toggle_panel_tab['panel-width-1024'] : '500'; |
| 133 |
$panel_width_767 = isset( $ins_toggle_panel_tab['panel-width-767'] ) ? $ins_toggle_panel_tab['panel-width-767'] : '400'; |
| 134 |
$wi_inner_bg_colors_regular = isset( $ins_toggle_panel_tab['wi-container-bg'] ) ? $ins_toggle_panel_tab['wi-container-bg'] : ''; |
| 135 |
$ins_panel_text_color = isset( $ins_toggle_panel_tab['ins-panel-text-color'] ) ? $ins_toggle_panel_tab['ins-panel-text-color'] : '#665F5C'; |
| 136 |
|
| 137 |
$output .= ' |
| 138 |
:root { |
| 139 |
--ins_panel_width_1200: ' . $panel_width_1200 . 'px; |
| 140 |
--ins_panel_width_1024: ' . $panel_width_1024 . 'px; |
| 141 |
--ins_panel_width_767: ' . $panel_width_767 . 'px; |
| 142 |
} |
| 143 |
'; |
| 144 |
$output .= ' |
| 145 |
.ins-checkout-layout { |
| 146 |
background-color: ' . $wi_inner_bg_colors_regular . ' !important; |
| 147 |
color: ' . $ins_panel_text_color . ' !important; |
| 148 |
z-index: ' . $wi_zindex . ' !important; |
| 149 |
} |
| 150 |
.ins-checkout-header-title{ |
| 151 |
color: ' . $ins_panel_text_color . ' !important; |
| 152 |
} |
| 153 |
.ins-checkout-modern .ins-checkout-layout.slide.ins-hori-left { |
| 154 |
left: -' . $panel_width_1200 . 'px !important; |
| 155 |
} |
| 156 |
.ins-checkout-modern .ins-checkout-layout.slide.ins-hori-left.active { |
| 157 |
left: 0 !important; |
| 158 |
} |
| 159 |
|
| 160 |
@media (max-width: 1024px) { |
| 161 |
.ins-checkout-modern .ins-checkout-layout.slide.ins-hori-left { |
| 162 |
left: -' . $panel_width_767 . 'px !important; |
| 163 |
} |
| 164 |
} |
| 165 |
|
| 166 |
'; |
| 167 |
|
| 168 |
// Panel Button Color |
| 169 |
$ins_panel_button_bg_regular = isset( $ins_toggle_panel_tab['ins-panel-button-bg']['regular'] ) && ! empty( $ins_toggle_panel_tab['ins-panel-button-bg']['regular'] ) ? $ins_toggle_panel_tab['ins-panel-button-bg']['regular'] : $ins_checkout_theme; |
| 170 |
$ins_panel_button_bg_hover = isset( $ins_toggle_panel_tab['ins-panel-button-bg']['hover'] ) && ! empty( $ins_toggle_panel_tab['ins-panel-button-bg']['hover'] ) ? $ins_toggle_panel_tab['ins-panel-button-bg']['hover'] : $ins_checkout_theme; |
| 171 |
$ins_panel_button_border_regular = isset( $ins_toggle_panel_tab['ins-panel-button-border']['regular'] ) && ! empty( $ins_toggle_panel_tab['ins-panel-button-border']['regular'] ) ? $ins_toggle_panel_tab['ins-panel-button-border']['regular'] : $ins_checkout_theme; |
| 172 |
$ins_panel_button_border_hover = isset( $ins_toggle_panel_tab['ins-panel-button-border']['hover'] ) && ! empty( $ins_toggle_panel_tab['ins-panel-button-border']['hover'] ) ? $ins_toggle_panel_tab['ins-panel-button-border']['hover'] : $ins_checkout_theme; |
| 173 |
$ins_panel_button_text_regular = isset( $ins_toggle_panel_tab['ins-panel-button-text']['regular'] ) && ! empty( $ins_toggle_panel_tab['ins-panel-button-text']['regular'] ) ? $ins_toggle_panel_tab['ins-panel-button-text']['regular'] : '#FCF9F7'; |
| 174 |
$ins_panel_button_text_hover = isset( $ins_toggle_panel_tab['ins-panel-button-text']['hover'] ) && ! empty( $ins_toggle_panel_tab['ins-panel-button-text']['hover'] ) ? $ins_toggle_panel_tab['ins-panel-button-text']['hover'] : '#FCF9F7'; |
| 175 |
|
| 176 |
$output .= ' |
| 177 |
.ins-cart-btns a, .ins-cart-btns button { |
| 178 |
background-color: ' . $ins_panel_button_bg_regular . ' !important; |
| 179 |
color: ' . $ins_panel_button_text_regular . ' !important; |
| 180 |
border-color: ' . $ins_panel_button_border_regular . ' !important; |
| 181 |
} |
| 182 |
.ins-cart-btns a:hover, .ins-cart-btns button:hover { |
| 183 |
background-color: ' . $ins_panel_button_bg_hover . ' !important; |
| 184 |
color: ' . $ins_panel_button_text_hover . ' !important; |
| 185 |
border-color: ' . $ins_panel_button_border_hover . ' !important; |
| 186 |
} |
| 187 |
'; |
| 188 |
|
| 189 |
// Cart Customize Color |
| 190 |
$cart_header_bg = isset( $ins_toggle_panel_tab['cart-header-bg'] ) && ! empty( $ins_toggle_panel_tab['cart-header-bg'] ) ? $ins_toggle_panel_tab['cart-header-bg'] : '#FCF9F7'; |
| 191 |
$cart_header_text = isset( $ins_toggle_panel_tab['cart-header-text'] ) && ! empty( $ins_toggle_panel_tab['cart-header-text'] ) ? $ins_toggle_panel_tab['cart-header-text'] : ''; |
| 192 |
|
| 193 |
$cart_item_bg_wrap = isset( $ins_toggle_panel_tab['cart-item-bg-wrap'] ) && ! empty( $ins_toggle_panel_tab['cart-item-bg-wrap'] ) ? $ins_toggle_panel_tab['cart-item-bg-wrap'] : ''; |
| 194 |
$cart_item_bg = isset( $ins_toggle_panel_tab['cart-item-bg'] ) && ! empty( $ins_toggle_panel_tab['cart-item-bg'] ) ? $ins_toggle_panel_tab['cart-item-bg'] : ''; |
| 195 |
$cart_item_text_color = isset( $ins_toggle_panel_tab['cart-item-text-color'] ) && ! empty( $ins_toggle_panel_tab['cart-item-text-color'] ) ? $ins_toggle_panel_tab['cart-item-text-color'] : ''; |
| 196 |
$cart_input_bg = isset( $ins_toggle_panel_tab['cart-input-bg'] ) && ! empty( $ins_toggle_panel_tab['cart-input-bg'] ) ? $ins_toggle_panel_tab['cart-input-bg'] : ''; |
| 197 |
$cart_input_text_color = isset( $ins_toggle_panel_tab['cart-input-text-color'] ) && ! empty( $ins_toggle_panel_tab['cart-input-text-color'] ) ? $ins_toggle_panel_tab['cart-input-text-color'] : ''; |
| 198 |
$cart_pricing_bg = isset( $ins_toggle_panel_tab['cart-pricing-bg'] ) && ! empty( $ins_toggle_panel_tab['cart-pricing-bg'] ) ? $ins_toggle_panel_tab['cart-pricing-bg'] : ''; |
| 199 |
$cart_pricing_text = isset( $ins_toggle_panel_tab['cart-pricing-text'] ) && ! empty( $ins_toggle_panel_tab['cart-pricing-text'] ) ? $ins_toggle_panel_tab['cart-pricing-text'] : ''; |
| 200 |
|
| 201 |
$cart_button_background_colors_regular = isset( $ins_toggle_panel_tab['cart-button-background-colors']['regular'] ) && ! empty( $ins_toggle_panel_tab['cart-button-background-colors']['regular'] ) ? $ins_toggle_panel_tab['cart-button-background-colors']['regular'] : $ins_panel_button_bg_regular; |
| 202 |
$cart_button_background_colors_hover = isset( $ins_toggle_panel_tab['cart-button-background-colors']['hover'] ) && ! empty( $ins_toggle_panel_tab['cart-button-background-colors']['hover'] ) ? $ins_toggle_panel_tab['cart-button-background-colors']['hover'] : $ins_panel_button_bg_hover; |
| 203 |
|
| 204 |
$cart_coupon_button_background_color = isset( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['background'] ) && ! empty( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['background'] ) ? $ins_toggle_panel_tab['cart-coupon-button-background-colors']['background'] : $ins_panel_button_bg_regular; |
| 205 |
$cart_coupon_button_input_text_color = isset( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['input_text_color'] ) && ! empty( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['input_text_color'] ) ? $ins_toggle_panel_tab['cart-coupon-button-background-colors']['input_text_color'] : '#665F5C'; |
| 206 |
$cart_coupon_button_input_background_color = isset( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['input_background'] ) && ! empty( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['input_background'] ) ? $ins_toggle_panel_tab['cart-coupon-button-background-colors']['input_background'] : '#fff'; |
| 207 |
$cart_coupon_button_text_color = isset( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['text'] ) && ! empty( $ins_toggle_panel_tab['cart-coupon-button-background-colors']['text'] ) ? $ins_toggle_panel_tab['cart-coupon-button-background-colors']['text'] : $ins_panel_button_text_regular; |
| 208 |
|
| 209 |
$cart_empty_button_background_colors_regular = isset( $ins_toggle_panel_tab['cart-empty-button-background-colors']['regular'] ) && ! empty( $ins_toggle_panel_tab['cart-empty-button-background-colors']['regular'] ) ? $ins_toggle_panel_tab['cart-empty-button-background-colors']['regular'] : '#fff'; |
| 210 |
$cart_empty_button_background_colors_hover = isset( $ins_toggle_panel_tab['cart-empty-button-background-colors']['hover'] ) && ! empty( $ins_toggle_panel_tab['cart-empty-button-background-colors']['hover'] ) ? $ins_toggle_panel_tab['cart-empty-button-background-colors']['hover'] : $ins_panel_button_bg_hover; |
| 211 |
|
| 212 |
$cart_button_text_colors_regular = isset( $ins_toggle_panel_tab['cart-button-text-colors']['regular'] ) && ! empty( $ins_toggle_panel_tab['cart-button-text-colors']['regular'] ) ? $ins_toggle_panel_tab['cart-button-text-colors']['regular'] : $ins_panel_button_text_regular; |
| 213 |
$cart_button_text_colors_hover = isset( $ins_toggle_panel_tab['cart-button-text-colors']['hover'] ) && ! empty( $ins_toggle_panel_tab['cart-button-text-colors']['hover'] ) ? $ins_toggle_panel_tab['cart-button-text-colors']['hover'] : $ins_panel_button_text_hover; |
| 214 |
|
| 215 |
$cart_empty_button_text_colors_regular = isset( $ins_toggle_panel_tab['cart-empty-button-text-colors']['regular'] ) && ! empty( $ins_toggle_panel_tab['cart-empty-button-text-colors']['regular'] ) ? $ins_toggle_panel_tab['cart-empty-button-text-colors']['regular'] : $ins_panel_button_bg_hover; |
| 216 |
$cart_empty_button_text_colors_hover = isset( $ins_toggle_panel_tab['cart-empty-button-text-colors']['hover'] ) && ! empty( $ins_toggle_panel_tab['cart-empty-button-text-colors']['hover'] ) ? $ins_toggle_panel_tab['cart-empty-button-text-colors']['hover'] : $ins_panel_button_text_hover; |
| 217 |
|
| 218 |
$cart_empty_text_color = isset( $ins_toggle_panel_tab['empty-cart-text-colors']['text_color'] ) && ! empty( $ins_toggle_panel_tab['empty-cart-text-colors']['text_color'] ) ? $ins_toggle_panel_tab['empty-cart-text-colors']['text_color'] : '#4d423d'; |
| 219 |
$cart_empty_link_color = isset( $ins_toggle_panel_tab['empty-cart-text-colors']['link_color'] ) && ! empty( $ins_toggle_panel_tab['empty-cart-text-colors']['link_color'] ) ? $ins_toggle_panel_tab['empty-cart-text-colors']['link_color'] : $ins_panel_button_bg_regular; |
| 220 |
|
| 221 |
$output .= ' |
| 222 |
.ins-checkout-layout .ins-checkout-header { |
| 223 |
background-color: ' . $cart_header_bg . ' !important; |
| 224 |
} |
| 225 |
.ins-cart-coupon .coupon input { |
| 226 |
background-color: ' . $cart_header_bg . ' !important; |
| 227 |
} |
| 228 |
|
| 229 |
.ins-checkout-header .ins-checkout-header-title { |
| 230 |
color: ' . $cart_header_text . ' !important; |
| 231 |
} |
| 232 |
.ins-checkout-header path { |
| 233 |
fill: ' . $cart_header_text . ' !important; |
| 234 |
} |
| 235 |
.ins-cart-inner.ins-cart-step .ins-cart-content-wrap { |
| 236 |
background-color: ' . $cart_item_bg_wrap . ' !important; |
| 237 |
color: ' . $cart_item_text_color . ' !important; |
| 238 |
} |
| 239 |
.ins-checkout-modern .ins-single-cart-item { |
| 240 |
background-color: ' . $cart_item_bg . ' !important; |
| 241 |
} |
| 242 |
.ins-cart-inner.ins-cart-step .ins-cart-item-heading span { |
| 243 |
color: ' . $cart_item_text_color . ' !important; |
| 244 |
} |
| 245 |
.ins-cart-inner.ins-cart-step .ins-cart-qty-wrap .quantity input[type="number"] { |
| 246 |
background-color: ' . $cart_input_bg . ' !important; |
| 247 |
color: ' . $cart_input_text_color . ' !important; |
| 248 |
} |
| 249 |
.ins-cart-inner.ins-cart-step .ins-cart-footer-content { |
| 250 |
background-color: ' . $cart_pricing_bg . ' !important; |
| 251 |
color: ' . $cart_pricing_text . ' !important; |
| 252 |
} |
| 253 |
|
| 254 |
.ins-cart-inner.ins-cart-step .cart_totals h2, .ins-cart-inner.ins-cart-step td, .ins-cart-inner.ins-cart-step th { |
| 255 |
background-color: ' . $cart_pricing_bg . ' !important; |
| 256 |
color: ' . $cart_pricing_text . ' !important; |
| 257 |
} |
| 258 |
|
| 259 |
.ins-cart-inner.ins-cart-step .ins-cart-btns a, .ins-cart-btns a.active { |
| 260 |
background-color: ' . $cart_button_background_colors_regular . ' !important; |
| 261 |
color: ' . $cart_button_text_colors_regular . ' !important; |
| 262 |
} |
| 263 |
.ins-cart-inner.ins-cart-step .ins-cart-btns a:hover { |
| 264 |
background-color: ' . $cart_button_background_colors_hover . ' !important; |
| 265 |
color: ' . $cart_button_text_colors_hover . ' !important; |
| 266 |
} |
| 267 |
|
| 268 |
.ins-cart-inner.ins-cart-step .ins-cart-coupon .coupon #coupon_code, |
| 269 |
.ins-cart-inner.ins-cart-step .ins-cart-coupon .coupon input::placeholder { |
| 270 |
background-color: ' . $cart_coupon_button_input_background_color . ' !important; |
| 271 |
color: ' . $cart_coupon_button_input_text_color . ' !important; |
| 272 |
border-color: ' . $cart_coupon_button_background_color . ' !important; |
| 273 |
} |
| 274 |
|
| 275 |
.ins-cart-inner.ins-cart-step .ins-cart-coupon .coupon button { |
| 276 |
background-color: ' . $cart_coupon_button_background_color . ' !important; |
| 277 |
color: ' . $cart_coupon_button_text_color . ' !important; |
| 278 |
border-color: ' . $cart_coupon_button_background_color . ' !important; |
| 279 |
} |
| 280 |
|
| 281 |
.ins-cart-inner.ins-cart-step .ins-empty-cart-button .ins-empty-cart { |
| 282 |
background-color: ' . $cart_empty_button_background_colors_regular . ' !important; |
| 283 |
color: ' . $cart_empty_button_text_colors_regular . ' !important; |
| 284 |
} |
| 285 |
|
| 286 |
.ins-cart-inner.ins-cart-step .ins-empty-cart-button .ins-empty-cart:hover { |
| 287 |
background-color: ' . $cart_empty_button_background_colors_hover . ' !important; |
| 288 |
color: ' . $cart_empty_button_text_colors_hover . ' !important; |
| 289 |
} |
| 290 |
|
| 291 |
.ins-cart-empty span { |
| 292 |
color: ' . $cart_empty_text_color . ' !important; |
| 293 |
} |
| 294 |
.ins-cart-empty span a { |
| 295 |
color: ' . $cart_empty_link_color . ' !important; |
| 296 |
} |
| 297 |
|
| 298 |
'; |
| 299 |
|
| 300 |
|
| 301 |
// Quick View Variation |
| 302 |
$wi_quickview_bg = instantio_get_option( 'wi-quickview-bg' ); |
| 303 |
$ins_quickview_color = instantio_get_option( 'ins-quickview-color' ); |
| 304 |
|
| 305 |
|
| 306 |
$wi_quickview_bg = isset( $wi_quickview_bg ) && ! empty( $wi_quickview_bg ) ? $wi_quickview_bg : '#fff'; |
| 307 |
$ins_quickview_color = isset( $ins_quickview_color ) && ! empty( $ins_quickview_color ) ? $ins_quickview_color : '#000'; |
| 308 |
|
| 309 |
$output .= ' |
| 310 |
.ins-quick-view { |
| 311 |
background-color: ' . $wi_quickview_bg . ' !important; |
| 312 |
color: ' . $ins_quickview_color . ' !important; |
| 313 |
} |
| 314 |
'; |
| 315 |
|
| 316 |
// custom css from admin option |
| 317 |
$custom_css = ! empty( instantio_get_option( 'wi-custom-css' ) ) ? instantio_get_option( 'wi-custom-css' ) : ''; |
| 318 |
$output .= $custom_css; |
| 319 |
|
| 320 |
wp_add_inline_style( 'instantio-style', $output ); |
| 321 |
} |
| 322 |
|
| 323 |
public function enqueue_custom_js_scripts() { |
| 324 |
|
| 325 |
$output = ''; |
| 326 |
$auto_open_toggle = instantio_get_option( 'auto-tog-panel' ); |
| 327 |
$disable_ajax_add_cart = instantio_get_option( 'wi-disable-ajax-add-cart' ); |
| 328 |
$cart_fly_anim = isset( instantio_get_option( 'cart-fly' )['cart-fly-anim'] ) ? instantio_get_option( 'cart-fly' )['cart-fly-anim'] : false; |
| 329 |
$cart_fly_icon = isset( instantio_get_option( 'cart-fly' )['cart-fly-icon'] ) ? instantio_get_option( 'cart-fly' )['cart-fly-icon'] : false; |
| 330 |
|
| 331 |
$noquickview = instantio_get_option( 'woins-quickview-disable' ); |
| 332 |
$inssinglesetp = instantio_get_option( 'ins-layout-step' ); |
| 333 |
|
| 334 |
$ins_empty_cart = ! empty( instantio_get_option( 'ins-cart-emty-hide' ) ) ? instantio_get_option( 'ins-cart-emty-hide' ) : false; |
| 335 |
if ( $cart_fly_icon == false ) { |
| 336 |
$cart_icon = ! empty( instantio_get_option( 'ins-toggle-tab' )['cart-icon'] ) ? instantio_get_option( 'ins-toggle-tab' )['cart-icon'] : 'shopping-bag'; |
| 337 |
$wi_icon_choice = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-icon-choice'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-icon-choice'] : 'icon'; |
| 338 |
$wi_icon_choice_uploder = ! empty( instantio_get_option( 'ins-toggle-tab' )['wi-icon-choice-uploder'] ) ? instantio_get_option( 'ins-toggle-tab' )['wi-icon-choice-uploder'] : ''; |
| 339 |
if ( $cart_icon == 'shopping-bag' ) { |
| 340 |
|
| 341 |
$cart_fly_icon = instantio_svg_icon( $cart_icon ); |
| 342 |
} else { |
| 343 |
$cart_fly_icon = '<i class="' . $cart_icon . '"></i>'; |
| 344 |
} |
| 345 |
if ( $wi_icon_choice == 'image' && $wi_icon_choice_uploder != '' ) { |
| 346 |
$cart_fly_icon = '<img src="' . $wi_icon_choice_uploder . '" alt="Icon Image">'; |
| 347 |
} |
| 348 |
} |
| 349 |
$output .= isset( $ins_empty_cart ) && ! empty( $ins_empty_cart ) ? 'var instantio_hide_toggler = ' . $ins_empty_cart . ';' : 'var instantio_hide_toggler = false;'; |
| 350 |
$output .= isset( $auto_open_toggle ) && $auto_open_toggle == true ? 'var instantio_auto_open_toggle = true;' : 'var instantio_auto_open_toggle = false;'; |
| 351 |
$output .= isset( $cart_fly_anim ) && $cart_fly_anim == true ? 'var instantio_cart_fly_anim = true;' : 'var instantio_cart_fly_anim = false;'; |
| 352 |
$output .= isset( $cart_fly_icon ) && $cart_fly_icon != false ? 'var instantio_cart_fly_icon = `' . $cart_fly_icon . '`;' : 'var instantio_cart_fly_icon = false;'; |
| 353 |
$output .= isset( $disable_ajax_add_cart ) && $disable_ajax_add_cart != false ? 'var instantio_disable_ajax_add_cart = ' . $disable_ajax_add_cart . ';' : 'var instantio_disable_ajax_add_cart = false;'; |
| 354 |
|
| 355 |
$output .= isset( $noquickview ) && $noquickview != false ? 'var instantio_no_quick_view = ' . $noquickview . ';' : 'var instantio_no_quick_view = false;'; |
| 356 |
|
| 357 |
$output .= isset( $inssinglesetp ) && $inssinglesetp != false ? 'var instantio_layout_step = ' . $inssinglesetp . ';' : 'var instantio_layout_step = false;'; |
| 358 |
|
| 359 |
wp_add_inline_script( 'instantio-script', $output ); |
| 360 |
} |
| 361 |
} |
| 362 |
|