errors)) self::$errors = jigoshop_session::instance()->errors; if (isset(jigoshop_session::instance()->messages)) self::$messages = jigoshop_session::instance()->messages; unset( jigoshop_session::instance()->messages ); unset( jigoshop_session::instance()->errors ); // uses jigoshop_base_class to provide class address for the filter self::add_filter( 'wp_redirect', 'redirect', 1, 2 ); } /** * This is deprecated as of ver 0.9.9.2 - use jigoshop_product.class version. * * @deprecated */ public static function getAttributeTaxonomies() { return jigoshop_product::getAttributeTaxonomies(); } /** * Get the assets url * Provide a filter to allow asset location elsewhere such as on a CDN * * @return string url */ public static function assets_url() { return apply_filters( 'jigoshop_assets_url', self::plugin_url() ); } /** * Get the plugin url * * @return string url */ public static function plugin_url() { if ( empty( self::$plugin_url )) : self::$plugin_url = self::force_ssl( plugins_url( null, dirname(__FILE__))); endif; return self::$plugin_url; } /** * Get the plugin path * * @return string url */ public static function plugin_path() { if(self::$plugin_path) return self::$plugin_path; return self::$plugin_path = WP_PLUGIN_DIR . "/" . plugin_basename( dirname(dirname(__FILE__))); } /** * Return the URL with https if SSL is on * * @return string url */ public static function force_ssl( $url ) { if (is_ssl()) $url = str_replace('http:', 'https:', $url); return $url; } /** * Get a var * * Variable is filtered by jigoshop_get_var_{var name} * * @param string var * @return string variable */ public static function get_var($var) { $return = ''; switch ($var) : case "shop_small_w" : $return = self::SHOP_SMALL_W; break; case "shop_small_h" : $return = self::SHOP_SMALL_H; break; case "shop_tiny_w" : $return = self::SHOP_TINY_W; break; case "shop_tiny_h" : $return = self::SHOP_TINY_H; break; case "shop_thumbnail_w" : $return = self::SHOP_THUMBNAIL_W; break; case "shop_thumbnail_h" : $return = self::SHOP_THUMBNAIL_H; break; case "shop_large_w" : $return = self::SHOP_LARGE_W; break; case "shop_large_h" : $return = self::SHOP_LARGE_H; break; endswitch; return apply_filters( 'jigoshop_get_var_'.$var, $return ); } /** * Add an error * * @param string error */ public static function add_error( $error ) { self::$errors[] = $error; } /** * Add a message * * @param string message */ public static function add_message( $message ) { self::$messages[] = $message; } /** Clear messages and errors from the session data */ public static function clear_messages() { self::$errors = self::$messages = array(); unset( jigoshop_session::instance()->messages ); unset( jigoshop_session::instance()->errors ); } /** * Get error count * * @return int */ public static function error_count() { return sizeof(self::$errors); } /** * Get message count * * @return int */ public static function message_count() { return sizeof(self::$messages); } /** * Output the errors and messages * * @return bool */ public static function show_messages() { if (isset(self::$errors) && sizeof(self::$errors)>0) : echo '