Merge branch 'master' of git://github.com/woothemes/woocommerce

This commit is contained in:
Manos Psychogyiopoulos 2012-06-26 16:18:27 +03:00
commit 8514661ade
7 changed files with 152 additions and 48 deletions

View File

@ -176,7 +176,7 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
}
?>
<div class="wrap woocommerce">
<form method="post" id="mainform" action="">
<form method="post" id="mainform" action="" enctype="multipart/form-data">
<div class="icon32 icon32-woocommerce-settings" id="icon-woocommerce"><br /></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php
$tabs = array(

View File

@ -1 +1,80 @@
.woocommerce-message{position:relative;z-index:100;border:1px solid #b76ca9!important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 15px rgba(0,0,0,0.04);-moz-box-shadow:inset 0 0 15px rgba(0,0,0,0.04);box-shadow:inset 0 0 15px rgba(0,0,0,0.04);overflow:hidden;padding:10px 0 10px!important;background:#cc99c2 url(../images/message.png) no-repeat right bottom!important}.woocommerce-message .squeezer{max-width:960px;margin:0;padding:0 10px;text-align:left;overflow:hidden}.woocommerce-message h4{margin:0 10px 0 0;font-size:18px;line-height:36px;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;font-weight:normal;color:#fff;text-shadow:0 1px 1px #b574a8;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;float:left;vertical-align:middle}.woocommerce-message p{margin:0!important;padding:2px 0!important;float:left!important;line-height:32px;vertical-align:middle}.woocommerce-message p a.button-primary{font-size:16px!important;line-height:16px!important;margin:0 5px 0 0;padding:6px 15px;vertical-align:middle;color:#fff;text-align:center;text-decoration:none;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:1px solid #88537e;background:#a46497;-moz-box-shadow:inset 0 0 2px #fff,0 1px 1px rgba(0,0,0,0.1);-webkit-box-shadow:inset 0 0 2px #fff,0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 0 2px #fff,0 1px 1px rgba(0,0,0,0.1);text-shadow:0 -1px 0 rgba(0,0,0,0.3);-webkit-transition-duration:.3s;-moz-transition-duration:.3s;cursor:pointer;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif}.woocommerce-message p a.button-primary:hover,.woocommerce-message p a.button-primary:active{background-color:#f0a000;border-color:#c87800;-webkit-transition-duration:.3s;outline:0;opacity:1}.woocommerce-message p a.skip,.woocommerce-message p a.docs{opacity:.5}.woocommerce-message .twitter-share-button{vertical-align:middle}
.woocommerce-message {
position: relative;
z-index: 100;
border: 1px solid #b76ca9 !important;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04);
-moz-box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04);
box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04);
overflow: hidden;
padding: 10px 0 10px !important;
background: #cc99c2 url(../images/message.png) no-repeat right bottom !important;
}
.woocommerce-message .squeezer {
max-width: 960px;
margin: 0;
padding: 0 10px;
text-align: left;
overflow: hidden;
}
.woocommerce-message h4 {
margin: 0 10px 0 0;
font-size: 18px;
line-height: 36px;
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", Verdana, "Bitstream Vera Sans", sans-serif;
font-weight: normal;
color: #fff;
text-shadow: 0px 1px 1px #b574a8;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
float: left;
vertical-align: middle;
}
.woocommerce-message p {
margin: 0 !important;
padding: 2px 0 !important;
float: left !important;
line-height: 32px;
vertical-align: middle;
}
.woocommerce-message p a.button-primary {
font-size: 16px !important;
line-height: 16px !important;
margin: 0 5px 0 0;
padding: 6px 15px;
vertical-align: middle;
color: #fff;
text-align: center;
text-decoration: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: 1px solid #88537e;
background: #a46497;
-moz-box-shadow: inset 0 0 2px #ffffff, 0 1px 1px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: inset 0 0 2px #ffffff, 0 1px 1px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 2px #ffffff, 0 1px 1px rgba(0, 0, 0, 0.1);
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.3);
-webkit-transition-duration: .3s;
-moz-transition-duration: .3s;
cursor: pointer;
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", Verdana, "Bitstream Vera Sans", sans-serif;
}
.woocommerce-message p a.button-primary:hover,
.woocommerce-message p a.button-primary:active {
background-color: #f0a000;
border-color: #c87800;
-webkit-transition-duration: .3s;
outline: none;
opacity: 1;
}
.woocommerce-message p a.skip,
.woocommerce-message p a.docs {
opacity: 0.5;
}
.woocommerce-message .twitter-share-button {
vertical-align: middle;
}

View File

@ -22,6 +22,7 @@ class WC_Product_Variation extends WC_Product {
var $variation_has_stock;
var $variation_has_sku;
var $variation_shipping_class;
var $variation_shipping_class_id;
var $variation_has_tax_class;
/**
@ -281,6 +282,21 @@ class WC_Product_Variation extends WC_Product {
return $this->variation_shipping_class;
}
/** Returns the product shipping class ID */
function get_shipping_class_id() {
if ( ! $this->variation_shipping_class_id ) {
$classes = get_the_terms( $this->variation_id, 'product_shipping_class' );
if ( $classes && ! is_wp_error( $classes ) )
$this->variation_shipping_class_id = current( $classes )->term_id;
else
$this->variation_shipping_class_id = parent::get_shipping_class_id();
}
return (int) $this->variation_shipping_class_id;
}
}
/** Depreciated */

View File

@ -150,6 +150,10 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
== Changelog ==
* Fix - Widget init function conflict with widget logic
* Fix - PLN currency code
* Fix - Variation get shipping class ID
= 1.5.8 - 21/06/2012 =
* Tweak - Textarea for notes and enabled HTML
* Tweak - Added checkout processing triggers for gateways (in particular stripe) to use

View File

@ -6,44 +6,49 @@
* @category Widgets
* @author WooThemes
*/
if (is_active_widget( false, false, 'woocommerce_layered_nav', 'true' ) && !is_admin()) :
add_action('init', 'woocommerce_layered_nav_init', 1);
add_filter('loop_shop_post_in', 'woocommerce_layered_nav_query');
endif;
/**
* Layered Nav Init
*/
add_action( 'init', 'woocommerce_layered_nav_init', 1 );
function woocommerce_layered_nav_init( ) {
global $_chosen_attributes, $woocommerce, $_attributes_array;
$_chosen_attributes = array();
$_attributes_array = array();
if ( is_active_widget( false, false, 'woocommerce_layered_nav', true ) && ! is_admin() ) {
$attribute_taxonomies = $woocommerce->attribute_taxonomies;
if ( $attribute_taxonomies ) :
foreach ($attribute_taxonomies as $tax) :
global $_chosen_attributes, $woocommerce, $_attributes_array;
$attribute = strtolower(sanitize_title($tax->attribute_name));
$taxonomy = $woocommerce->attribute_taxonomy_name($attribute);
$_chosen_attributes = array();
$_attributes_array = array();
// create an array of product attribute taxonomies
$_attributes_array[] = $taxonomy;
$attribute_taxonomies = $woocommerce->attribute_taxonomies;
if ( $attribute_taxonomies ) {
foreach ( $attribute_taxonomies as $tax ) {
$name = 'filter_' . $attribute;
$query_type_name = 'query_type_' . $attribute;
$attribute = strtolower(sanitize_title($tax->attribute_name));
$taxonomy = $woocommerce->attribute_taxonomy_name($attribute);
if (isset($_GET[$name]) && $_GET[$name] && taxonomy_exists($taxonomy)) :
$_chosen_attributes[$taxonomy]['terms'] = explode(',', $_GET[$name] );
if (isset($_GET[$query_type_name]) && $_GET[$query_type_name]=='or') :
$_chosen_attributes[$taxonomy]['query_type'] = 'or';
else :
$_chosen_attributes[$taxonomy]['query_type'] = 'and';
endif;
endif;
endforeach;
endif;
// create an array of product attribute taxonomies
$_attributes_array[] = $taxonomy;
$name = 'filter_' . $attribute;
$query_type_name = 'query_type_' . $attribute;
if ( ! empty( $_GET[$name] ) && taxonomy_exists( $taxonomy ) ) {
$_chosen_attributes[$taxonomy]['terms'] = explode( ',', $_GET[ $name ] );
if ( ! empty( $_GET[$query_type_name] ) && $_GET[ $query_type_name ] == 'or' )
$_chosen_attributes[$taxonomy]['query_type'] = 'or';
else
$_chosen_attributes[$taxonomy]['query_type'] = 'and';
}
}
}
add_filter('loop_shop_post_in', 'woocommerce_layered_nav_query');
}
}
/**

View File

@ -9,26 +9,26 @@
* @author WooThemes
*/
if (is_active_widget( false, false, 'price_filter', 'true' ) && !is_admin()) :
add_action('init', 'woocommerce_price_filter_init');
add_filter('loop_shop_post_in', 'woocommerce_price_filter');
endif;
/**
* Price filter Init
*/
add_action( 'init', 'woocommerce_price_filter_init' );
function woocommerce_price_filter_init() {
unset($_SESSION['min_price']);
unset($_SESSION['max_price']);
if ( is_active_widget( false, false, 'price_filter', true ) && ! is_admin() ) {
if (isset($_GET['min_price'])) :
$_SESSION['min_price'] = $_GET['min_price'];
endif;
if (isset($_GET['max_price'])) :
$_SESSION['max_price'] = $_GET['max_price'];
endif;
unset( $_SESSION['min_price'] );
unset( $_SESSION['max_price'] );
if ( isset( $_GET['min_price'] ) )
$_SESSION['min_price'] = $_GET['min_price'];
if ( isset( $_GET['max_price'] ) )
$_SESSION['max_price'] = $_GET['max_price'];
add_filter( 'loop_shop_post_in', 'woocommerce_price_filter' );
}
}
/**

View File

@ -343,7 +343,7 @@ function get_woocommerce_currency_symbol( $currency = '' ) {
case 'HUF' : $currency_symbol = '&#70;&#116;'; break;
case 'ILS' : $currency_symbol = '&#8362;'; break;
case 'PHP' : $currency_symbol = '&#8369;'; break;
case 'PLN' : $currency_symbol = '&#322;&#122;'; break;
case 'PLN' : $currency_symbol = '&#122;&#322;'; break;
case 'SEK' : $currency_symbol = '&#107;&#114;'; break;
case 'CHF' : $currency_symbol = '&#67;&#72;&#70;'; break;
case 'TWD' : $currency_symbol = '&#78;&#84;&#36;'; break;