function wpsc_customizer_assets() { _wpsc_te2_mvc_init(); $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script('wpsc-customizer', wpsc_locate_asset_uri('js/customizer.js'), array('jquery'), WPSC_VERSION, true); wp_enqueue_style('wpsc-customizer', wpsc_locate_asset_uri("css/customizer{$suffix}.css"), array(), WPSC_VERSION); }
function _wpsc_te2_enqueue_styles() { wp_register_style('wpsc-common', wpsc_locate_asset_uri('css/common.css'), array(), WPSC_VERSION); do_action('wpsc_register_styles'); wpsc_enqueue_style('wpsc-common'); wpsc_add_inline_style('wpsc-common', _wpsc_get_inline_style()); do_action('wpsc_enqueue_styles'); }
function _wpsc_te2_register_scripts() { wp_register_script('wpsc-select-autocomplete', wpsc_locate_asset_uri('js/jquery.select-to-autocomplete.js'), array('jquery-ui-autocomplete'), '1.0.5'); wp_register_script('wpsc-country-region', wpsc_locate_asset_uri('js/country-region.js'), array('wpsc-select-autocomplete', 'jquery'), WPSC_VERSION); wp_register_script('wpsc-copy-billing-info', wpsc_locate_asset_uri('js/copy-billing-info.js'), array('jquery'), WPSC_VERSION); wp_register_script('wpsc-shipping-price-simulator', wpsc_locate_asset_uri('js/shipping-price-simulator.js'), array('jquery'), WPSC_VERSION); wp_register_script('wpsc-checkout-payment', wpsc_locate_asset_uri('js/checkout-payment.js'), array('jquery'), WPSC_VERSION); do_action('wpsc_register_scripts'); do_action('wpsc_enqueue_scripts'); }
function _wpsc_te2_enqueue_styles() { $do_minified = apply_filters('wpsc_use_minified_styles', !(defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)); $suffix = $do_minified ? '.min' : ''; wp_register_style('wpsc-common', wpsc_locate_asset_uri("css/common{$suffix}.css"), array(), WPSC_VERSION); wp_register_style('wpsc-responsive', wpsc_locate_asset_uri("css/wpsc-responsive{$suffix}.css"), array(), WPSC_VERSION); do_action('wpsc_register_styles'); wp_enqueue_style('wpsc-common'); wp_enqueue_style('wpsc-responsive'); if (apply_filters('wpsc_add_inline_style', true)) { wp_add_inline_style('wpsc-common', _wpsc_get_inline_style()); } do_action('wpsc_enqueue_styles'); }
function _wpsc_te2_register_scripts() { $engine = WPSC_Template_Engine::get_instance(); $scripts = apply_filters('wpsc_registered_scripts', $engine->get_core_scripts_data()); foreach ($scripts as $handle => $script_data) { wp_register_script($handle, wpsc_locate_asset_uri($script_data['path']), $script_data['dependencies'], $script_data['version'], !isset($script_data['in_footer']) || $script_data['in_footer']); } $enqueued = false; foreach ($engine->get_queued_scripts() as $handle => $script_data) { $enqueued = true; _wpsc_enqueue_and_localize_script($handle, $script_data); } // Output our namespace. ?> <script type='text/javascript'>/* <![CDATA[ */window.WPSC = window.WPSC || {};/* ]]> */</script><?php do_action('wpsc_register_scripts'); do_action('wpsc_enqueue_scripts'); }
private function category_image($cat) { $img = wpsc_get_categorymeta($cat->term_id, 'image'); if ($img) { $url = WPSC_CATEGORY_URL . $img; } else { $url = wpsc_locate_asset_uri('images/noimage.png'); } echo "<img src='" . esc_url($url) . "' width='" . esc_attr($this->instance['width']) . "' height='" . esc_attr($this->instance['height']) . "' />"; }
/** * Output a dummy thumbnail image in case the current product in the loop does not have a specified * featured thumbnail. * * @since 4.0 * @uses $_wp_additional_image_size The array containing registered image sizes * @uses apply_filters() Applies 'wpsc_product_no_thumbnail_url' filter * @uses apply_filters() Applies 'wpsc_product_no_thumbnail_html' filter * * @param string $size Optional. If this is not specified, the appropriate size will be detected based on the current page being viewed. See {@link wpsc_get_product_thumbnail()} for a list of available sizes you can use. * @param string $attr Optional. Query string or array of attributes. Defaults to ''. */ function wpsc_product_no_thumbnail_image($size = false, $attr = '') { global $_wp_additional_image_sizes; // automatically detect the correct $size if it's not specified if (!$size) { if (is_singular('wpsc-product')) { $size = 'single'; } elseif (is_tax('wpsc_product_category') || is_tax('product_tag')) { $size = 'taxonomy'; } elseif (wpsc_is_cart() || wpsc_is_customer_account() || wpsc_is_checkout()) { $size = 'cart'; } else { $size = 'archive'; } } if (is_string($size)) { $wp_size = $size; if (in_array($size, array('single', 'taxonomy', 'cart', 'archive'))) { $wp_size = 'wpsc_product_' . $size . '_thumbnail'; } if (array_key_exists($wp_size, $_wp_additional_image_sizes)) { $dimensions = $_wp_additional_image_sizes[$wp_size]; } else { $dimensions = array('width' => '', 'height' => ''); } } elseif (is_array($size) && count($size) == 2) { $dimensions = array('width' => $size[0], 'height' => $size[1]); } else { return; } $title = wpsc_product_title_attribute(array('echo' => false)); $src = apply_filters('wpsc_product_no_thumbnail_url', wpsc_locate_asset_uri('images/noimage.png'), $size, $attr); $html = '<img alt="' . $title . '" src="' . $src . '" title="' . $title . '" width="' . $dimensions['width'] . '" height="' . $dimensions['height'] . '" />'; $html = apply_filters('wpsc_product_no_thumbnail_html', $html, $size, $attr); echo $html; }