Skip to content

Instantly share code, notes, and snippets.

@kloon
Created March 15, 2013 08:31
Show Gist options
  • Save kloon/5168330 to your computer and use it in GitHub Desktop.
Save kloon/5168330 to your computer and use it in GitHub Desktop.
WooCommerce add PrettyPhoto/Lightbox to the checkout page for use
<?php
add_action( 'wp_enqueue_scripts', 'checkout_lightbox' );
function checkout_lightbox() {
global $woocommerce;
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
if ( is_checkout() ) {
wp_enqueue_script( 'prettyPhoto', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
wp_enqueue_script( 'prettyPhoto-init', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto.init' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
wp_enqueue_style( 'woocommerce_prettyPhoto_css', $woocommerce->plugin_url() . '/assets/css/prettyPhoto.css' );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment