Merge remote-tracking branch 'upstream/master'
|
@ -113,7 +113,7 @@ function woocommerce_custom_order_columns($column) {
|
||||||
endif;
|
endif;
|
||||||
break;
|
break;
|
||||||
case "total_cost" :
|
case "total_cost" :
|
||||||
echo woocommerce_price($order->order_total);
|
echo $order->get_formatted_order_total();
|
||||||
break;
|
break;
|
||||||
case "order_date" :
|
case "order_date" :
|
||||||
|
|
||||||
|
|
|
@ -487,6 +487,7 @@ function woocommerce_order_totals_meta_box($post) {
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
<?php do_action( 'woocommerce_admin_order_totals_after_shipping', $post->ID ) ?>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="totals_group">
|
<div class="totals_group">
|
||||||
|
|
|
@ -32,7 +32,7 @@ function woocommerce_product_data_box() {
|
||||||
|
|
||||||
<li class="inventory_tab show_if_simple show_if_variable show_if_grouped inventory_options"><a href="#inventory_product_data"><?php _e('Inventory', 'woocommerce'); ?></a></li>
|
<li class="inventory_tab show_if_simple show_if_variable show_if_grouped inventory_options"><a href="#inventory_product_data"><?php _e('Inventory', 'woocommerce'); ?></a></li>
|
||||||
|
|
||||||
<li class="upsells_and_crosssells_tab crosssell_options"><a href="#upsells_and_crosssells_product_data"><?php _e('Up-sells/Cross-sells', 'woocommerce'); ?></a></li>
|
<li class="related_product_tab related_product_options"><a href="#related_product_data"><?php _e('Related Products', 'woocommerce'); ?></a></li>
|
||||||
|
|
||||||
<li class="attributes_tab attribute_options"><a href="#woocommerce_attributes"><?php _e('Attributes', 'woocommerce'); ?></a></li>
|
<li class="attributes_tab attribute_options"><a href="#woocommerce_attributes"><?php _e('Attributes', 'woocommerce'); ?></a></li>
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ function woocommerce_product_data_box() {
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="upsells_and_crosssells_product_data" class="panel woocommerce_options_panel">
|
<div id="related_product_data" class="panel woocommerce_options_panel">
|
||||||
|
|
||||||
<p class="form-field"><label for="upsell_ids"><?php _e('Up-Sells', 'woocommerce'); ?></label>
|
<p class="form-field"><label for="upsell_ids"><?php _e('Up-Sells', 'woocommerce'); ?></label>
|
||||||
<select id="upsell_ids" name="upsell_ids[]" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php _e('Search for a product…', 'woocommerce'); ?>">
|
<select id="upsell_ids" name="upsell_ids[]" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php _e('Search for a product…', 'woocommerce'); ?>">
|
||||||
|
@ -452,6 +452,8 @@ function woocommerce_product_data_box() {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select> <img class="help_tip" data-tip='<?php _e('Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce') ?>' src="<?php echo $woocommerce->plugin_url(); ?>/assets/images/help.png" /></p>
|
</select> <img class="help_tip" data-tip='<?php _e('Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce') ?>' src="<?php echo $woocommerce->plugin_url(); ?>/assets/images/help.png" /></p>
|
||||||
|
|
||||||
|
<?php do_action('woocommerce_product_options_related'); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="grouping_product_data" class="panel woocommerce_options_panel">
|
<div id="grouping_product_data" class="panel woocommerce_options_panel">
|
||||||
|
|
|
@ -221,4 +221,62 @@ function woocommerce_delete_term( $term_id, $tt_id, $taxonomy ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
$wpdb->query("DELETE FROM {$wpdb->woocommerce_termmeta} WHERE `woocommerce_term_id` = " . $term_id);
|
$wpdb->query("DELETE FROM {$wpdb->woocommerce_termmeta} WHERE `woocommerce_term_id` = " . $term_id);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compile styles
|
||||||
|
*/
|
||||||
|
function woocommerce_compile_less_styles() {
|
||||||
|
global $woocommerce;
|
||||||
|
|
||||||
|
$colors = get_option( 'woocommerce_frontend_css_colors' );
|
||||||
|
$base_file = $woocommerce->plugin_path() . '/assets/css/woocommerce-base.less';
|
||||||
|
$less_file = $woocommerce->plugin_path() . '/assets/css/woocommerce.less';
|
||||||
|
$css_file = $woocommerce->plugin_path() . '/assets/css/woocommerce.css';
|
||||||
|
|
||||||
|
// Write less file
|
||||||
|
if ( is_writable( $base_file ) && is_writable( $css_file ) ) {
|
||||||
|
|
||||||
|
// Colours changed - recompile less
|
||||||
|
include_once('includes/lessc.inc.php');
|
||||||
|
include_once('includes/cssmin.inc.php');
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Set default if colours not set
|
||||||
|
if ( ! $colors['primary'] ) $colors['primary'] = '#ad74a2';
|
||||||
|
if ( ! $colors['secondary'] ) $colors['secondary'] = '#f7f6f7';
|
||||||
|
if ( ! $colors['highlight'] ) $colors['highlight'] = '#85ad74';
|
||||||
|
if ( ! $colors['content_bg'] ) $colors['content_bg'] = '#ffffff';
|
||||||
|
if ( ! $colors['subtext'] ) $colors['subtext'] = '#777777';
|
||||||
|
|
||||||
|
// Write new color to base file
|
||||||
|
$color_rules = "
|
||||||
|
@primary: " . $colors['primary'] . ";
|
||||||
|
@primarytext: " . woocommerce_light_or_dark( $colors['primary'], 'desaturate(darken(@primary,50%),18%)', 'desaturate(lighten(@primary,50%),18%)' ) . ";
|
||||||
|
|
||||||
|
@secondary: " . $colors['secondary'] . ";
|
||||||
|
@secondarytext: " . woocommerce_light_or_dark( $colors['secondary'], 'desaturate(darken(@secondary,60%),18%)', 'desaturate(lighten(@secondary,60%),18%)' ) . ";
|
||||||
|
|
||||||
|
@highlight: " . $colors['highlight'] . ";
|
||||||
|
@highlightext: " . woocommerce_light_or_dark( $colors['highlight'], 'desaturate(darken(@highlight,60%),18%)', 'desaturate(lighten(@highlight,60%),18%)' ) . ";
|
||||||
|
|
||||||
|
@contentbg: " . $colors['content_bg'] . ";
|
||||||
|
|
||||||
|
@subtext: " . $colors['subtext'] . ";
|
||||||
|
";
|
||||||
|
|
||||||
|
file_put_contents( $base_file, $color_rules );
|
||||||
|
|
||||||
|
$less = new lessc( $less_file );
|
||||||
|
$compiled_css = $less->parse();
|
||||||
|
|
||||||
|
$compiled_css = CssMin::minify( $compiled_css );
|
||||||
|
|
||||||
|
if ( $compiled_css )
|
||||||
|
file_put_contents( $css_file, $compiled_css );
|
||||||
|
|
||||||
|
} catch ( exception $ex ) {
|
||||||
|
wp_die( __('Could not compile woocommerce.less: ', 'woocommerce') . $ex->getMessage() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -48,6 +48,33 @@ function do_install_woocommerce() {
|
||||||
// Clear transient cache
|
// Clear transient cache
|
||||||
$woocommerce->clear_product_transients();
|
$woocommerce->clear_product_transients();
|
||||||
|
|
||||||
|
// Recompile LESS styles if they are custom
|
||||||
|
if ( get_option('woocommerce_frontend_css') == 'yes' ) {
|
||||||
|
|
||||||
|
// Handle Colour Settings
|
||||||
|
$colors = get_option( 'woocommerce_frontend_css_colors' );
|
||||||
|
|
||||||
|
if ( (
|
||||||
|
! empty( $colors['primary'] ) &&
|
||||||
|
! empty( $colors['secondary'] ) &&
|
||||||
|
! empty( $colors['highlight'] ) &&
|
||||||
|
! empty( $colors['content_bg'] ) &&
|
||||||
|
! empty( $colors['subtext'] )
|
||||||
|
) && (
|
||||||
|
$colors['primary'] != '#ad74a2' ||
|
||||||
|
$colors['secondary'] != '#f7f6f7' ||
|
||||||
|
$colors['highlight'] != '#85ad74' ||
|
||||||
|
$colors['content_bg'] != '#ffffff' ||
|
||||||
|
$colors['subtext'] != '#777777'
|
||||||
|
) ) {
|
||||||
|
|
||||||
|
// Write less file
|
||||||
|
woocommerce_compile_less_styles();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Update version
|
// Update version
|
||||||
update_option( "woocommerce_db_version", $woocommerce->version );
|
update_option( "woocommerce_db_version", $woocommerce->version );
|
||||||
}
|
}
|
||||||
|
@ -85,7 +112,7 @@ function woocommerce_default_options() {
|
||||||
|
|
||||||
foreach ($section as $value) :
|
foreach ($section as $value) :
|
||||||
|
|
||||||
if (isset($value['std'])) :
|
if (isset($value['std']) && isset($value['id'])) :
|
||||||
|
|
||||||
if ($value['type']=='image_width') :
|
if ($value['type']=='image_width') :
|
||||||
|
|
||||||
|
|
|
@ -1490,19 +1490,32 @@ function woocommerce_stock_overview() {
|
||||||
<h3><span><?php _e('Low stock', 'woocommerce'); ?></span></h3>
|
<h3><span><?php _e('Low stock', 'woocommerce'); ?></span></h3>
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<?php
|
<?php
|
||||||
if ($low_in_stock) :
|
if ( $low_in_stock ) {
|
||||||
echo '<ul class="stock_list">';
|
echo '<ul class="stock_list">';
|
||||||
foreach ($low_in_stock as $product) :
|
foreach ( $low_in_stock as $product ) {
|
||||||
$stock = (int) get_post_meta($product->ID, '_stock', true);
|
|
||||||
|
$stock = (int) get_post_meta( $product->ID, '_stock', true );
|
||||||
|
$sku = get_post_meta( $product->ID, '_sku', true );
|
||||||
|
|
||||||
if ( $stock <= $nostockamount ) continue;
|
if ( $stock <= $nostockamount ) continue;
|
||||||
echo '<li><a href="';
|
|
||||||
if ($product->post_type=='product') echo admin_url('post.php?post='.$product->ID.'&action=edit'); else echo admin_url('post.php?post='.$product->post_parent.'&action=edit');
|
$title = $product->post_title;
|
||||||
echo '"><small>' . sprintf( _n('%d in stock', '%d in stock', $stock, 'woocommerce'), $stock ) . '</small> ' . $product->post_title . '</a></li>';
|
|
||||||
endforeach;
|
if ( $sku )
|
||||||
|
$title .= ' (' . __('SKU', 'woocommerce') . ': ' . $sku . ')';
|
||||||
|
|
||||||
|
if ( $product->post_type=='product' )
|
||||||
|
$product_url = admin_url( 'post.php?post=' . $product->ID . '&action=edit' );
|
||||||
|
else
|
||||||
|
$product_url = admin_url( 'post.php?post=' . $product->post_parent . '&action=edit' );
|
||||||
|
|
||||||
|
printf( '<li><a href="%s"><small>' . _n('%d in stock', '%d in stock', $stock, 'woocommerce') . '</small> %s</a></li>', $product_url, $stock, $title );
|
||||||
|
|
||||||
|
}
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
else :
|
} else {
|
||||||
echo '<p>'.__('No products are low in stock.', 'woocommerce').'</p>';
|
echo '<p>'.__('No products are low in stock.', 'woocommerce').'</p>';
|
||||||
endif;
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1512,19 +1525,32 @@ function woocommerce_stock_overview() {
|
||||||
<h3><span><?php _e('Out of stock', 'woocommerce'); ?></span></h3>
|
<h3><span><?php _e('Out of stock', 'woocommerce'); ?></span></h3>
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<?php
|
<?php
|
||||||
if ($low_in_stock) :
|
if ( $low_in_stock ) {
|
||||||
echo '<ul class="stock_list">';
|
echo '<ul class="stock_list">';
|
||||||
foreach ($low_in_stock as $product) :
|
foreach ( $low_in_stock as $product ) {
|
||||||
$stock = (int) get_post_meta($product->ID, '_stock', true);
|
|
||||||
|
$stock = (int) get_post_meta( $product->ID, '_stock', true );
|
||||||
|
$sku = get_post_meta( $product->ID, '_sku', true );
|
||||||
|
|
||||||
if ( $stock > $nostockamount ) continue;
|
if ( $stock > $nostockamount ) continue;
|
||||||
echo '<li><a href="';
|
|
||||||
if ($product->post_type=='product') echo admin_url('post.php?post='.$product->ID.'&action=edit'); else echo admin_url('post.php?post='.$product->post_parent.'&action=edit');
|
$title = $product->post_title;
|
||||||
echo '"><small>' . sprintf( _n('%d in stock', '%d in stock', $stock, 'woocommerce'), $stock ) . '</small> ' . $product->post_title . '</a></li>';
|
|
||||||
endforeach;
|
if ( $sku )
|
||||||
|
$title .= ' (' . __('SKU', 'woocommerce') . ': ' . $sku . ')';
|
||||||
|
|
||||||
|
if ( $product->post_type=='product' )
|
||||||
|
$product_url = admin_url( 'post.php?post=' . $product->ID . '&action=edit' );
|
||||||
|
else
|
||||||
|
$product_url = admin_url( 'post.php?post=' . $product->post_parent . '&action=edit' );
|
||||||
|
|
||||||
|
printf( '<li><a href="%s"><small>' . _n('%d in stock', '%d in stock', $stock, 'woocommerce') . '</small> %s</a></li>', $product_url, $stock, $title );
|
||||||
|
|
||||||
|
}
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
else :
|
} else {
|
||||||
echo '<p>'.__('No products are out in stock.', 'woocommerce').'</p>';
|
echo '<p>'.__('No products are out in stock.', 'woocommerce').'</p>';
|
||||||
endif;
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -17,7 +17,7 @@ function woocommerce_update_options($options) {
|
||||||
if ( empty( $_POST ) ) return false;
|
if ( empty( $_POST ) ) return false;
|
||||||
|
|
||||||
foreach ( $options as $value ) {
|
foreach ( $options as $value ) {
|
||||||
if (isset($value['id']) && $value['id']=='woocommerce_tax_rates') :
|
if ( isset( $value['id'] ) && $value['id'] == 'woocommerce_tax_rates' ) {
|
||||||
|
|
||||||
// Tax rates saving
|
// Tax rates saving
|
||||||
$tax_rates = array();
|
$tax_rates = array();
|
||||||
|
@ -128,32 +128,32 @@ function woocommerce_update_options($options) {
|
||||||
|
|
||||||
update_option( 'woocommerce_local_tax_rates', $local_tax_rates );
|
update_option( 'woocommerce_local_tax_rates', $local_tax_rates );
|
||||||
|
|
||||||
elseif (isset($value['type']) && $value['type']=='multi_select_countries') :
|
} elseif ( isset( $value['type'] ) && $value['type'] == 'multi_select_countries' ) {
|
||||||
|
|
||||||
// Get countries array
|
// Get countries array
|
||||||
if (isset($_POST[$value['id']])) $selected_countries = $_POST[$value['id']]; else $selected_countries = array();
|
if (isset($_POST[$value['id']])) $selected_countries = $_POST[$value['id']]; else $selected_countries = array();
|
||||||
update_option($value['id'], $selected_countries);
|
update_option($value['id'], $selected_countries);
|
||||||
|
|
||||||
elseif ( isset($value['id']) && ( $value['id'] == 'woocommerce_price_thousand_sep' || $value['id'] == 'woocommerce_price_decimal_sep' ) ):
|
} elseif ( isset( $value['id'] ) && ( $value['id'] == 'woocommerce_price_thousand_sep' || $value['id'] == 'woocommerce_price_decimal_sep' ) ) {
|
||||||
|
|
||||||
// price separators get a special treatment as they should allow a spaces (don't trim)
|
// price separators get a special treatment as they should allow a spaces (don't trim)
|
||||||
if( isset( $_POST[ $value['id'] ] ) ) {
|
if ( isset( $_POST[ $value['id'] ] ) ) {
|
||||||
update_option($value['id'], $_POST[$value['id']] );
|
update_option($value['id'], $_POST[$value['id']] );
|
||||||
} else {
|
} else {
|
||||||
delete_option($value['id']);
|
delete_option($value['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif (isset($value['type']) && $value['type']=='checkbox') :
|
} elseif ( isset( $value['type'] ) && $value['type'] == 'checkbox' ) {
|
||||||
|
|
||||||
if(isset($value['id']) && isset($_POST[$value['id']])) {
|
if ( isset( $value['id'] ) && isset( $_POST[$value['id']] ) ) {
|
||||||
update_option($value['id'], 'yes');
|
update_option($value['id'], 'yes');
|
||||||
} else {
|
} else {
|
||||||
update_option($value['id'], 'no');
|
update_option($value['id'], 'no');
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif (isset($value['type']) && $value['type']=='image_width') :
|
} elseif (isset( $value['type'] ) && $value['type'] == 'image_width' ) {
|
||||||
|
|
||||||
if(isset($value['id']) && isset($_POST[$value['id'].'_width'])) {
|
if ( isset( $value['id'] ) && isset( $_POST[$value['id'] . '_width'] ) ) {
|
||||||
update_option($value['id'].'_width', woocommerce_clean($_POST[$value['id'].'_width']));
|
update_option($value['id'].'_width', woocommerce_clean($_POST[$value['id'].'_width']));
|
||||||
update_option($value['id'].'_height', woocommerce_clean($_POST[$value['id'].'_height']));
|
update_option($value['id'].'_height', woocommerce_clean($_POST[$value['id'].'_height']));
|
||||||
if (isset($_POST[$value['id'].'_crop'])) :
|
if (isset($_POST[$value['id'].'_crop'])) :
|
||||||
|
@ -166,16 +166,20 @@ function woocommerce_update_options($options) {
|
||||||
update_option($value['id'].'_height', $value['std']);
|
update_option($value['id'].'_height', $value['std']);
|
||||||
update_option($value['id'].'_crop', 1);
|
update_option($value['id'].'_crop', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} elseif ( isset( $value['type'] ) && $value['type'] == 'woocommerce_frontend_css_colors' ) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else :
|
} else {
|
||||||
|
|
||||||
if(isset($value['id']) && isset($_POST[$value['id']])) {
|
if ( isset( $value['id'] ) && isset( $_POST[$value['id']] ) ) {
|
||||||
update_option($value['id'], woocommerce_clean($_POST[$value['id']]));
|
update_option($value['id'], woocommerce_clean($_POST[$value['id']]));
|
||||||
} else {
|
} elseif( isset( $value['id'] ) ) {
|
||||||
delete_option($value['id']);
|
delete_option($value['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -190,6 +194,7 @@ function woocommerce_admin_fields($options) {
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
|
|
||||||
foreach ( $options as $value ) {
|
foreach ( $options as $value ) {
|
||||||
|
if ( ! isset( $value['type'] ) ) continue;
|
||||||
if ( ! isset( $value['name'] ) ) $value['name'] = '';
|
if ( ! isset( $value['name'] ) ) $value['name'] = '';
|
||||||
if ( ! isset( $value['class'] ) ) $value['class'] = '';
|
if ( ! isset( $value['class'] ) ) $value['class'] = '';
|
||||||
if ( ! isset( $value['css'] ) ) $value['css'] = '';
|
if ( ! isset( $value['css'] ) ) $value['css'] = '';
|
||||||
|
@ -197,8 +202,10 @@ function woocommerce_admin_fields($options) {
|
||||||
if ( ! isset( $value['desc'] ) ) $value['desc'] = '';
|
if ( ! isset( $value['desc'] ) ) $value['desc'] = '';
|
||||||
if ( ! isset( $value['desc_tip'] ) ) $value['desc_tip'] = false;
|
if ( ! isset( $value['desc_tip'] ) ) $value['desc_tip'] = false;
|
||||||
|
|
||||||
if ( $value['desc_tip'] ) {
|
if ( $value['desc_tip'] === true ) {
|
||||||
$description = '<img class="help_tip" data-tip="' . esc_attr( $value['desc'] ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" />';
|
$description = '<img class="help_tip" data-tip="' . esc_attr( $value['desc'] ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" />';
|
||||||
|
} elseif ( $value['desc_tip'] ) {
|
||||||
|
$description = '<img class="help_tip" data-tip="' . esc_attr( $value['desc_tip'] ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" />';
|
||||||
} else {
|
} else {
|
||||||
$description = '<span class="description">' . $value['desc'] . '</span>';
|
$description = '<span class="description">' . $value['desc'] . '</span>';
|
||||||
}
|
}
|
||||||
|
@ -217,13 +224,17 @@ function woocommerce_admin_fields($options) {
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
||||||
|
</th>
|
||||||
<td class="forminp"><input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="<?php echo esc_attr( $value['type'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" value="<?php if ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) { echo esc_attr( stripslashes( get_option($value['id'] ) ) ); } else { echo esc_attr( $value['std'] ); } ?>" /> <?php echo $description; ?></td>
|
<td class="forminp"><input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="<?php echo esc_attr( $value['type'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" value="<?php if ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) { echo esc_attr( stripslashes( get_option($value['id'] ) ) ); } else { echo esc_attr( $value['std'] ); } ?>" /> <?php echo $description; ?></td>
|
||||||
</tr><?php
|
</tr><?php
|
||||||
break;
|
break;
|
||||||
case 'color' :
|
case 'color' :
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
||||||
|
</th>
|
||||||
<td class="forminp"><input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="text" style="<?php echo esc_attr( $value['css'] ); ?>" value="<?php if ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) { echo esc_attr( stripslashes( get_option($value['id'] ) ) ); } else { echo esc_attr( $value['std'] ); } ?>" class="colorpick" /> <?php echo $description; ?> <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ); ?>" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div></td>
|
<td class="forminp"><input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="text" style="<?php echo esc_attr( $value['css'] ); ?>" value="<?php if ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) { echo esc_attr( stripslashes( get_option($value['id'] ) ) ); } else { echo esc_attr( $value['std'] ); } ?>" class="colorpick" /> <?php echo $description; ?> <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ); ?>" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div></td>
|
||||||
</tr><?php
|
</tr><?php
|
||||||
break;
|
break;
|
||||||
|
@ -243,7 +254,9 @@ function woocommerce_admin_fields($options) {
|
||||||
break;
|
break;
|
||||||
case 'select':
|
case 'select':
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
||||||
|
</th>
|
||||||
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" class="<?php if (isset($value['class'])) echo $value['class']; ?>">
|
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" class="<?php if (isset($value['class'])) echo $value['class']; ?>">
|
||||||
<?php
|
<?php
|
||||||
foreach ($value['options'] as $key => $val) {
|
foreach ($value['options'] as $key => $val) {
|
||||||
|
@ -290,7 +303,7 @@ function woocommerce_admin_fields($options) {
|
||||||
<legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend>
|
<legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend>
|
||||||
<label for="<?php echo $value['id'] ?>">
|
<label for="<?php echo $value['id'] ?>">
|
||||||
<input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="checkbox" value="1" <?php checked(get_option($value['id']), 'yes'); ?> />
|
<input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="checkbox" value="1" <?php checked(get_option($value['id']), 'yes'); ?> />
|
||||||
<?php echo $value['desc'] ?></label><br />
|
<?php echo $value['desc'] ?></label> <?php if ( $value['desc_tip'] ) echo $description; ?><br />
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup']=='end')) :
|
if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup']=='end')) :
|
||||||
|
@ -308,7 +321,9 @@ function woocommerce_admin_fields($options) {
|
||||||
break;
|
break;
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
||||||
|
</th>
|
||||||
<td class="forminp">
|
<td class="forminp">
|
||||||
<textarea <?php if ( isset($value['args']) ) echo $value['args'] . ' '; ?>name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>"><?php if (false !== get_option($value['id'])) echo esc_textarea(stripslashes(get_option($value['id']))); else echo esc_textarea( $value['std'] ); ?></textarea> <?php echo $description; ?>
|
<textarea <?php if ( isset($value['args']) ) echo $value['args'] . ' '; ?>name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>"><?php if (false !== get_option($value['id'])) echo esc_textarea(stripslashes(get_option($value['id']))); else echo esc_textarea( $value['std'] ); ?></textarea> <?php echo $description; ?>
|
||||||
</td>
|
</td>
|
||||||
|
@ -346,7 +361,9 @@ function woocommerce_admin_fields($options) {
|
||||||
$state = '*';
|
$state = '*';
|
||||||
endif;
|
endif;
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="rpw" class="titledesc"><?php echo $value['name'] ?></th>
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
||||||
|
</th>
|
||||||
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" data-placeholder="<?php _e('Choose a country…', 'woocommerce'); ?>" title="Country" class="chosen_select">
|
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" data-placeholder="<?php _e('Choose a country…', 'woocommerce'); ?>" title="Country" class="chosen_select">
|
||||||
<?php echo $woocommerce->countries->country_dropdown_options($country, $state); ?>
|
<?php echo $woocommerce->countries->country_dropdown_options($country, $state); ?>
|
||||||
</select> <?php echo $description; ?>
|
</select> <?php echo $description; ?>
|
||||||
|
@ -358,7 +375,9 @@ function woocommerce_admin_fields($options) {
|
||||||
asort($countries);
|
asort($countries);
|
||||||
$selections = (array) get_option($value['id']);
|
$selections = (array) get_option($value['id']);
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
||||||
|
</th>
|
||||||
<td class="forminp">
|
<td class="forminp">
|
||||||
<select multiple="multiple" name="<?php echo esc_attr( $value['id'] ); ?>[]" style="width:450px;" data-placeholder="<?php _e('Choose countries…', 'woocommerce'); ?>" title="Country" class="chosen_select">
|
<select multiple="multiple" name="<?php echo esc_attr( $value['id'] ); ?>[]" style="width:450px;" data-placeholder="<?php _e('Choose countries…', 'woocommerce'); ?>" title="Country" class="chosen_select">
|
||||||
<?php
|
<?php
|
||||||
|
@ -702,6 +721,57 @@ function woocommerce_admin_fields($options) {
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
break;
|
break;
|
||||||
|
case 'woocommerce_frontend_css_colors' :
|
||||||
|
|
||||||
|
?><tr valign="top" class="woocommerce_frontend_css_colors">
|
||||||
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
||||||
|
</th>
|
||||||
|
<td class="forminp"><?php
|
||||||
|
|
||||||
|
$base_file = $woocommerce->plugin_path() . '/assets/css/woocommerce-base.less';
|
||||||
|
$css_file = $woocommerce->plugin_path() . '/assets/css/woocommerce.css';
|
||||||
|
|
||||||
|
if ( is_writable( $base_file ) && is_writable( $css_file ) ) {
|
||||||
|
|
||||||
|
// Get settings
|
||||||
|
$colors = (array) get_option( 'woocommerce_frontend_css_colors' );
|
||||||
|
|
||||||
|
// Defaults
|
||||||
|
if ( empty( $colors['primary'] ) ) $colors['primary'] = '#ad74a2';
|
||||||
|
if ( empty( $colors['secondary'] ) ) $colors['secondary'] = '#f7f6f7';
|
||||||
|
if ( empty( $colors['highlight'] ) ) $colors['highlight'] = '#85ad74';
|
||||||
|
if ( empty( $colors['content_bg'] ) ) $colors['content_bg'] = '#ffffff';
|
||||||
|
|
||||||
|
// Show inputs
|
||||||
|
woocommerce_frontend_css_color_picker( __('Primary', 'woocommerce'), 'woocommerce_frontend_css_primary', $colors['primary'], __('Call to action buttons/price slider/layered nav UI', 'woocommerce') );
|
||||||
|
woocommerce_frontend_css_color_picker( __('Secondary', 'woocommerce'), 'woocommerce_frontend_css_secondary', $colors['secondary'], __('Buttons and tabs', 'woocommerce') );
|
||||||
|
woocommerce_frontend_css_color_picker( __('Highlight', 'woocommerce'), 'woocommerce_frontend_css_highlight', $colors['highlight'], __('Price labels and Sale Flashes', 'woocommerce') );
|
||||||
|
|
||||||
|
echo '<div class="color_box_clear clear"></div>';
|
||||||
|
|
||||||
|
woocommerce_frontend_css_color_picker( __('Content BG', 'woocommerce'), 'woocommerce_frontend_css_content_bg', $colors['content_bg'], __('Your themes page background - used for tab active states', 'woocommerce') );
|
||||||
|
woocommerce_frontend_css_color_picker( __('Subtext', 'woocommerce'), 'woocommerce_frontend_css_subtext', $colors['subtext'], __('Used for certain text and asides - breadcrumbs, small text etc.', 'woocommerce') );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
echo '<span class="description">' . __( 'To edit colours <code>woocommerce/assets/css/woocommerce-base.less</code> and <code>woocommerce.css</code> need to be writable. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.', 'woocommerce' ) . '</span>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
<script type="text/javascript">
|
||||||
|
jQuery('input#woocommerce_frontend_css').change(function() {
|
||||||
|
if (jQuery(this).is(':checked')) {
|
||||||
|
jQuery('tr.woocommerce_frontend_css_colors').show();
|
||||||
|
} else {
|
||||||
|
jQuery('tr.woocommerce_frontend_css_colors').hide();
|
||||||
|
}
|
||||||
|
}).change();
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
|
||||||
default:
|
default:
|
||||||
do_action( 'woocommerce_admin_field_'.$value['type'], $value );
|
do_action( 'woocommerce_admin_field_'.$value['type'], $value );
|
||||||
break;
|
break;
|
||||||
|
@ -709,6 +779,19 @@ function woocommerce_admin_fields($options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Color Picker Input
|
||||||
|
*
|
||||||
|
* Shows a color picker for our options
|
||||||
|
*/
|
||||||
|
function woocommerce_frontend_css_color_picker( $name, $id, $value, $desc = '' ) {
|
||||||
|
global $woocommerce;
|
||||||
|
|
||||||
|
echo '<div class="color_box"><strong><img class="help_tip" data-tip="' . $desc . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" /> ' . $name . '</strong>
|
||||||
|
<input name="' . esc_attr( $id ). '" id="' . $id . '" type="text" value="' . esc_attr( $value ) . '" class="colorpick" /> <div id="colorPickerDiv_' . esc_attr( $id ) . '" class="colorpickdiv"></div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tax Row Label
|
* Tax Row Label
|
||||||
|
|
|
@ -15,6 +15,14 @@
|
||||||
*/
|
*/
|
||||||
global $woocommerce_settings;
|
global $woocommerce_settings;
|
||||||
|
|
||||||
|
$localisation_setting = ( defined('WPLANG') ) ? array(
|
||||||
|
'name' => __('Localisation', 'woocommerce'),
|
||||||
|
'desc' => __('Use informal localisation file if it exists', 'woocommerce'),
|
||||||
|
'id' => 'woocommerce_informal_localisation_type',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'std' => 'no',
|
||||||
|
) : array();
|
||||||
|
|
||||||
$woocommerce_settings['general'] = apply_filters('woocommerce_general_settings', array(
|
$woocommerce_settings['general'] = apply_filters('woocommerce_general_settings', array(
|
||||||
|
|
||||||
array( 'name' => __( 'General Options', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
|
array( 'name' => __( 'General Options', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
|
||||||
|
@ -32,7 +40,6 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
array(
|
array(
|
||||||
'name' => __( 'Currency', 'woocommerce' ),
|
'name' => __( 'Currency', 'woocommerce' ),
|
||||||
'desc' => __("This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.", 'woocommerce' ),
|
'desc' => __("This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.", 'woocommerce' ),
|
||||||
'tip' => '',
|
|
||||||
'id' => 'woocommerce_currency',
|
'id' => 'woocommerce_currency',
|
||||||
'css' => 'min-width:300px;',
|
'css' => 'min-width:300px;',
|
||||||
'std' => 'GBP',
|
'std' => 'GBP',
|
||||||
|
@ -94,30 +101,42 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'type' => 'multi_select_countries'
|
'type' => 'multi_select_countries'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
$localisation_setting,
|
||||||
'name' => __('Localisation', 'woocommerce'),
|
|
||||||
'desc' => __('Use informal localisation file if it exists', 'woocommerce'),
|
|
||||||
'id' => 'woocommerce_informal_localisation_type',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'std' => 'no',
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'general_options'),
|
array( 'type' => 'sectionend', 'id' => 'general_options'),
|
||||||
|
|
||||||
array( 'name' => __( 'Checkout and Accounts', 'woocommerce' ), 'type' => 'title','desc' => __('The following options control the behaviour of the checkout process and customer accounts.', 'woocommerce'), 'id' => 'checkout_account_options' ),
|
array( 'name' => __( 'Checkout and Accounts', 'woocommerce' ), 'type' => 'title','desc' => __('The following options control the behaviour of the checkout process and customer accounts.', 'woocommerce'), 'id' => 'checkout_account_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'name' => __( 'Checkout', 'woocommerce' ),
|
||||||
|
'desc' => __( 'Enable guest checkout (no account required)', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_enable_guest_checkout',
|
||||||
|
'std' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start'
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Show order comments section', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_enable_order_comments',
|
||||||
|
'std' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end'
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'name' => __( 'Security', 'woocommerce' ),
|
'name' => __( 'Security', 'woocommerce' ),
|
||||||
'desc' => __( 'Force <abbr title="Secure Sockets Layer, a computing protocol that ensures the security of data sent via the Internet by using encryption">SSL</abbr>/HTTPS (an SSL Certificate is required)', 'woocommerce' ),
|
'desc' => __( 'Force secure checkout', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_force_ssl_checkout',
|
'id' => 'woocommerce_force_ssl_checkout',
|
||||||
'std' => 'no',
|
'std' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => 'start',
|
||||||
'show_if_checked' => 'option',
|
'show_if_checked' => 'option',
|
||||||
|
'desc_tip' => __('Force SSL (HTTPS) on the checkout pages (an SSL Certificate is required)', 'woocommerce'),
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Un-force <abbr title="Secure Sockets Layer, a computing protocol that ensures the security of data sent via the Internet by using encryption">SSL</abbr>/HTTPS when leaving the checkout', 'woocommerce' ),
|
'desc' => __( 'Un-force HTTPS when leaving the checkout', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_unforce_ssl_checkout',
|
'id' => 'woocommerce_unforce_ssl_checkout',
|
||||||
'std' => 'no',
|
'std' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -127,7 +146,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'name' => __( 'Coupons', 'woocommerce' ),
|
'name' => __( 'Coupons', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable the use of coupons', 'woocommerce' ),
|
'desc' => __( 'Enable coupons', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_coupons',
|
'id' => 'woocommerce_enable_coupons',
|
||||||
'std' => 'yes',
|
'std' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -143,26 +162,9 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'checkboxgroup' => 'end',
|
'checkboxgroup' => 'end',
|
||||||
'show_if_checked' => 'yes'
|
'show_if_checked' => 'yes'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __( 'Checkout', 'woocommerce' ),
|
|
||||||
'desc' => __( 'Enable Guest Checkout (no account required)', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_enable_guest_checkout',
|
|
||||||
'std' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'start'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Show order comments section', 'woocommerce' ),
|
'name' => __( 'Registration', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_order_comments',
|
|
||||||
'std' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'end'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __( 'Customer Accounts', 'woocommerce' ),
|
|
||||||
'desc' => __( 'Allow unregistered users to register from the Checkout', 'woocommerce' ),
|
'desc' => __( 'Allow unregistered users to register from the Checkout', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_signup_and_login_from_checkout',
|
'id' => 'woocommerce_enable_signup_and_login_from_checkout',
|
||||||
'std' => 'yes',
|
'std' => 'yes',
|
||||||
|
@ -175,9 +177,18 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'id' => 'woocommerce_enable_myaccount_registration',
|
'id' => 'woocommerce_enable_myaccount_registration',
|
||||||
'std' => 'no',
|
'std' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => ''
|
'checkboxgroup' => 'end'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'name' => __( 'Customer Accounts', 'woocommerce' ),
|
||||||
|
'desc' => __( 'Prevent customers from accessing WordPress admin', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_lock_down_admin',
|
||||||
|
'std' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start'
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Clear cart when logging out', 'woocommerce' ),
|
'desc' => __( 'Clear cart when logging out', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_clear_cart_on_logout',
|
'id' => 'woocommerce_clear_cart_on_logout',
|
||||||
|
@ -187,15 +198,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Prevent customers from accessing WordPress admin', 'woocommerce' ),
|
'desc' => __( 'Allow customers to repurchase past orders', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_lock_down_admin',
|
|
||||||
'std' => 'no',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => ''
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Allow customers to reorder items from past orders', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_allow_customers_to_reorder',
|
'id' => 'woocommerce_allow_customers_to_reorder',
|
||||||
'std' => 'no',
|
'std' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -208,19 +211,25 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'name' => __( 'Styling', 'woocommerce' ),
|
'name' => __( 'Styling', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable WooCommerce CSS styles', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_frontend_css',
|
|
||||||
'std' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'start'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Enable the "Demo Store" notice on your site', 'woocommerce' ),
|
'desc' => __( 'Enable the "Demo Store" notice on your site', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_demo_store',
|
'id' => 'woocommerce_demo_store',
|
||||||
'std' => 'no',
|
'std' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end'
|
'checkboxgroup' => 'start'
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Enable WooCommerce CSS styles', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_frontend_css',
|
||||||
|
'std' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end'
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'name' => __( 'Colours', 'woocommerce' ),
|
||||||
|
'std' => '#ad74a2',
|
||||||
|
'type' => 'woocommerce_frontend_css_colors'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
@ -241,7 +250,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Enable "chosen" (enhanced select input) for country selection inputs', 'woocommerce' ),
|
'desc' => __( 'Enable enhanced country select boxes', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_chosen',
|
'id' => 'woocommerce_enable_chosen',
|
||||||
'std' => 'yes',
|
'std' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -285,29 +294,32 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'name' => __('Require login to download', 'woocommerce'),
|
'name' => __('Access Restrictions', 'woocommerce'),
|
||||||
'desc' => __('Do not allow downloads if a user is not logged in. This setting does not apply to guest downloads.', 'woocommerce'),
|
'desc' => __('Must be logged in to download files', 'woocommerce'),
|
||||||
'id' => 'woocommerce_downloads_require_login',
|
'id' => 'woocommerce_downloads_require_login',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'std' => 'no',
|
'std' => 'no',
|
||||||
|
'desc_tip' => __('This setting does not apply to guest downloads.', 'woocommerce'),
|
||||||
|
'checkboxgroup' => 'start'
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __('Grant access to downloadable products after payment', 'woocommerce'),
|
||||||
|
'id' => 'woocommerce_downloads_grant_access_after_payment',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'std' => 'yes',
|
||||||
|
'desc_tip' => __('Turn this option off to only grant access when an order is "complete", rather than "processing"', 'woocommerce'),
|
||||||
|
'checkboxgroup' => 'end'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'name' => __('Limit quantity', 'woocommerce'),
|
'name' => __('Limit quantity', 'woocommerce'),
|
||||||
'desc' => __( 'Limit the purchasable quantity of downloadable-virtual items to 1.', 'woocommerce' ),
|
'desc' => __( 'Limit the purchasable quantity of downloadable-virtual items to 1', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_limit_downloadable_product_qty',
|
'id' => 'woocommerce_limit_downloadable_product_qty',
|
||||||
'std' => 'yes',
|
'std' => 'yes',
|
||||||
'type' => 'checkbox'
|
'type' => 'checkbox'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __('Mixed cart handling', 'woocommerce'),
|
|
||||||
'desc' => __('Grant access to downloadable products after payment. Turn this option off to only grant access when an order is "complete".', 'woocommerce'),
|
|
||||||
'id' => 'woocommerce_downloads_grant_access_after_payment',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'std' => 'yes',
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'digital_download_options' ),
|
array( 'type' => 'sectionend', 'id' => 'digital_download_options' ),
|
||||||
|
|
||||||
)); // End general settings
|
)); // End general settings
|
||||||
|
@ -644,12 +656,8 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
),
|
),
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'product_data_options' ),
|
|
||||||
|
|
||||||
array( 'name' => __( 'Product Reviews', 'woocommerce' ), 'type' => 'title', 'desc' => __('The following options affect product reviews (comments).', 'woocommerce'), 'id' => 'product_review_options' ),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'name' => __( 'Ratings', 'woocommerce' ),
|
'name' => __( 'Product Ratings', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable the star rating field on the review form', 'woocommerce' ),
|
'desc' => __( 'Enable the star rating field on the review form', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_review_rating',
|
'id' => 'woocommerce_enable_review_rating',
|
||||||
'std' => 'yes',
|
'std' => 'yes',
|
||||||
|
@ -825,6 +833,21 @@ $woocommerce_settings['inventory'] = apply_filters('woocommerce_inventory_settin
|
||||||
'type' => 'checkbox'
|
'type' => 'checkbox'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'name' => __( 'Stock display format', 'woocommerce' ),
|
||||||
|
'desc' => __( 'This controls how stock is displayed on the frontend.', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_stock_format',
|
||||||
|
'css' => 'min-width:150px;',
|
||||||
|
'std' => '',
|
||||||
|
'type' => 'select',
|
||||||
|
'options' => array(
|
||||||
|
'' => __( 'Always show stock e.g. "12 in stock"', 'woocommerce' ),
|
||||||
|
'low_amount' => __( 'Only show stock when low e.g. "Only 2 left in stock" vs. "In Stock"', 'woocommerce' ),
|
||||||
|
'no_amount' => __( 'Never show stock amount', 'woocommerce' ),
|
||||||
|
),
|
||||||
|
'desc_tip' => true,
|
||||||
|
),
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'inventory_options'),
|
array( 'type' => 'sectionend', 'id' => 'inventory_options'),
|
||||||
|
|
||||||
)); // End inventory settings
|
)); // End inventory settings
|
||||||
|
@ -875,6 +898,14 @@ $woocommerce_settings['shipping'] = apply_filters('woocommerce_shipping_settings
|
||||||
'id' => 'woocommerce_ship_to_same_address',
|
'id' => 'woocommerce_ship_to_same_address',
|
||||||
'std' => 'yes',
|
'std' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => ''
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Collect shipping address even when not required', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_require_shipping_address',
|
||||||
|
'std' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end'
|
'checkboxgroup' => 'end'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -1078,63 +1109,6 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
|
||||||
|
|
||||||
)); // End email settings
|
)); // End email settings
|
||||||
|
|
||||||
$woocommerce_settings['integration'] = apply_filters('woocommerce_intregation_settings', array(
|
|
||||||
|
|
||||||
array( 'name' => __( 'ShareThis', 'woocommerce' ), 'type' => 'title', 'desc' => __('ShareThis offers a sharing widget which will allow customers to share links to products with their friends.', 'woocommerce'), 'id' => 'share_this' ),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __( 'ShareThis Publisher ID', 'woocommerce' ),
|
|
||||||
'desc' => sprintf( __( 'Enter your %1$sShareThis publisher ID%2$s to show social sharing buttons on product pages.', 'woocommerce' ), '<a href="http://sharethis.com/account/">', '</a>' ),
|
|
||||||
'id' => 'woocommerce_sharethis',
|
|
||||||
'type' => 'text',
|
|
||||||
'std' => '',
|
|
||||||
'css' => 'min-width:300px;',
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'share_this'),
|
|
||||||
|
|
||||||
array( 'name' => __( 'ShareDaddy', 'woocommerce' ), 'type' => 'title', 'desc' => __('ShareDaddy is a sharing plugin bundled with JetPack.', 'woocommerce'), 'id' => 'share_this' ),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __( 'Output ShareDaddy button?', 'woocommerce' ),
|
|
||||||
'desc' => __( 'Enable this option to show the ShareDaddy button (if installed) on the product page.', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_sharedaddy',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'std' => 'no',
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'share_this'),
|
|
||||||
|
|
||||||
array( 'name' => __( 'Google Analytics', 'woocommerce' ), 'type' => 'title', 'desc' => __('Google Analytics is a free service offered by Google that generates detailed statistics about the visitors to a website.', 'woocommerce'), 'id' => 'google_analytics' ),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __('Google Analytics ID', 'woocommerce'),
|
|
||||||
'desc' => __('Log into your google analytics account to find your ID. e.g. <code>UA-XXXXX-X</code>', 'woocommerce'),
|
|
||||||
'id' => 'woocommerce_ga_id',
|
|
||||||
'type' => 'text',
|
|
||||||
'css' => 'min-width:300px;',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __('Tracking code', 'woocommerce'),
|
|
||||||
'desc' => __('Add tracking code to your site\'s footer. You don\'t need to enable this if using a 3rd party analytics plugin.', 'woocommerce'),
|
|
||||||
'id' => 'woocommerce_ga_standard_tracking_enabled',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'start'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'name' => __('Tracking code', 'woocommerce'),
|
|
||||||
'desc' => __('Add eCommerce tracking code to the thankyou page', 'woocommerce'),
|
|
||||||
'id' => 'woocommerce_ga_ecommerce_tracking_enabled',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'end'
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'google_analytics'),
|
|
||||||
|
|
||||||
)); // End integration settings
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings page
|
* Settings page
|
||||||
*
|
*
|
||||||
|
@ -1144,16 +1118,21 @@ if (!function_exists('woocommerce_settings')) {
|
||||||
function woocommerce_settings() {
|
function woocommerce_settings() {
|
||||||
global $woocommerce, $woocommerce_settings;
|
global $woocommerce, $woocommerce_settings;
|
||||||
|
|
||||||
$current_tab = ( empty( $_GET['tab'] ) ) ? 'general' : urldecode( $_GET['tab'] );
|
// Get current tab/section
|
||||||
$current_section = ( empty( $_GET['section'] ) ) ? '' : urldecode( $_GET['section'] );
|
$current_tab = ( empty( $_GET['tab'] ) ) ? 'general' : urldecode( $_GET['tab'] );
|
||||||
|
$current_section = ( empty( $_REQUEST['section'] ) ) ? '' : urldecode( $_REQUEST['section'] );
|
||||||
|
|
||||||
// Save settings
|
// Save settings
|
||||||
if ( ! empty( $_POST ) ) {
|
if ( ! empty( $_POST ) ) {
|
||||||
|
|
||||||
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) )
|
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) )
|
||||||
die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
|
die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
|
||||||
|
|
||||||
if ( ! $current_section ) {
|
if ( ! $current_section ) {
|
||||||
|
|
||||||
|
$old_base_color = get_option('woocommerce_frontend_css_base_color');
|
||||||
|
$old_base_color = get_option('woocommerce_frontend_css_base_color');
|
||||||
|
|
||||||
switch ( $current_tab ) {
|
switch ( $current_tab ) {
|
||||||
case "general" :
|
case "general" :
|
||||||
case "pages" :
|
case "pages" :
|
||||||
|
@ -1162,13 +1141,38 @@ function woocommerce_settings() {
|
||||||
case "shipping" :
|
case "shipping" :
|
||||||
case "tax" :
|
case "tax" :
|
||||||
case "email" :
|
case "email" :
|
||||||
case "integration" :
|
|
||||||
woocommerce_update_options( $woocommerce_settings[$current_tab] );
|
woocommerce_update_options( $woocommerce_settings[$current_tab] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action( 'woocommerce_update_options' );
|
do_action( 'woocommerce_update_options' );
|
||||||
do_action( 'woocommerce_update_options_' . $current_tab );
|
do_action( 'woocommerce_update_options_' . $current_tab );
|
||||||
|
|
||||||
|
// Handle Colour Settings
|
||||||
|
if ( $current_tab == 'general' && get_option('woocommerce_frontend_css') == 'yes' ) {
|
||||||
|
|
||||||
|
// Save settings
|
||||||
|
$primary = ( ! empty( $_POST['woocommerce_frontend_css_primary'] ) ) ? woocommerce_format_hex( $_POST['woocommerce_frontend_css_primary'] ) : '';
|
||||||
|
$secondary = ( ! empty( $_POST['woocommerce_frontend_css_secondary'] ) ) ? woocommerce_format_hex( $_POST['woocommerce_frontend_css_secondary'] ) : '';
|
||||||
|
$highlight = ( ! empty( $_POST['woocommerce_frontend_css_highlight'] ) ) ? woocommerce_format_hex( $_POST['woocommerce_frontend_css_highlight'] ) : '';
|
||||||
|
$content_bg = ( ! empty( $_POST['woocommerce_frontend_css_content_bg'] ) ) ? woocommerce_format_hex( $_POST['woocommerce_frontend_css_content_bg'] ) : '';
|
||||||
|
$subtext = ( ! empty( $_POST['woocommerce_frontend_css_subtext'] ) ) ? woocommerce_format_hex( $_POST['woocommerce_frontend_css_subtext'] ) : '';
|
||||||
|
|
||||||
|
$colors = array(
|
||||||
|
'primary' => $primary,
|
||||||
|
'secondary' => $secondary,
|
||||||
|
'highlight' => $highlight,
|
||||||
|
'content_bg' => $content_bg,
|
||||||
|
'subtext' => $subtext
|
||||||
|
);
|
||||||
|
|
||||||
|
$old_colors = get_option( 'woocommerce_frontend_css_colors' );
|
||||||
|
update_option( 'woocommerce_frontend_css_colors', $colors );
|
||||||
|
|
||||||
|
if ( $old_colors != $colors )
|
||||||
|
woocommerce_compile_less_styles();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1182,7 +1186,7 @@ function woocommerce_settings() {
|
||||||
unset($_SESSION['orderby']);
|
unset($_SESSION['orderby']);
|
||||||
$woocommerce->clear_product_transients();
|
$woocommerce->clear_product_transients();
|
||||||
|
|
||||||
// Redirect back
|
// Redirect back to the settings page
|
||||||
$redirect = add_query_arg( 'saved', 'true' );
|
$redirect = add_query_arg( 'saved', 'true' );
|
||||||
|
|
||||||
if ( ! empty( $_POST['subtab'] ) ) $redirect = add_query_arg( 'subtab', esc_attr( str_replace( '#', '', $_POST['subtab'] ) ), $redirect );
|
if ( ! empty( $_POST['subtab'] ) ) $redirect = add_query_arg( 'subtab', esc_attr( str_replace( '#', '', $_POST['subtab'] ) ), $redirect );
|
||||||
|
@ -1190,13 +1194,28 @@ function woocommerce_settings() {
|
||||||
wp_redirect( $redirect );
|
wp_redirect( $redirect );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings saved message
|
// Get any returned messages
|
||||||
|
$error = ( empty( $_GET['wc_error'] ) ) ? '' : urldecode( stripslashes( $_GET['wc_error'] ) );
|
||||||
|
$message = ( empty( $_GET['wc_message'] ) ) ? '' : urldecode( stripslashes( $_GET['wc_message'] ) );
|
||||||
|
|
||||||
|
if ( $error || $message ) {
|
||||||
|
|
||||||
|
if ( $error ) {
|
||||||
|
echo '<div id="message" class="error fade"><p><strong>' . wptexturize( $error ) . '</strong></p></div>';
|
||||||
|
} else {
|
||||||
|
echo '<div id="message" class="updated fade"><p><strong>' . wptexturize( $message ) . '</strong></p></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
} elseif ( ! empty( $_GET['saved'] ) ) {
|
||||||
|
|
||||||
|
echo '<div id="message" class="updated fade"><p><strong>' . __( 'Your settings have been saved.', 'woocommerce' ) . '</strong></p></div>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Were the settings saved?
|
||||||
if ( ! empty( $_GET['saved'] ) ) {
|
if ( ! empty( $_GET['saved'] ) ) {
|
||||||
echo '<div id="message" class="updated fade"><p><strong>' . __( 'Your settings have been saved.', 'woocommerce' ) . '</strong></p></div>';
|
|
||||||
|
|
||||||
flush_rewrite_rules( false );
|
flush_rewrite_rules( false );
|
||||||
|
|
||||||
do_action('woocommerce_settings_saved');
|
do_action('woocommerce_settings_saved');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1282,7 +1301,6 @@ function woocommerce_settings() {
|
||||||
case "inventory" :
|
case "inventory" :
|
||||||
case "tax" :
|
case "tax" :
|
||||||
case "email" :
|
case "email" :
|
||||||
case "integration" :
|
|
||||||
woocommerce_admin_fields( $woocommerce_settings[$current_tab] );
|
woocommerce_admin_fields( $woocommerce_settings[$current_tab] );
|
||||||
break;
|
break;
|
||||||
case "shipping" :
|
case "shipping" :
|
||||||
|
@ -1425,6 +1443,25 @@ function woocommerce_settings() {
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "integration" :
|
||||||
|
|
||||||
|
$integrations = $woocommerce->integrations->get_integrations();
|
||||||
|
|
||||||
|
$section = empty( $_GET['section'] ) ? key( $integrations ) : urldecode( $_GET['section'] );
|
||||||
|
|
||||||
|
foreach ( $integrations as $integration ) {
|
||||||
|
$title = ( isset( $integration->method_title ) && $integration->method_title) ? ucwords( $integration->method_title ) : ucwords( $method->id );
|
||||||
|
$current = ( $integration->id == $section ) ? 'class="current"' : '';
|
||||||
|
|
||||||
|
$links[] = '<a href="' . add_query_arg( 'section', $integration->id, admin_url('admin.php?page=woocommerce&tab=integration') ) . '"' . $current . '>' . $title . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<ul class="subsubsub"><li>' . implode(' | </li><li>', $links) . '</li></ul><br class="clear" />';
|
||||||
|
|
||||||
|
if ( isset( $integrations[ $section ] ) )
|
||||||
|
$integrations[ $section ]->admin_options();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
do_action( 'woocommerce_settings_tabs_' . $current_tab );
|
do_action( 'woocommerce_settings_tabs_' . $current_tab );
|
||||||
|
|
|
@ -110,6 +110,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#wc_get_started { position: relative; margin: 1em 0 2em; padding: 15px 15px 15px 90px; border: 1px solid #d9d9d9; background: #f5f5f5 url(../images/gear.png) no-repeat 15px 15px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; -moz-box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; -webkit-box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; }
|
||||||
|
#wc_get_started span { display: block; text-shadow: 1px 1px 0 #fff; font-size: 14px; line-height: 22px; color: #595959; }
|
||||||
|
#wc_get_started span.main { margin-top: 2px; font-weight: bold; font-size: 16px; }
|
||||||
|
#wc_get_started .main-button { position: absolute; right: 20px; top: 27px; }
|
||||||
|
#wc_get_started p { margin: 1em 0 .5em; }
|
||||||
|
|
||||||
#icon-woocommerce, .woocommerce_icon, .icon32-posts-product, .icon32-posts-shop_order, .icon32-posts-shop_coupon, .icon32-posts-product_variation {
|
#icon-woocommerce, .woocommerce_icon, .icon32-posts-product, .icon32-posts-shop_order, .icon32-posts-shop_coupon, .icon32-posts-product_variation {
|
||||||
background-image: url(../images/icons/woocommerce-icons.png) !important;
|
background-image: url(../images/icons/woocommerce-icons.png) !important;
|
||||||
background-position: -11px -6px;
|
background-position: -11px -6px;
|
||||||
|
@ -154,6 +160,12 @@ input.wc-error {
|
||||||
background-color: #FFBABA;
|
background-color: #FFBABA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.mce_woocommerce_shortcodes_button {
|
||||||
|
background-image: url(../images/icons/wc_icon.png) !important;
|
||||||
|
background-repeat: no-repeat !important;
|
||||||
|
background-position: center !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Status page */
|
/* Status page */
|
||||||
table.wc_status_table {
|
table.wc_status_table {
|
||||||
th {
|
th {
|
||||||
|
@ -1261,6 +1273,54 @@ img.help_tip {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
fieldset {
|
||||||
|
img.help_tip {
|
||||||
|
margin: -3px 0 0 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.color_box {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||||
|
-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||||
|
-moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||||
|
-webkit-border-radius:3px;
|
||||||
|
-moz-border-radius:3px;
|
||||||
|
border-radius:3px;
|
||||||
|
padding: 4px 6px;
|
||||||
|
float: left;
|
||||||
|
width: 90px;
|
||||||
|
margin: 0 10px 0 0;
|
||||||
|
strong {
|
||||||
|
text-align: left;
|
||||||
|
display: block;
|
||||||
|
padding: 0 0 2px;
|
||||||
|
font-size: 0.92em;
|
||||||
|
img {
|
||||||
|
float: right;
|
||||||
|
margin: 1px 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
font-family: monospace;
|
||||||
|
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
||||||
|
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
||||||
|
box-sizing: border-box; /* Opera/IE 8+ */
|
||||||
|
}
|
||||||
|
.colorpickdiv {
|
||||||
|
z-index: 100;
|
||||||
|
background:#eee;
|
||||||
|
border:1px solid #ccc;
|
||||||
|
position:absolute;
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.color_box_clear {
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1339,7 +1399,7 @@ img.help_tip {
|
||||||
}
|
}
|
||||||
#woocommerce-product-data ul.product_data_tabs li {
|
#woocommerce-product-data ul.product_data_tabs li {
|
||||||
|
|
||||||
&.general_options, &.tax_options, &.inventory_options, &.crosssell_options, &.attribute_options, &.grouping_options, &.variation_options {
|
&.general_options, &.tax_options, &.inventory_options, &.related_product_options, &.attribute_options, &.grouping_options, &.variation_options {
|
||||||
a {
|
a {
|
||||||
padding: 9px 9px 9px 34px;
|
padding: 9px 9px 9px 34px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
|
@ -1364,7 +1424,7 @@ img.help_tip {
|
||||||
background-position: 9px -111px;
|
background-position: 9px -111px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.crosssell_options {
|
&.related_product_options {
|
||||||
a {
|
a {
|
||||||
background-position: 9px -171px;
|
background-position: 9px -171px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:1104;display:none}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background-image:url('../images/fancybox/fancybox.png')}#fancybox-overlay{position:absolute;top:0;left:0;width:100%;z-index:1100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{position:absolute;top:0;left:0;padding:20px;z-index:1101;outline:0;display:none}#fancybox-outer{position:relative;width:100%;height:100%;background:#fff;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em;-webkit-box-shadow:0 0 1em rgba(0,0,0,0.6);-moz-box-shadow:0 0 1em rgba(0,0,0,0.6);box-shadow:0 0 1em rgba(0,0,0,0.6)}#fancybox-content{width:0;height:0;padding:0;outline:0;position:relative;overflow:hidden;z-index:1102;border:0 solid #fff;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;z-index:1101}#fancybox-close{position:absolute;top:-15px;right:-15px;width:24px;height:24px;line-height:24px!important;font-size:16px!important;font-family:sans-serif!important;cursor:pointer;z-index:1103;display:none;text-align:center;background:#000;display:inline-block;border:2px solid #fff;-webkit-border-radius:2em;-moz-border-radius:2em;border-radius:2em;font-weight:bold;color:#fff;text-shadow:none;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);box-shadow:0 1px 3px rgba(0,0,0,0.8);-webkit-transition:all ease-in-out .2s}#fancybox-close:hover{background:#a36396;text-decoration:none!important}#fancybox-error{color:#444;font:normal 12px/20px Arial;padding:14px;margin:0}#fancybox-img{width:100%;height:100%;padding:0;margin:0;border:0;outline:0;line-height:0;vertical-align:top}#fancybox-frame{width:100%;height:100%;border:0;display:block}#fancybox-left,#fancybox-right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;outline:0;background:transparent url('../images/fancybox/blank.gif');z-index:1102;display:none}#fancybox-left{left:0}#fancybox-right{right:0}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:1102;display:block}#fancybox-left-ico{background-image:url('../images/fancybox/fancybox.png');background-position:-40px -30px}#fancybox-right-ico{background-image:url('../images/fancybox/fancybox.png');background-position:-40px -60px}#fancybox-left:hover,#fancybox-right:hover{visibility:visible}#fancybox-left:hover span{left:20px}#fancybox-right:hover span{left:auto;right:20px}.fancybox-bg{position:absolute;padding:0;margin:0;border:0;width:20px;height:20px;z-index:1001}#fancybox-title{font-family:Helvetica;font-size:12px;z-index:1102;text-align:center;padding-top:10px}#fancybox-title-float{padding:3px 10px;background:#000;display:inline-block;border:2px solid #fff;-webkit-border-radius:2em;-moz-border-radius:2em;border-radius:2em;font-weight:bold;color:#fff;text-shadow:none;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);box-shadow:0 1px 3px rgba(0,0,0,0.8)}
|
#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:11104;display:none}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background-image:url('../images/fancybox/fancybox.png')}#fancybox-overlay{position:absolute;top:0;left:0;width:100%;z-index:11100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{position:absolute;top:0;left:0;padding:20px;z-index:11101;outline:0;display:none}#fancybox-outer{position:relative;width:100%;height:100%;background:#fff;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em;-webkit-box-shadow:0 0 1em rgba(0,0,0,0.6);-moz-box-shadow:0 0 1em rgba(0,0,0,0.6);box-shadow:0 0 1em rgba(0,0,0,0.6)}#fancybox-content{width:0;height:0;padding:0;outline:0;position:relative;overflow:hidden;z-index:11102;border:0 solid #fff;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;z-index:11101}#fancybox-close{position:absolute;top:-15px;right:-15px;width:24px;height:24px;line-height:24px!important;font-size:16px!important;font-family:sans-serif!important;cursor:pointer;z-index:11103;display:none;text-align:center;background:#000;display:inline-block;border:2px solid #fff;-webkit-border-radius:2em;-moz-border-radius:2em;border-radius:2em;font-weight:bold;color:#fff;text-shadow:none;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);box-shadow:0 1px 3px rgba(0,0,0,0.8);-webkit-transition:all ease-in-out .2s}#fancybox-close:hover{background:#a36396;text-decoration:none!important}#fancybox-error{color:#444;font:normal 12px/20px Arial;padding:14px;margin:0}#fancybox-img{width:100%;height:100%;padding:0;margin:0;border:0;outline:0;line-height:0;vertical-align:top}#fancybox-frame{width:100%;height:100%;border:0;display:block}#fancybox-left,#fancybox-right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;outline:0;background:transparent url('../images/fancybox/blank.gif');z-index:11102;display:none}#fancybox-left{left:0}#fancybox-right{right:0}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:11102;display:block}#fancybox-left-ico{background-image:url('../images/fancybox/fancybox.png');background-position:-40px -30px}#fancybox-right-ico{background-image:url('../images/fancybox/fancybox.png');background-position:-40px -60px}#fancybox-left:hover,#fancybox-right:hover{visibility:visible}#fancybox-left:hover span{left:20px}#fancybox-right:hover span{left:auto;right:20px}.fancybox-bg{position:absolute;padding:0;margin:0;border:0;width:20px;height:20px;z-index:11001}#fancybox-title{font-family:Helvetica;font-size:12px;z-index:11102;text-align:center;padding-top:10px}#fancybox-title-float{padding:3px 10px;background:#000;display:inline-block;border:2px solid #fff;-webkit-border-radius:2em;-moz-border-radius:2em;border-radius:2em;font-weight:bold;color:#fff;text-shadow:none;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);box-shadow:0 1px 3px rgba(0,0,0,0.8)}
|
|
@ -25,7 +25,7 @@
|
||||||
margin-left: -20px;
|
margin-left: -20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 1104;
|
z-index: 11104;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1100;
|
z-index: 11100;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
z-index: 1101;
|
z-index: 11101;
|
||||||
outline: none;
|
outline: none;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
outline: none;
|
outline: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 1102;
|
z-index: 11102;
|
||||||
border: 0px solid #fff;
|
border: 0px solid #fff;
|
||||||
-webkit-border-radius:1em;
|
-webkit-border-radius:1em;
|
||||||
-moz-border-radius:1em;
|
-moz-border-radius:1em;
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
z-index: 1101;
|
z-index: 11101;
|
||||||
}
|
}
|
||||||
|
|
||||||
#fancybox-close {
|
#fancybox-close {
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
font-size:16px !important;
|
font-size:16px !important;
|
||||||
font-family: sans-serif !important;
|
font-family: sans-serif !important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
z-index: 1103;
|
z-index: 11103;
|
||||||
display: none;
|
display: none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background: #000;
|
background: #000;
|
||||||
|
@ -168,7 +168,7 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: transparent url('../images/fancybox/blank.gif');
|
background: transparent url('../images/fancybox/blank.gif');
|
||||||
z-index: 1102;
|
z-index: 11102;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin-top: -15px;
|
margin-top: -15px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
z-index: 1102;
|
z-index: 11102;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,13 +222,13 @@
|
||||||
border: 0;
|
border: 0;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
z-index: 1001;
|
z-index: 11001;
|
||||||
}
|
}
|
||||||
|
|
||||||
#fancybox-title {
|
#fancybox-title {
|
||||||
font-family: Helvetica;
|
font-family: Helvetica;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
z-index: 1102;
|
z-index: 11102;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top:10px;
|
padding-top:10px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
.clearfix() {
|
||||||
|
&:after {
|
||||||
|
content:"";
|
||||||
|
display:block;
|
||||||
|
clear:both;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.border_radius(@radius:4px) {
|
||||||
|
-webkit-border-radius:@radius;
|
||||||
|
-moz-border-radius:@radius;
|
||||||
|
border-radius:@radius;
|
||||||
|
}
|
||||||
|
.border_radius_right(@radius:4px) {
|
||||||
|
-webkit-border-top-right-radius: @radius;
|
||||||
|
-webkit-border-bottom-right-radius: @radius;
|
||||||
|
-moz-border-radius-topright: @radius;
|
||||||
|
-moz-border-radius-bottomright: @radius;
|
||||||
|
border-top-right-radius: @radius;
|
||||||
|
border-bottom-right-radius: @radius;
|
||||||
|
}
|
||||||
|
.border_radius_left(@radius:4px) {
|
||||||
|
-webkit-border-top-left-radius: @radius;
|
||||||
|
-webkit-border-bottom-left-radius: @radius;
|
||||||
|
-moz-border-radius-topleft: @radius;
|
||||||
|
-moz-border-radius-bottomleft: @radius;
|
||||||
|
border-top-left-radius: @radius;
|
||||||
|
border-bottom-left-radius: @radius;
|
||||||
|
}
|
||||||
|
.border_radius_bottom(@radius:4px) {
|
||||||
|
-webkit-border-bottom-left-radius: @radius;
|
||||||
|
-webkit-border-bottom-right-radius: @radius;
|
||||||
|
-moz-border-radius-bottomleft: @radius;
|
||||||
|
-moz-border-radius-bottomright: @radius;
|
||||||
|
border-bottom-left-radius: @radius;
|
||||||
|
border-bottom-right-radius: @radius;
|
||||||
|
}
|
||||||
|
.border_radius_top(@radius:4px) {
|
||||||
|
-webkit-border-top-left-radius: @radius;
|
||||||
|
-webkit-border-top-right-radius: @radius;
|
||||||
|
-moz-border-radius-topleft: @radius;
|
||||||
|
-moz-border-radius-topright: @radius;
|
||||||
|
border-top-left-radius: @radius;
|
||||||
|
border-top-right-radius: @radius;
|
||||||
|
}
|
||||||
|
.opacity(@opacity:0.75) {
|
||||||
|
filter:~"alpha(opacity=@opacity * 100)";
|
||||||
|
-moz-opacity:@opacity;
|
||||||
|
-khtml-opacity: @opacity;
|
||||||
|
opacity: @opacity;
|
||||||
|
}
|
||||||
|
.box_shadow(@shadow_x:3px, @shadow_y:3px, @shadow_rad:3px, @shadow_in:3px, @shadow_color:#888) {
|
||||||
|
box-shadow:@shadow_x @shadow_y @shadow_rad @shadow_in @shadow_color;
|
||||||
|
-webkit-box-shadow:@shadow_x @shadow_y @shadow_rad @shadow_in @shadow_color;
|
||||||
|
-moz-box-shadow:@shadow_x @shadow_y @shadow_rad @shadow_in @shadow_color;
|
||||||
|
}
|
||||||
|
.inset_box_shadow(@shadow_x:3px, @shadow_y:3px, @shadow_rad:3px, @shadow_in:3px, @shadow_color:#888) {
|
||||||
|
box-shadow:inset @shadow_x @shadow_y @shadow_rad @shadow_in @shadow_color;
|
||||||
|
-webkit-box-shadow:inset @shadow_x @shadow_y @shadow_rad @shadow_in @shadow_color;
|
||||||
|
-moz-box-shadow:inset @shadow_x @shadow_y @shadow_rad @shadow_in @shadow_color;
|
||||||
|
}
|
||||||
|
.text_shadow(@shadow_x:3px, @shadow_y:3px, @shadow_rad:3px, @shadow_color:#fff) {
|
||||||
|
text-shadow:@shadow_x @shadow_y @shadow_rad @shadow_color;
|
||||||
|
}
|
||||||
|
.vertical_gradient(@from: #000, @to: #FFF) {
|
||||||
|
background: @from;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
|
||||||
|
background: -webkit-linear-gradient(@from, @to);
|
||||||
|
background: -moz-linear-gradient(center top, @from 0%, @to 100%);
|
||||||
|
background: -moz-gradient(center top, @from 0%, @to 100%);
|
||||||
|
}
|
||||||
|
.transition(@selector:all, @animation:ease-in-out, @duration:.2s) {
|
||||||
|
-webkit-transition:@selector @animation @duration;
|
||||||
|
-moz-transition:@selector @animation @duration;
|
||||||
|
-o-transition:@selector @animation @duration;
|
||||||
|
transition:@selector @animation @duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear { clear: both; }
|
||||||
|
.nobr { white-space: nowrap; }
|
||||||
|
|
||||||
|
.darkorlighttextshadow ( @a, @opacity: 0.8 ) when (lightness(@a) >= 65%) { .text_shadow( 0, -1px, 0, rgba(0,0,0,@opacity) ); }
|
||||||
|
.darkorlighttextshadow ( @a, @opacity: 0.8 ) when (lightness(@a) < 65%) { .text_shadow( 0, 1px, 0, rgba(255,255,255,@opacity) ); }
|
|
@ -0,0 +1,11 @@
|
||||||
|
@primary: #ad74a2; /* Primary colour for buttons (alt) */
|
||||||
|
@primarytext: desaturate(lighten(@primary,50%),18%); /* Text on primary colour bg */
|
||||||
|
|
||||||
|
@secondary: desaturate(lighten(@primary,40%),18%); /* Secondary buttons */
|
||||||
|
@secondarytext: desaturate(darken(@secondary,60%),18%); /* Text on secondary colour bg */
|
||||||
|
|
||||||
|
@highlight: spin( @primary, 150 ); /* Prices, In stock labels, sales flash */
|
||||||
|
@highlightext: desaturate(lighten(@highlight,50%),18%); /* Text on highlight colour bg */
|
||||||
|
|
||||||
|
@contentbg: #fff; /* Content BG - Tabs (active state) */
|
||||||
|
@subtext: #777; /* small, breadcrumbs etc */
|
After Width: | Height: | Size: 814 B |
|
@ -1,8 +1,6 @@
|
||||||
(
|
(
|
||||||
function(){
|
function(){
|
||||||
|
|
||||||
var icon_url = '../wp-content/plugins/woocommerce/assets/images/icons/wc_icon.png';
|
|
||||||
|
|
||||||
tinymce.create(
|
tinymce.create(
|
||||||
"tinymce.plugins.WooCommerceShortcodes",
|
"tinymce.plugins.WooCommerceShortcodes",
|
||||||
{
|
{
|
||||||
|
@ -14,7 +12,6 @@
|
||||||
|
|
||||||
d=e.createMenuButton( "woocommerce_shortcodes_button",{
|
d=e.createMenuButton( "woocommerce_shortcodes_button",{
|
||||||
title:"Insert WooCommerce Shortcode",
|
title:"Insert WooCommerce Shortcode",
|
||||||
image:icon_url,
|
|
||||||
icons:false
|
icons:false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -710,6 +710,7 @@ class WC_Cart {
|
||||||
function set_quantity( $cart_item_key, $quantity = 1 ) {
|
function set_quantity( $cart_item_key, $quantity = 1 ) {
|
||||||
|
|
||||||
if ( $quantity == 0 || $quantity < 0 ) {
|
if ( $quantity == 0 || $quantity < 0 ) {
|
||||||
|
do_action( 'woocommerce_before_cart_item_quantity_zero', $cart_item_key );
|
||||||
unset( $this->cart_contents[$cart_item_key] );
|
unset( $this->cart_contents[$cart_item_key] );
|
||||||
} else {
|
} else {
|
||||||
$this->cart_contents[$cart_item_key]['quantity'] = $quantity;
|
$this->cart_contents[$cart_item_key]['quantity'] = $quantity;
|
||||||
|
@ -1368,6 +1369,7 @@ class WC_Cart {
|
||||||
|
|
||||||
$packages[0]['contents'] = $this->get_cart(); // Items in the package
|
$packages[0]['contents'] = $this->get_cart(); // Items in the package
|
||||||
$packages[0]['contents_cost'] = 0; // Cost of items in the package
|
$packages[0]['contents_cost'] = 0; // Cost of items in the package
|
||||||
|
$packages[0]['applied_coupons'] = $this->applied_coupons; // Applied coupons - some, like free shipping, affect costs
|
||||||
$packages[0]['destination']['country'] = $woocommerce->customer->get_shipping_country();
|
$packages[0]['destination']['country'] = $woocommerce->customer->get_shipping_country();
|
||||||
$packages[0]['destination']['state'] = $woocommerce->customer->get_shipping_state();
|
$packages[0]['destination']['state'] = $woocommerce->customer->get_shipping_state();
|
||||||
$packages[0]['destination']['postcode'] = $woocommerce->customer->get_shipping_postcode();
|
$packages[0]['destination']['postcode'] = $woocommerce->customer->get_shipping_postcode();
|
||||||
|
|
|
@ -103,7 +103,7 @@ class WC_Checkout {
|
||||||
$this->posted['shipping_method'] = isset($_POST['shipping_method']) ? woocommerce_clean($_POST['shipping_method']) : '';
|
$this->posted['shipping_method'] = isset($_POST['shipping_method']) ? woocommerce_clean($_POST['shipping_method']) : '';
|
||||||
|
|
||||||
// Ship to billing only option
|
// Ship to billing only option
|
||||||
if ($woocommerce->cart->ship_to_billing_address_only()) $this->posted['shiptobilling'] = 1;
|
if ( $woocommerce->cart->ship_to_billing_address_only() ) $this->posted['shiptobilling'] = 1;
|
||||||
|
|
||||||
// Update customer shipping and payment method to posted method
|
// Update customer shipping and payment method to posted method
|
||||||
$_SESSION['_chosen_shipping_method'] = $this->posted['shipping_method'];
|
$_SESSION['_chosen_shipping_method'] = $this->posted['shipping_method'];
|
||||||
|
@ -119,13 +119,13 @@ class WC_Checkout {
|
||||||
$validation = $woocommerce->validation();
|
$validation = $woocommerce->validation();
|
||||||
|
|
||||||
// Get posted checkout_fields and do validation
|
// Get posted checkout_fields and do validation
|
||||||
foreach ($this->checkout_fields as $fieldset_key => $fieldset) :
|
foreach ($this->checkout_fields as $fieldset_key => $fieldset) :
|
||||||
|
|
||||||
// Skip shipping if its not needed
|
// Skip shipping if its not needed
|
||||||
if ($fieldset_key=='shipping' && (!$woocommerce->cart->needs_shipping() || $woocommerce->cart->ship_to_billing_address_only() || $this->posted['shiptobilling'])) :
|
if ( $fieldset_key == 'shipping' && ( $woocommerce->cart->ship_to_billing_address_only() || $this->posted['shiptobilling'] || ( ! $woocommerce->cart->needs_shipping() && get_option('woocommerce_require_shipping_address') == 'no' ) ) ) {
|
||||||
$skipped_shipping = true;
|
$skipped_shipping = true;
|
||||||
continue;
|
continue;
|
||||||
endif;
|
}
|
||||||
|
|
||||||
foreach ($fieldset as $key => $field) :
|
foreach ($fieldset as $key => $field) :
|
||||||
|
|
||||||
|
@ -203,18 +203,17 @@ class WC_Checkout {
|
||||||
$woocommerce->customer->set_shipping_postcode( $this->posted['billing_postcode'] );
|
$woocommerce->customer->set_shipping_postcode( $this->posted['billing_postcode'] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_user_logged_in()) :
|
|
||||||
$this->creating_account = false;
|
|
||||||
elseif (isset($this->posted['createaccount']) && $this->posted['createaccount']) :
|
|
||||||
$this->creating_account = true;
|
|
||||||
elseif ($this->must_create_account) :
|
|
||||||
$this->creating_account = true;
|
|
||||||
else :
|
|
||||||
$this->creating_account = false;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ($this->creating_account) :
|
if ( is_user_logged_in() )
|
||||||
|
$this->creating_account = false;
|
||||||
|
elseif ( ! empty( $this->posted['createaccount'] ) )
|
||||||
|
$this->creating_account = true;
|
||||||
|
elseif ($this->must_create_account)
|
||||||
|
$this->creating_account = true;
|
||||||
|
else
|
||||||
|
$this->creating_account = false;
|
||||||
|
|
||||||
|
if ( $this->creating_account ) {
|
||||||
|
|
||||||
if ( empty($this->posted['account_username']) ) $woocommerce->add_error( __('Please enter an account username.', 'woocommerce') );
|
if ( empty($this->posted['account_username']) ) $woocommerce->add_error( __('Please enter an account username.', 'woocommerce') );
|
||||||
if ( empty($this->posted['account_password']) ) $woocommerce->add_error( __('Please enter an account password.', 'woocommerce') );
|
if ( empty($this->posted['account_password']) ) $woocommerce->add_error( __('Please enter an account password.', 'woocommerce') );
|
||||||
|
@ -232,7 +231,7 @@ class WC_Checkout {
|
||||||
$woocommerce->add_error( __('An account is already registered with your email address. Please login.', 'woocommerce') );
|
$woocommerce->add_error( __('An account is already registered with your email address. Please login.', 'woocommerce') );
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif;
|
}
|
||||||
|
|
||||||
// Terms
|
// Terms
|
||||||
if (!isset($_POST['woocommerce_checkout_update_totals']) && empty($this->posted['terms']) && woocommerce_get_page_id('terms')>0 ) $woocommerce->add_error( __('You must accept our Terms & Conditions.', 'woocommerce') );
|
if (!isset($_POST['woocommerce_checkout_update_totals']) && empty($this->posted['terms']) && woocommerce_get_page_id('terms')>0 ) $woocommerce->add_error( __('You must accept our Terms & Conditions.', 'woocommerce') );
|
||||||
|
@ -410,14 +409,14 @@ class WC_Checkout {
|
||||||
// UPDATE ORDER META
|
// UPDATE ORDER META
|
||||||
|
|
||||||
// Save billing and shipping first, also save to user meta if logged in
|
// Save billing and shipping first, also save to user meta if logged in
|
||||||
if ($this->checkout_fields['billing']) :
|
if ($this->checkout_fields['billing']) {
|
||||||
foreach ($this->checkout_fields['billing'] as $key => $field) :
|
foreach ($this->checkout_fields['billing'] as $key => $field) {
|
||||||
|
|
||||||
// Post
|
// Post
|
||||||
update_post_meta( $order_id, '_' . $key, $this->posted[$key] );
|
update_post_meta( $order_id, '_' . $key, $this->posted[$key] );
|
||||||
|
|
||||||
// User
|
// User
|
||||||
if ($user_id>0 && !empty($this->posted[$key])) :
|
if ($user_id>0 && !empty($this->posted[$key])) {
|
||||||
update_user_meta( $user_id, $key, $this->posted[$key] );
|
update_user_meta( $user_id, $key, $this->posted[$key] );
|
||||||
|
|
||||||
// Special fields
|
// Special fields
|
||||||
|
@ -433,31 +432,28 @@ class WC_Checkout {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
endif;
|
}
|
||||||
|
}
|
||||||
endforeach;
|
}
|
||||||
endif;
|
|
||||||
if ($this->checkout_fields['shipping'] && $woocommerce->cart->needs_shipping()) :
|
if ( $this->checkout_fields['shipping'] && ( $woocommerce->cart->needs_shipping() || get_option('woocommerce_require_shipping_address') == 'yes' ) ) {
|
||||||
foreach ($this->checkout_fields['shipping'] as $key => $field) :
|
foreach ($this->checkout_fields['shipping'] as $key => $field) {
|
||||||
|
if ( $this->posted['shiptobilling'] ) {
|
||||||
if ($this->posted['shiptobilling']) :
|
|
||||||
|
|
||||||
$field_key = str_replace('shipping_', 'billing_', $key);
|
$field_key = str_replace('shipping_', 'billing_', $key);
|
||||||
|
|
||||||
// Post
|
// Post
|
||||||
update_post_meta( $order_id, '_' . $key, $this->posted[$field_key] );
|
update_post_meta( $order_id, '_' . $key, $this->posted[$field_key] );
|
||||||
else :
|
} else {
|
||||||
// Post
|
// Post
|
||||||
update_post_meta( $order_id, '_' . $key, $this->posted[$key] );
|
update_post_meta( $order_id, '_' . $key, $this->posted[$key] );
|
||||||
|
|
||||||
// User
|
// User
|
||||||
if ($user_id>0) :
|
if ( $user_id > 0 )
|
||||||
update_user_meta( $user_id, $key, $this->posted[$key] );
|
update_user_meta( $user_id, $key, $this->posted[$key] );
|
||||||
endif;
|
}
|
||||||
endif;
|
}
|
||||||
|
}
|
||||||
endforeach;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
// Save any other user meta
|
// Save any other user meta
|
||||||
if ($user_id) do_action('woocommerce_checkout_update_user_meta', $user_id, $this->posted);
|
if ($user_id) do_action('woocommerce_checkout_update_user_meta', $user_id, $this->posted);
|
||||||
|
|
|
@ -291,6 +291,11 @@ class WC_Order {
|
||||||
return $this->order_shipping;
|
return $this->order_shipping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Gets shipping tax amount */
|
||||||
|
function get_shipping_tax() {
|
||||||
|
return $this->order_shipping_tax;
|
||||||
|
}
|
||||||
|
|
||||||
/** Gets order total */
|
/** Gets order total */
|
||||||
function get_order_total() {
|
function get_order_total() {
|
||||||
return $this->order_total;
|
return $this->order_total;
|
||||||
|
@ -372,7 +377,16 @@ class WC_Order {
|
||||||
else :
|
else :
|
||||||
$subtotal = woocommerce_price( $this->get_line_subtotal( $item, true ) );
|
$subtotal = woocommerce_price( $this->get_line_subtotal( $item, true ) );
|
||||||
endif;
|
endif;
|
||||||
return $subtotal;
|
|
||||||
|
return apply_filters( 'woocommerce_order_formatted_line_subtotal', $subtotal, $item, $this );
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Gets order total - formatted for display */
|
||||||
|
function get_formatted_order_total() {
|
||||||
|
|
||||||
|
$formatted_total = woocommerce_price( $this->order_total );
|
||||||
|
|
||||||
|
return apply_filters( 'woocommerce_get_formatted_order_total', $formatted_total, $this );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets subtotal - subtotal is shown before discounts, but with localised taxes */
|
/** Gets subtotal - subtotal is shown before discounts, but with localised taxes */
|
||||||
|
@ -537,7 +551,7 @@ class WC_Order {
|
||||||
if ( $this->get_order_discount() > 0 )
|
if ( $this->get_order_discount() > 0 )
|
||||||
$total_rows[ __( 'Order Discount:', 'woocommerce' ) ] = '-' . woocommerce_price( $this->get_order_discount() );
|
$total_rows[ __( 'Order Discount:', 'woocommerce' ) ] = '-' . woocommerce_price( $this->get_order_discount() );
|
||||||
|
|
||||||
$total_rows[ __( 'Order Total:', 'woocommerce' ) ] = woocommerce_price( $this->get_order_total() );
|
$total_rows[ __( 'Order Total:', 'woocommerce' ) ] = $this->get_formatted_order_total();
|
||||||
|
|
||||||
return apply_filters( 'woocommerce_get_order_item_totals', $total_rows, $this );
|
return apply_filters( 'woocommerce_get_order_item_totals', $total_rows, $this );
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,8 +356,7 @@ class WC_Product {
|
||||||
else :
|
else :
|
||||||
$url = add_query_arg('add-to-cart', $this->id);
|
$url = add_query_arg('add-to-cart', $this->id);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$url = $woocommerce->nonce_url( 'add_to_cart', $url );
|
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,9 +435,25 @@ class WC_Product {
|
||||||
endif;
|
endif;
|
||||||
else :
|
else :
|
||||||
if ($this->is_in_stock()) :
|
if ($this->is_in_stock()) :
|
||||||
if ($this->get_total_stock() > 0) :
|
if ( $this->get_total_stock() > 0 ) :
|
||||||
|
|
||||||
$availability = sprintf( __('%s in stock', 'woocommerce'), $this->stock );
|
$format_option = get_option( 'woocommerce_stock_format' );
|
||||||
|
|
||||||
|
switch ( $format_option ) {
|
||||||
|
case 'no_amount' :
|
||||||
|
$format = __('In stock', 'woocommerce');
|
||||||
|
break;
|
||||||
|
case 'low_amount' :
|
||||||
|
$low_amount = get_option( 'woocommerce_notify_low_stock_amount' );
|
||||||
|
|
||||||
|
$format = ( $this->get_total_stock() <= $low_amount ) ? __('Only %s left in stock', 'woocommerce') : __('In stock', 'woocommerce');
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
$format = __('%s in stock', 'woocommerce');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$availability = sprintf( $format, $this->stock );
|
||||||
|
|
||||||
if ($this->backorders_allowed() && $this->backorders_require_notification()) :
|
if ($this->backorders_allowed() && $this->backorders_require_notification()) :
|
||||||
$availability .= ' ' . __('(backorders allowed)', 'woocommerce');
|
$availability .= ' ' . __('(backorders allowed)', 'woocommerce');
|
||||||
|
@ -530,13 +545,13 @@ class WC_Product {
|
||||||
|
|
||||||
/** Returns the product's price */
|
/** Returns the product's price */
|
||||||
function get_price() {
|
function get_price() {
|
||||||
return $this->price;
|
return apply_filters( 'woocommerce_get_price', $this->price, $this );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the price (excluding tax) - ignores tax_class filters since the price may *include* tax and thus needs subtracting */
|
/** Returns the price (excluding tax) - ignores tax_class filters since the price may *include* tax and thus needs subtracting */
|
||||||
function get_price_excluding_tax() {
|
function get_price_excluding_tax() {
|
||||||
|
|
||||||
$price = $this->price;
|
$price = $this->get_price();
|
||||||
|
|
||||||
if ( $this->is_taxable() && get_option('woocommerce_prices_include_tax')=='yes' ) :
|
if ( $this->is_taxable() && get_option('woocommerce_prices_include_tax')=='yes' ) :
|
||||||
|
|
||||||
|
@ -549,7 +564,7 @@ class WC_Product {
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
return $price;
|
return apply_filters( 'woocommerce_get_price_excluding_tax', $price, $this );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the tax class */
|
/** Returns the tax class */
|
||||||
|
|
|
@ -158,10 +158,11 @@ class WC_Settings_API {
|
||||||
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
||||||
|
|
||||||
$html .= '<tr valign="top">' . "\n";
|
$html .= '<tr valign="top">' . "\n";
|
||||||
$html .= '<th scope="row" class="titledesc">' . $title . '</th>' . "\n";
|
$html .= '<th scope="row" class="titledesc">';
|
||||||
|
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">' . $title . '</label>';
|
||||||
|
$html .= '</th>' . "\n";
|
||||||
$html .= '<td class="forminp">' . "\n";
|
$html .= '<td class="forminp">' . "\n";
|
||||||
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
||||||
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">';
|
|
||||||
$value = ( isset( $this->settings[ $key ] ) ) ? esc_attr( $this->settings[ $key ] ) : '';
|
$value = ( isset( $this->settings[ $key ] ) ) ? esc_attr( $this->settings[ $key ] ) : '';
|
||||||
$html .= '<input class="input-text wide-input '.$data['class'].'" type="text" name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'" value="' . $value . '" />';
|
$html .= '<input class="input-text wide-input '.$data['class'].'" type="text" name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'" value="' . $value . '" />';
|
||||||
if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '<span class="description">' . $data['description'] . '</span>' . "\n"; }
|
if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '<span class="description">' . $data['description'] . '</span>' . "\n"; }
|
||||||
|
@ -186,10 +187,11 @@ class WC_Settings_API {
|
||||||
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
||||||
|
|
||||||
$html .= '<tr valign="top">' . "\n";
|
$html .= '<tr valign="top">' . "\n";
|
||||||
$html .= '<th scope="row" class="titledesc">' . $title . '</th>' . "\n";
|
$html .= '<th scope="row" class="titledesc">';
|
||||||
|
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">' . $title . '</label>';
|
||||||
|
$html .= '</th>' . "\n";
|
||||||
$html .= '<td class="forminp">' . "\n";
|
$html .= '<td class="forminp">' . "\n";
|
||||||
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
||||||
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">';
|
|
||||||
$value = ( isset( $this->settings[ $key ] ) ) ? esc_attr( $this->settings[ $key ] ) : '';
|
$value = ( isset( $this->settings[ $key ] ) ) ? esc_attr( $this->settings[ $key ] ) : '';
|
||||||
$html .= '<input class="input-text wide-input '.$data['class'].'" type="password" name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'" value="' . $value . '" />';
|
$html .= '<input class="input-text wide-input '.$data['class'].'" type="password" name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'" value="' . $value . '" />';
|
||||||
if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '<span class="description">' . $data['description'] . '</span>' . "\n"; }
|
if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '<span class="description">' . $data['description'] . '</span>' . "\n"; }
|
||||||
|
@ -215,10 +217,11 @@ class WC_Settings_API {
|
||||||
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
||||||
|
|
||||||
$html .= '<tr valign="top">' . "\n";
|
$html .= '<tr valign="top">' . "\n";
|
||||||
$html .= '<th scope="row" class="titledesc">' . $title . '</th>' . "\n";
|
$html .= '<th scope="row" class="titledesc">';
|
||||||
|
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">' . $title . '</label>';
|
||||||
|
$html .= '</th>' . "\n";
|
||||||
$html .= '<td class="forminp">' . "\n";
|
$html .= '<td class="forminp">' . "\n";
|
||||||
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
||||||
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">';
|
|
||||||
$value = ( isset( $this->settings[ $key ] ) ) ? esc_attr( $this->settings[ $key ] ) : '';
|
$value = ( isset( $this->settings[ $key ] ) ) ? esc_attr( $this->settings[ $key ] ) : '';
|
||||||
$html .= '<textarea rows="3" cols="20" class="input-text wide-input '.$data['class'].'" name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'">'. $value .'</textarea>';
|
$html .= '<textarea rows="3" cols="20" class="input-text wide-input '.$data['class'].'" name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'">'. $value .'</textarea>';
|
||||||
if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '<span class="description">' . $data['description'] . '</span>' . "\n"; }
|
if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '<span class="description">' . $data['description'] . '</span>' . "\n"; }
|
||||||
|
@ -272,10 +275,11 @@ class WC_Settings_API {
|
||||||
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
||||||
|
|
||||||
$html .= '<tr valign="top">' . "\n";
|
$html .= '<tr valign="top">' . "\n";
|
||||||
$html .= '<th scope="row" class="titledesc">' . $title . '</th>' . "\n";
|
$html .= '<th scope="row" class="titledesc">';
|
||||||
|
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">' . $title . '</label>';
|
||||||
|
$html .= '</th>' . "\n";
|
||||||
$html .= '<td class="forminp">' . "\n";
|
$html .= '<td class="forminp">' . "\n";
|
||||||
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
||||||
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">';
|
|
||||||
$html .= '<select name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'" class="select '.$data['class'].'">';
|
$html .= '<select name="' . $this->plugin_id . $this->id . '_' . $key . '" id="' . $this->plugin_id . $this->id . '_' . $key . '" style="'.$data['css'].'" class="select '.$data['class'].'">';
|
||||||
|
|
||||||
foreach ($data['options'] as $option_key => $option_value) :
|
foreach ($data['options'] as $option_key => $option_value) :
|
||||||
|
@ -306,10 +310,11 @@ class WC_Settings_API {
|
||||||
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
$data['css'] = (isset( $data['css'] )) ? $data['css'] : '';
|
||||||
|
|
||||||
$html .= '<tr valign="top">' . "\n";
|
$html .= '<tr valign="top">' . "\n";
|
||||||
$html .= '<th scope="row" class="titledesc">' . $title . '</th>' . "\n";
|
$html .= '<th scope="row" class="titledesc">';
|
||||||
|
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">' . $title . '</label>';
|
||||||
|
$html .= '</th>' . "\n";
|
||||||
$html .= '<td class="forminp">' . "\n";
|
$html .= '<td class="forminp">' . "\n";
|
||||||
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
$html .= '<fieldset><legend class="screen-reader-text"><span>' . $title . '</span></legend>' . "\n";
|
||||||
$html .= '<label for="' . $this->plugin_id . $this->id . '_' . $key . '">';
|
|
||||||
$html .= '<select multiple="multiple" style="'.$data['css'].'" class="multiselect '.$data['class'].'" name="' . $this->plugin_id . $this->id . '_' . $key . '[]" id="' . $this->plugin_id . $this->id . '_' . $key . '">';
|
$html .= '<select multiple="multiple" style="'.$data['css'].'" class="multiselect '.$data['class'].'" name="' . $this->plugin_id . $this->id . '_' . $key . '[]" id="' . $this->plugin_id . $this->id . '_' . $key . '">';
|
||||||
|
|
||||||
foreach ($data['options'] as $option_key => $option_value) :
|
foreach ($data['options'] as $option_key => $option_value) :
|
||||||
|
|
|
@ -19,8 +19,8 @@ class WC_Tax {
|
||||||
if (!is_array($this->parsed_rates)) :
|
if (!is_array($this->parsed_rates)) :
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
|
|
||||||
$tax_rates = (array) get_option('woocommerce_tax_rates');
|
$tax_rates = array_filter( (array) get_option('woocommerce_tax_rates') );
|
||||||
$local_tax_rates = (array) get_option('woocommerce_local_tax_rates');
|
$local_tax_rates = array_filter( (array) get_option('woocommerce_local_tax_rates') );
|
||||||
|
|
||||||
$parsed_rates = array();
|
$parsed_rates = array();
|
||||||
$flat_rates = array();
|
$flat_rates = array();
|
||||||
|
|
|
@ -113,7 +113,7 @@ class WC_Validation {
|
||||||
$postcode = trim(preg_replace('/[\s]/', '', $postcode));
|
$postcode = trim(preg_replace('/[\s]/', '', $postcode));
|
||||||
|
|
||||||
if ( in_array( $country, array('GB', 'CA') ) ) :
|
if ( in_array( $country, array('GB', 'CA') ) ) :
|
||||||
$postcode = substr_replace( $postcode, ' ', -3, 0 );
|
$postcode = trim( substr_replace( $postcode, ' ', -3, 0 ) );
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
return $postcode;
|
return $postcode;
|
||||||
|
|
|
@ -44,7 +44,7 @@ class WC_COD extends WC_Payment_Gateway {
|
||||||
$this->form_fields = array(
|
$this->form_fields = array(
|
||||||
'enabled' => array(
|
'enabled' => array(
|
||||||
'title' => __( 'Enable COD', 'woocommerce' ),
|
'title' => __( 'Enable COD', 'woocommerce' ),
|
||||||
'label' => __( 'Turn on Cash on Delivery for WooCommerce', 'woocommerce' ),
|
'label' => __( 'Enable Cash on Delivery', 'woocommerce' ),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'description' => '',
|
'description' => '',
|
||||||
'default' => 'no'
|
'default' => 'no'
|
||||||
|
|
|
@ -208,7 +208,7 @@ class WC_Paypal extends WC_Payment_Gateway {
|
||||||
'no_note' => 1,
|
'no_note' => 1,
|
||||||
'currency_code' => get_woocommerce_currency(),
|
'currency_code' => get_woocommerce_currency(),
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
'rm' => 2,
|
'rm' => is_ssl() ? 2 : 1,
|
||||||
'upload' => 1,
|
'upload' => 1,
|
||||||
'return' => $this->get_return_url( $order ),
|
'return' => $this->get_return_url( $order ),
|
||||||
'cancel_return' => $order->get_cancel_order_url(),
|
'cancel_return' => $order->get_cancel_order_url(),
|
||||||
|
@ -234,6 +234,7 @@ class WC_Paypal extends WC_Payment_Gateway {
|
||||||
|
|
||||||
// Payment Info
|
// Payment Info
|
||||||
'invoice' => $order->order_key
|
'invoice' => $order->order_key
|
||||||
|
|
||||||
),
|
),
|
||||||
$phone_args
|
$phone_args
|
||||||
);
|
);
|
||||||
|
@ -258,7 +259,7 @@ class WC_Paypal extends WC_Payment_Gateway {
|
||||||
$paypal_args['no_shipping'] = 1;
|
$paypal_args['no_shipping'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If prices include tax or have order discounts, send the whole order
|
// If prices include tax or have order discounts, send the whole order as a single item
|
||||||
if ( get_option('woocommerce_prices_include_tax')=='yes' || $order->get_order_discount() > 0 ) :
|
if ( get_option('woocommerce_prices_include_tax')=='yes' || $order->get_order_discount() > 0 ) :
|
||||||
|
|
||||||
// Discount
|
// Discount
|
||||||
|
@ -273,14 +274,16 @@ class WC_Paypal extends WC_Payment_Gateway {
|
||||||
|
|
||||||
$paypal_args['item_name_1'] = sprintf( __('Order %s' , 'woocommerce'), $order->get_order_number() ) . " - " . implode(', ', $item_names);
|
$paypal_args['item_name_1'] = sprintf( __('Order %s' , 'woocommerce'), $order->get_order_number() ) . " - " . implode(', ', $item_names);
|
||||||
$paypal_args['quantity_1'] = 1;
|
$paypal_args['quantity_1'] = 1;
|
||||||
$paypal_args['amount_1'] = number_format($order->get_order_total() - $order->get_shipping() + $order->get_order_discount(), 2, '.', '');
|
$paypal_args['amount_1'] = number_format($order->get_order_total() - $order->get_shipping() - $order->get_shipping_tax() + $order->get_order_discount(), 2, '.', '');
|
||||||
|
|
||||||
// Shipping Cost
|
// Shipping Cost
|
||||||
if ($order->get_shipping()>0) :
|
$paypal_args['shipping_1'] = number_format( $order->get_shipping() + $order->get_shipping_tax() , 2, '.', '' );
|
||||||
|
|
||||||
|
/*if ( $order->get_shipping() > 0 ) :
|
||||||
$paypal_args['item_name_2'] = __('Shipping via', 'woocommerce') . ' ' . ucwords($order->shipping_method_title);
|
$paypal_args['item_name_2'] = __('Shipping via', 'woocommerce') . ' ' . ucwords($order->shipping_method_title);
|
||||||
$paypal_args['quantity_2'] = '1';
|
$paypal_args['quantity_2'] = '1';
|
||||||
$paypal_args['amount_2'] = number_format($order->get_shipping(), 2, '.', '');
|
$paypal_args['amount_2'] = number_format($order->get_shipping(), 2, '.', '');
|
||||||
endif;
|
endif;*/
|
||||||
|
|
||||||
else :
|
else :
|
||||||
|
|
||||||
|
@ -311,7 +314,7 @@ class WC_Paypal extends WC_Payment_Gateway {
|
||||||
endif;
|
endif;
|
||||||
endforeach; endif;
|
endforeach; endif;
|
||||||
|
|
||||||
// Shipping Cost
|
// Shipping Cost item - paypal only allows shipping per item, we want to send shipping for the order
|
||||||
if ($order->get_shipping()>0) :
|
if ($order->get_shipping()>0) :
|
||||||
$item_loop++;
|
$item_loop++;
|
||||||
$paypal_args['item_name_'.$item_loop] = __('Shipping via', 'woocommerce') . ucwords($order->shipping_method_title);
|
$paypal_args['item_name_'.$item_loop] = __('Shipping via', 'woocommerce') . ucwords($order->shipping_method_title);
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* WooCommerce Integration class
|
||||||
|
*
|
||||||
|
* Extended by individual integrations to offer additional functionality.
|
||||||
|
*
|
||||||
|
* @class WC_Integration
|
||||||
|
* @package WooCommerce
|
||||||
|
* @category Integrations
|
||||||
|
* @author WooThemes
|
||||||
|
*/
|
||||||
|
class WC_Integration extends WC_Settings_API {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin Options
|
||||||
|
*
|
||||||
|
* Setup the gateway settings screen.
|
||||||
|
* Override this in your gateway.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
function admin_options() { ?>
|
||||||
|
|
||||||
|
<h3><?php echo isset( $this->method_title ) ? $this->method_title : __( 'Settings', 'woocommerce' ) ; ?></h3>
|
||||||
|
|
||||||
|
<?php echo isset( $this->method_description ) ? wpautop( $this->method_description ) : ''; ?>
|
||||||
|
|
||||||
|
<table class="form-table">
|
||||||
|
<?php $this->generate_settings_html(); ?>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- Section -->
|
||||||
|
<div><input type="hidden" name="section" value="<?php echo $this->id; ?>" /></div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* WooCommerce Integrations class
|
||||||
|
*
|
||||||
|
* Loads Integrations into WooCommerce.
|
||||||
|
*
|
||||||
|
* @class WC_Integrations
|
||||||
|
* @package WooCommerce
|
||||||
|
* @category Integrations
|
||||||
|
* @author WooThemes
|
||||||
|
*/
|
||||||
|
class WC_Integrations {
|
||||||
|
|
||||||
|
var $integrations = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* init function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
do_action('woocommerce_integrations_init');
|
||||||
|
|
||||||
|
$load_integrations = apply_filters('woocommerce_integrations', array() );
|
||||||
|
|
||||||
|
// Load integration classes
|
||||||
|
foreach ( $load_integrations as $integration ) {
|
||||||
|
|
||||||
|
$load_integration = new $integration();
|
||||||
|
|
||||||
|
$this->integrations[$load_integration->id] = $load_integration;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_integrations() {
|
||||||
|
return $this->integrations;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,204 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Google Analytics Integration
|
||||||
|
*
|
||||||
|
* Allows tracking code to be inserted into store pages.
|
||||||
|
*
|
||||||
|
* @class WC_Google_Analytics
|
||||||
|
* @package WooCommerce
|
||||||
|
* @category Integrations
|
||||||
|
* @author WooThemes
|
||||||
|
*/
|
||||||
|
class WC_Google_Analytics extends WC_Integration {
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->id = 'google_analytics';
|
||||||
|
$this->method_title = __( 'Google Analytics', 'woocommerce' );
|
||||||
|
$this->method_description = __( 'Google Analytics is a free service offered by Google that generates detailed statistics about the visitors to a website.', 'woocommerce' );
|
||||||
|
|
||||||
|
// Load the form fields.
|
||||||
|
$this->init_form_fields();
|
||||||
|
|
||||||
|
// Load the settings.
|
||||||
|
$this->init_settings();
|
||||||
|
|
||||||
|
// Define user set variables
|
||||||
|
$this->ga_id = $this->settings['ga_id'];
|
||||||
|
$this->ga_standard_tracking_enabled = $this->settings['ga_standard_tracking_enabled'];
|
||||||
|
$this->ga_ecommerce_tracking_enabled = $this->settings['ga_ecommerce_tracking_enabled'];
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
add_action( 'woocommerce_update_options_integration_google_analytics', array( &$this, 'process_admin_options') );
|
||||||
|
|
||||||
|
// Tracking code
|
||||||
|
add_action( 'wp_footer', array( &$this, 'google_tracking_code' ) );
|
||||||
|
add_action( 'woocommerce_thankyou', array( &$this, 'ecommerce_tracking_code' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise Settings Form Fields
|
||||||
|
*/
|
||||||
|
function init_form_fields() {
|
||||||
|
|
||||||
|
$this->form_fields = array(
|
||||||
|
'ga_id' => array(
|
||||||
|
'title' => __('Google Analytics ID', 'woocommerce'),
|
||||||
|
'description' => __('Log into your google analytics account to find your ID. e.g. <code>UA-XXXXX-X</code>', 'woocommerce'),
|
||||||
|
'type' => 'text',
|
||||||
|
'default' => get_option('woocommerce_ga_id')
|
||||||
|
),
|
||||||
|
'ga_standard_tracking_enabled' => array(
|
||||||
|
'title' => __('Tracking code', 'woocommerce'),
|
||||||
|
'label' => __('Add tracking code to your site\'s footer. You don\'t need to enable this if using a 3rd party analytics plugin.', 'woocommerce'),
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start',
|
||||||
|
'default' => get_option('woocommerce_ga_standard_tracking_enabled') ? get_option('woocommerce_ga_standard_tracking_enabled') : 'no'
|
||||||
|
),
|
||||||
|
'ga_ecommerce_tracking_enabled' => array(
|
||||||
|
'label' => __('Add eCommerce tracking code to the thankyou page', 'woocommerce'),
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
'default' => get_option('woocommerce_ga_ecommerce_tracking_enabled') ? get_option('woocommerce_ga_ecommerce_tracking_enabled') : 'no'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Google Analytics standard tracking
|
||||||
|
**/
|
||||||
|
function google_tracking_code() {
|
||||||
|
global $woocommerce;
|
||||||
|
|
||||||
|
if ( is_admin() || current_user_can('manage_options') || get_option('woocommerce_ga_standard_tracking_enabled') == "no" ) return;
|
||||||
|
|
||||||
|
$tracking_id = get_option('woocommerce_ga_id');
|
||||||
|
|
||||||
|
if ( ! $tracking_id ) return;
|
||||||
|
|
||||||
|
$loggedin = ( is_user_logged_in() ) ? 'yes' : 'no';
|
||||||
|
if ( is_user_logged_in() ) {
|
||||||
|
$user_id = get_current_user_id();
|
||||||
|
$current_user = get_user_by('id', $user_id);
|
||||||
|
$username = $current_user->user_login;
|
||||||
|
} else {
|
||||||
|
$user_id = '';
|
||||||
|
$username = __('Guest', 'woocommerce');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var _gaq = _gaq || [];
|
||||||
|
_gaq.push(
|
||||||
|
['_setAccount', '<?php echo $tracking_id; ?>'],
|
||||||
|
['_setCustomVar', 1, 'logged-in', '<?php echo $loggedin; ?>', 1],
|
||||||
|
['_setCustomVar', 2, 'user-id', '<?php echo $user_id; ?>', 1],
|
||||||
|
['_setCustomVar', 3, 'username', '<?php echo $username; ?>', 1],
|
||||||
|
['_trackPageview']
|
||||||
|
);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||||
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||||
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||||
|
})();
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Google Analytics eCommerce tracking
|
||||||
|
**/
|
||||||
|
function ecommerce_tracking_code( $order_id ) {
|
||||||
|
global $woocommerce;
|
||||||
|
|
||||||
|
if ( is_admin() || current_user_can('manage_options') || get_option('woocommerce_ga_ecommerce_tracking_enabled') == "no" ) return;
|
||||||
|
|
||||||
|
$tracking_id = get_option('woocommerce_ga_id');
|
||||||
|
|
||||||
|
if ( ! $tracking_id ) return;
|
||||||
|
|
||||||
|
// Doing eCommerce tracking so unhook standard tracking from the footer
|
||||||
|
remove_action('wp_footer', 'woocommerce_google_tracking');
|
||||||
|
|
||||||
|
// Get the order and output tracking code
|
||||||
|
$order = new WC_Order($order_id);
|
||||||
|
|
||||||
|
$loggedin = (is_user_logged_in()) ? 'yes' : 'no';
|
||||||
|
if (is_user_logged_in()) {
|
||||||
|
$user_id = get_current_user_id();
|
||||||
|
$current_user = get_user_by('id', $user_id);
|
||||||
|
$username = $current_user->user_login;
|
||||||
|
} else {
|
||||||
|
$user_id = '';
|
||||||
|
$username = __('Guest', 'woocommerce');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var _gaq = _gaq || [];
|
||||||
|
|
||||||
|
_gaq.push(
|
||||||
|
['_setAccount', '<?php echo $tracking_id; ?>'],
|
||||||
|
['_setCustomVar', 1, 'logged-in', '<?php echo $loggedin; ?>', 1],
|
||||||
|
['_setCustomVar', 2, 'user-id', '<?php echo $user_id; ?>', 1],
|
||||||
|
['_setCustomVar', 3, 'username', '<?php echo $username; ?>', 1],
|
||||||
|
['_trackPageview']
|
||||||
|
);
|
||||||
|
|
||||||
|
_gaq.push(['_addTrans',
|
||||||
|
'<?php echo $order_id; ?>', // order ID - required
|
||||||
|
'<?php bloginfo('name'); ?>', // affiliation or store name
|
||||||
|
'<?php echo $order->order_total; ?>', // total - required
|
||||||
|
'<?php echo $order->get_total_tax(); ?>', // tax
|
||||||
|
'<?php echo $order->get_shipping(); ?>', // shipping
|
||||||
|
'<?php echo $order->billing_city; ?>', // city
|
||||||
|
'<?php echo $order->billing_state; ?>', // state or province
|
||||||
|
'<?php echo $order->billing_country; ?>' // country
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Order items
|
||||||
|
<?php if ($order->get_items()) foreach($order->get_items() as $item) : $_product = $order->get_product_from_item( $item ); ?>
|
||||||
|
_gaq.push(['_addItem',
|
||||||
|
'<?php echo $order_id; ?>', // order ID - required
|
||||||
|
'<?php if (!empty($_product->sku))
|
||||||
|
echo __('SKU:', 'woocommerce') . ' ' . $_product->sku;
|
||||||
|
else
|
||||||
|
echo $_product->id;
|
||||||
|
?>', // SKU/code - required
|
||||||
|
'<?php echo $item['name']; ?>', // product name
|
||||||
|
'<?php if (isset($_product->variation_data)){
|
||||||
|
echo woocommerce_get_formatted_variation( $_product->variation_data, true );
|
||||||
|
} else {
|
||||||
|
$out = array();
|
||||||
|
$categories = get_the_terms($_product->id, 'product_cat');
|
||||||
|
foreach ( $categories as $category ){
|
||||||
|
$out[] = $category->name;
|
||||||
|
}
|
||||||
|
echo join( "/", $out);
|
||||||
|
}
|
||||||
|
?>', // category or variation
|
||||||
|
'<?php echo ($item['line_total']/$item['qty']); ?>', // unit price - required
|
||||||
|
'<?php echo $item['qty']; ?>' // quantity - required
|
||||||
|
]);
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
_gaq.push(['_trackTrans']); // submits transaction to the Analytics servers
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||||
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||||
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
} // End init_form_fields()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the integration to WooCommerce
|
||||||
|
**/
|
||||||
|
function add_google_analytics_integration( $integrations ) {
|
||||||
|
$integrations[] = 'WC_Google_Analytics'; return $integrations;
|
||||||
|
}
|
||||||
|
add_filter('woocommerce_integrations', 'add_google_analytics_integration' );
|
|
@ -0,0 +1,76 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* ShareDaddy Integration
|
||||||
|
*
|
||||||
|
* Enables ShareDaddy integration.
|
||||||
|
*
|
||||||
|
* @class WC_ShareThis
|
||||||
|
* @package WooCommerce
|
||||||
|
* @category Integrations
|
||||||
|
* @author WooThemes
|
||||||
|
*/
|
||||||
|
class WC_ShareDaddy extends WC_Integration {
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->id = 'sharedaddy';
|
||||||
|
$this->method_title = __( 'ShareDaddy', 'woocommerce' );
|
||||||
|
$this->method_description = __( 'ShareDaddy is a sharing plugin bundled with JetPack.', 'woocommerce' );
|
||||||
|
|
||||||
|
// Load the form fields.
|
||||||
|
$this->init_form_fields();
|
||||||
|
|
||||||
|
// Load the settings.
|
||||||
|
$this->init_settings();
|
||||||
|
|
||||||
|
// Define user set variables
|
||||||
|
$this->enabled = $this->settings['enabled'];
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
add_action( 'woocommerce_update_options_integration_sharedaddy', array( &$this, 'process_admin_options') );
|
||||||
|
|
||||||
|
// Share widget
|
||||||
|
add_action( 'woocommerce_share', array( &$this, 'sharedaddy_code') );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise Settings Form Fields
|
||||||
|
*/
|
||||||
|
function init_form_fields() {
|
||||||
|
|
||||||
|
$this->form_fields = array(
|
||||||
|
'enabled' => array(
|
||||||
|
'title' => __( 'Output ShareDaddy button?', 'woocommerce' ),
|
||||||
|
'description' => __( 'Enable this option to show the ShareDaddy button on the product page.', 'woocommerce' ),
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'default' => get_option('woocommerce_sharedaddy') ? get_option('woocommerce_sharedaddy') : 'no'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
} // End init_form_fields()
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sharedaddy_code function.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function sharedaddy_code() {
|
||||||
|
global $post;
|
||||||
|
|
||||||
|
if ( $this->enabled == 'yes' && function_exists('sharing_display') ) {
|
||||||
|
|
||||||
|
?><div class="social"><?php echo sharing_display(); ?></div><?php
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the integration to WooCommerce
|
||||||
|
**/
|
||||||
|
function add_sharedaddy_integration( $integrations ) {
|
||||||
|
if ( class_exists('jetpack') )
|
||||||
|
$integrations[] = 'WC_ShareDaddy';
|
||||||
|
return $integrations;
|
||||||
|
}
|
||||||
|
add_filter('woocommerce_integrations', 'add_sharedaddy_integration' );
|
|
@ -0,0 +1,95 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* ShareThis Integration
|
||||||
|
*
|
||||||
|
* Enables ShareThis integration.
|
||||||
|
*
|
||||||
|
* @class WC_ShareThis
|
||||||
|
* @package WooCommerce
|
||||||
|
* @category Integrations
|
||||||
|
* @author WooThemes
|
||||||
|
*/
|
||||||
|
class WC_ShareThis extends WC_Integration {
|
||||||
|
|
||||||
|
var $default_code;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->id = 'sharethis';
|
||||||
|
$this->method_title = __( 'ShareThis', 'woocommerce' );
|
||||||
|
$this->method_description = __( 'ShareThis offers a sharing widget which will allow customers to share links to products with their friends.', 'woocommerce' );
|
||||||
|
|
||||||
|
$this->default_code = '<div class="social">
|
||||||
|
<iframe src="https://www.facebook.com/plugins/like.php?href={permalink}&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
|
||||||
|
<span class="st_twitter"></span><span class="st_email"></span><span class="st_sharethis"></span><span class="st_plusone_button"></span>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
// Load the form fields.
|
||||||
|
$this->init_form_fields();
|
||||||
|
|
||||||
|
// Load the settings.
|
||||||
|
$this->init_settings();
|
||||||
|
|
||||||
|
// Define user set variables
|
||||||
|
$this->publisher_id = $this->settings['publisher_id'];
|
||||||
|
$this->sharethis_code = $this->settings['sharethis_code'];
|
||||||
|
|
||||||
|
if ( ! $this->sharethis_code ) $this->sharethis_code = $this->default_code;
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
add_action( 'woocommerce_update_options_integration_sharethis', array( &$this, 'process_admin_options') );
|
||||||
|
|
||||||
|
// Share widget
|
||||||
|
add_action( 'woocommerce_share', array( &$this, 'sharethis_code') );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise Settings Form Fields
|
||||||
|
*/
|
||||||
|
function init_form_fields() {
|
||||||
|
|
||||||
|
$this->form_fields = array(
|
||||||
|
'publisher_id' => array(
|
||||||
|
'title' => __( 'ShareThis Publisher ID', 'woocommerce' ),
|
||||||
|
'description' => sprintf( __( 'Enter your %1$sShareThis publisher ID%2$s to show social sharing buttons on product pages.', 'woocommerce' ), '<a href="http://sharethis.com/account/">', '</a>' ),
|
||||||
|
'type' => 'text',
|
||||||
|
'default' => get_option('woocommerce_sharethis')
|
||||||
|
),
|
||||||
|
'sharethis_code' => array(
|
||||||
|
'title' => __( 'ShareThis Code', 'woocommerce' ),
|
||||||
|
'description' => __( 'You can tweak the ShareThis code by editing this option.', 'woocommerce' ),
|
||||||
|
'type' => 'textarea',
|
||||||
|
'default' => $this->default_code
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
} // End init_form_fields()
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sharethis_code function.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function sharethis_code() {
|
||||||
|
global $post;
|
||||||
|
|
||||||
|
if ( $this->publisher_id ) {
|
||||||
|
|
||||||
|
$sharethis = ( is_ssl() ) ? 'https://ws.sharethis.com/button/buttons.js' : 'http://w.sharethis.com/button/buttons.js';
|
||||||
|
|
||||||
|
echo str_replace( '{permalink}', urlencode(get_permalink($post->ID)), $this->sharethis_code );
|
||||||
|
|
||||||
|
echo '<script type="text/javascript">var switchTo5x=true;</script><script type="text/javascript" src="' . $sharethis . '"></script>';
|
||||||
|
echo '<script type="text/javascript">stLight.options({publisher:"' . $this->publisher_id . '"});</script>';
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the integration to WooCommerce
|
||||||
|
**/
|
||||||
|
function add_sharethis_integration( $integrations ) {
|
||||||
|
$integrations[] = 'WC_ShareThis'; return $integrations;
|
||||||
|
}
|
||||||
|
add_filter('woocommerce_integrations', 'add_sharethis_integration' );
|
|
@ -0,0 +1,383 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once "sdk/class.shareyourcart-base.php";
|
||||||
|
|
||||||
|
class ShareYourCartWooCommerce extends ShareYourCartBase {
|
||||||
|
|
||||||
|
public $settings;
|
||||||
|
public $_plugin_name = "shareyourcart_woo_commerce";
|
||||||
|
public $_post_user_id = 1;
|
||||||
|
protected static $_VERSION = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param null
|
||||||
|
*/
|
||||||
|
function __construct( $settings ) {
|
||||||
|
|
||||||
|
$this->settings = $settings;
|
||||||
|
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
//if there is installed another plugin with a never version
|
||||||
|
//do not load this one further
|
||||||
|
if (!$this->canLoad()) return;
|
||||||
|
|
||||||
|
// Shortcodes
|
||||||
|
add_shortcode( 'shareyourcart', array(&$this, 'getButton') );
|
||||||
|
add_shortcode( 'shareyourcart_button', array(&$this, 'getButton') );
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
add_action( 'init', array(&$this, 'init') );
|
||||||
|
add_action( 'wp', array(&$this, 'hook_buttons') );
|
||||||
|
add_action( 'wp_head', array(&$this, 'wp_head') );
|
||||||
|
}
|
||||||
|
|
||||||
|
function admin_settings_page() {
|
||||||
|
$this->checkSDKStatus(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* processInit function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function init() {
|
||||||
|
if (isset($_REQUEST['action'])) {
|
||||||
|
switch ($_REQUEST['action']) {
|
||||||
|
case $this->_plugin_name:
|
||||||
|
$this->buttonCallback();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $this->_plugin_name . '_coupon':
|
||||||
|
$this->couponCallback();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hook_buttons function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function hook_buttons() {
|
||||||
|
if ( $this->isSingleProduct() )
|
||||||
|
add_filter('woocommerce_product_description_heading', array(&$this, '_getProductButton'));
|
||||||
|
|
||||||
|
add_action('woocommerce_cart_coupon', array(&$this, '_getCartButton'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function wp_head() {
|
||||||
|
echo '<meta property="syc:client_id" content="' . $this->getClientId() . '" />';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function _getProductButton( $title ) {
|
||||||
|
$title .= $this->getProductButton();
|
||||||
|
return $title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function _getCartButton() {
|
||||||
|
echo '<div id="shareyourcart_button">' . $this->getCartButton() . '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSecretKey() {
|
||||||
|
return '2cfd496d-7812-44ba-91ce-e43c59f6c680';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isSingleProduct() {
|
||||||
|
return is_singular('product');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saveCoupon( $token, $coupon_code, $coupon_value, $coupon_type ) {
|
||||||
|
|
||||||
|
// Create coupon
|
||||||
|
$post_id = $this->_saveCouponPost($coupon_code);
|
||||||
|
|
||||||
|
// Set coupon meta
|
||||||
|
switch ($coupon_type) {
|
||||||
|
case 'amount':
|
||||||
|
$discount_type = 'fixed_product';
|
||||||
|
$free_shipping = 'no';
|
||||||
|
break;
|
||||||
|
case 'percent':
|
||||||
|
$discount_type = 'percent_product';
|
||||||
|
$free_shipping = 'no';
|
||||||
|
break;
|
||||||
|
case 'free_shipping':
|
||||||
|
$discount_type = 'fixed_product';
|
||||||
|
$coupon_value = 0;
|
||||||
|
$free_shipping = 'yes';
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
$discount_type = 'fixed_cart';
|
||||||
|
$free_shipping = 'no';
|
||||||
|
}
|
||||||
|
|
||||||
|
update_post_meta( $post_id, 'customer_email', array() );
|
||||||
|
update_post_meta( $post_id, 'minimum_amount', '' );
|
||||||
|
update_post_meta( $post_id, 'exclude_product_categories', array() );
|
||||||
|
update_post_meta( $post_id, 'product_categories', array() );
|
||||||
|
update_post_meta( $post_id, 'free_shipping', $free_shipping );
|
||||||
|
update_post_meta( $post_id, 'apply_before_tax', 'yes' );
|
||||||
|
update_post_meta( $post_id, 'expiry_date', '' );
|
||||||
|
update_post_meta( $post_id, 'usage_limit', 1 );
|
||||||
|
update_post_meta( $post_id, 'exclude_product_ids', '' );
|
||||||
|
update_post_meta( $post_id, 'product_ids', '' );
|
||||||
|
update_post_meta( $post_id, 'individual_use', 'yes' );
|
||||||
|
update_post_meta( $post_id, 'coupon_amount', $coupon_value );
|
||||||
|
update_post_meta( $post_id, 'discount_type', $discount_type );
|
||||||
|
|
||||||
|
// parent
|
||||||
|
parent::saveCoupon( $token, $coupon_code, $coupon_value, $coupon_type );
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyCoupon( $coupon_code ) {}
|
||||||
|
|
||||||
|
private function _saveCouponPost($coupon_code) {
|
||||||
|
$new_post = array(
|
||||||
|
'post_title' => $coupon_code,
|
||||||
|
'post_name' => ereg_replace("[^A-Za-z0-9]", "", $coupon_code),
|
||||||
|
'post_content' => '',
|
||||||
|
'post_status' => 'publish',
|
||||||
|
'comment_status'=> 'closed',
|
||||||
|
'ping_status' => 'closed',
|
||||||
|
'post_author' => $this->_post_user_id,
|
||||||
|
'post_type' => 'shop_coupon'
|
||||||
|
);
|
||||||
|
|
||||||
|
$post_id = wp_insert_post($new_post);
|
||||||
|
|
||||||
|
return $post_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getButtonCallbackURL() {
|
||||||
|
global $wp_query;
|
||||||
|
|
||||||
|
$callback_url = add_query_arg( 'action', $this->_plugin_name, trailingslashit( home_url() ) );
|
||||||
|
|
||||||
|
if ($this->isSingleProduct()) {
|
||||||
|
$callback_url .= '&p='. $wp_query->post->ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $callback_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buttonCallback() {
|
||||||
|
|
||||||
|
//specify the parameters
|
||||||
|
$params = array(
|
||||||
|
'callback_url' => get_bloginfo('wpurl').'/?action='.$this->_plugin_name.'_coupon'.(isset($_REQUEST['p']) ? '&p='.$_REQUEST['p'] : '' ),
|
||||||
|
'success_url' => get_option('shopping_cart_url'),
|
||||||
|
'cancel_url' => get_option('shopping_cart_url'),
|
||||||
|
);
|
||||||
|
|
||||||
|
//there is no product set, thus send the products from the shopping cart
|
||||||
|
if (!isset($_REQUEST['p'])) {
|
||||||
|
if (empty($_SESSION['cart']))
|
||||||
|
exit("Cart is empty");
|
||||||
|
|
||||||
|
foreach ($_SESSION['cart'] as $cart_details) {
|
||||||
|
$params['cart'][] = $this->_getProductDetails($cart_details['product_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$params['cart'][] = $this->_getProductDetails($_GET['p']);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$this->startSession($params);
|
||||||
|
}
|
||||||
|
catch(Exception $e) {
|
||||||
|
//display the error to the user
|
||||||
|
echo $e->getMessage();
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _getProductDetails($product_id) {
|
||||||
|
$product = new WC_Product($product_id);
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
$product->get_image();
|
||||||
|
|
||||||
|
$image = ob_get_clean();
|
||||||
|
|
||||||
|
return array(
|
||||||
|
"item_name" => $product->get_title(),
|
||||||
|
"item_description" => $product->post->post_content,
|
||||||
|
"item_url" => $product->post->guid,
|
||||||
|
"item_price" => $product->price,
|
||||||
|
"item_picture_url" => $image,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function loadSessionData() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the plugin version.
|
||||||
|
* @return an integer
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function getPluginVersion() {
|
||||||
|
|
||||||
|
return self::$_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the project's URL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function getDomain() {
|
||||||
|
|
||||||
|
return get_bloginfo('url');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the admin's email
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function getAdminEmail() {
|
||||||
|
|
||||||
|
return get_settings('admin_email');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the field value
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function setConfigValue($field, $value) {
|
||||||
|
$this->settings[$field] = $value;
|
||||||
|
update_option( 'woocommerce_shareyourcart_settings', $this->settings );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the field value
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function getConfigValue( $field ) {
|
||||||
|
|
||||||
|
switch ( $field ) {
|
||||||
|
case "clientId" :
|
||||||
|
return $this->settings['client_id'];
|
||||||
|
case "hide_on_checkout" :
|
||||||
|
return ( $this->settings['show_on_cart'] == 'yes' ) ? false : true;
|
||||||
|
case "hide_on_product" :
|
||||||
|
return ( $this->settings['show_on_product'] == 'yes' ) ? false : true;
|
||||||
|
case "appKey" :
|
||||||
|
return $this->settings['app_key'];
|
||||||
|
case "account_status" :
|
||||||
|
return 'active';
|
||||||
|
case "button_type" :
|
||||||
|
|
||||||
|
if ( $this->settings['button_style'] == 'image_button' ) return 2;
|
||||||
|
if ( $this->settings['button_style'] == 'custom_html' ) return 3;
|
||||||
|
|
||||||
|
return 1; // Standard
|
||||||
|
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
return ( isset( $this->settings[$field] ) ) ? $this->settings[$field] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Execute the SQL statement
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function executeNonQuery($sql) {
|
||||||
|
|
||||||
|
if (substr($sql, 0, 12) == "CREATE TABLE") {
|
||||||
|
|
||||||
|
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||||
|
|
||||||
|
//if this is a create table command, use the special function which compares tables
|
||||||
|
dbDelta($sql);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
//use the normal query
|
||||||
|
$wpdb->query($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the row returned from the SQL
|
||||||
|
*
|
||||||
|
* @return an associative array containing the data of the row OR NULL
|
||||||
|
* if there is none
|
||||||
|
*/
|
||||||
|
protected function getRow($sql) {
|
||||||
|
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
//get the row as an associative array
|
||||||
|
return $wpdb->get_row($sql, ARRAY_A);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the table name based on the key
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function getTableName($key) {
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
return $wpdb->base_prefix . $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Insert the row into the specified table
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function insertRow($tableName, $data) {
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
$wpdb->insert($tableName, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Create url for the specified file. The file must be specified in relative path
|
||||||
|
* to the base of the plugin
|
||||||
|
*/
|
||||||
|
protected function createUrl($file) {
|
||||||
|
//get the real file path
|
||||||
|
$file = realpath($file);
|
||||||
|
|
||||||
|
//calculate the relative path from this file
|
||||||
|
$file = SyC::relativepath(dirname(__FILE__), $file);
|
||||||
|
|
||||||
|
//append the relative path to the current file's URL
|
||||||
|
return WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__), "", plugin_basename(__FILE__)).$file;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Called when a new coupon is generated
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function couponCallback() {
|
||||||
|
|
||||||
|
parent::couponCallback();
|
||||||
|
|
||||||
|
//since this is actually an API, exit
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,391 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* ShareYourCart Integration
|
||||||
|
*
|
||||||
|
* Enables ShareYourCart integration.
|
||||||
|
*
|
||||||
|
* @class WC_ShareYourCart
|
||||||
|
* @package WooCommerce
|
||||||
|
* @category Integrations
|
||||||
|
* @author WooThemes
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WC_ShareYourCart extends WC_Integration {
|
||||||
|
|
||||||
|
var $ShareYourCartWooCommerce;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->id = 'shareyourcart';
|
||||||
|
$this->method_title = __( 'ShareYourCart', 'woocommerce' );
|
||||||
|
$this->method_description = sprintf( __( 'Increase your social media exposure by 10 percent! ShareYourCart helps you get more customers by motivating satisfied customers to talk with their friends about your products. For help with ShareYourCart view the <a href="%s">documentation</a>.', 'woocommerce' ), 'http://www.woothemes.com/woocommerce-docs/user-guide/shareyourcart/' );
|
||||||
|
|
||||||
|
// Load the form fields.
|
||||||
|
$this->init_form_fields();
|
||||||
|
|
||||||
|
// Load the settings.
|
||||||
|
$this->init_settings();
|
||||||
|
|
||||||
|
// Define user set variables
|
||||||
|
$this->enabled = $this->settings['enabled'];
|
||||||
|
$this->client_id = $this->settings['client_id'];
|
||||||
|
$this->app_key = $this->settings['app_key'];
|
||||||
|
$this->email = $this->settings['email'];
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
add_action( 'woocommerce_update_options_integration_shareyourcart', array( &$this, 'process_admin_options') );
|
||||||
|
add_action( 'woocommerce_update_options_integration_shareyourcart', array( &$this, 'process_forms') );
|
||||||
|
|
||||||
|
// Actions if enabled
|
||||||
|
if ( $this->enabled == 'yes' ) {
|
||||||
|
add_action( 'wp_enqueue_scripts', array(&$this, 'styles') );
|
||||||
|
|
||||||
|
$this->init_share_your_cart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* styles function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function styles() {
|
||||||
|
wp_enqueue_style( 'shareyourcart', plugins_url( 'css/style.css', __FILE__ ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* init_share_your_cart function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function init_share_your_cart() {
|
||||||
|
|
||||||
|
if ( ! $this->shareYourCartWooCommerce ) {
|
||||||
|
// Share your cart api class
|
||||||
|
include_once('class-shareyourcart-woocommerce.php');
|
||||||
|
|
||||||
|
// Init the class
|
||||||
|
$this->shareYourCartWooCommerce = new ShareYourCartWooCommerce( $this->settings );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* process_forms function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function process_forms() {
|
||||||
|
|
||||||
|
if ( ! empty( $_REQUEST['syc-account'] ) && $_REQUEST['syc-account'] == 'create' ) {
|
||||||
|
|
||||||
|
$this->init_share_your_cart();
|
||||||
|
|
||||||
|
$error = $message = '';
|
||||||
|
|
||||||
|
$redirect = remove_query_arg( 'saved' );
|
||||||
|
$redirect = remove_query_arg( 'wc_error', $redirect );
|
||||||
|
$redirect = remove_query_arg( 'wc_message', $redirect );
|
||||||
|
|
||||||
|
if ( ! empty( $_POST['domain'] ) && ! empty( $_POST['email'] ) && ! empty( $_POST['syc-terms-agreement'] ) ) {
|
||||||
|
if ( ! ( ( $register = $this->shareYourCartWooCommerce->register( $this->shareYourCartWooCommerce->getSecretKey(), $_POST['domain'], $_POST['email'], $message ) ) === false) ) {
|
||||||
|
|
||||||
|
$this->shareYourCartWooCommerce->setConfigValue('app_key', $register['app_key']);
|
||||||
|
$this->shareYourCartWooCommerce->setConfigValue('client_id', $register['client_id']);
|
||||||
|
|
||||||
|
$redirect = remove_query_arg( 'syc-account', $redirect );
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$error = $message;
|
||||||
|
|
||||||
|
if ( json_decode($error) ) {
|
||||||
|
$error = json_decode($error);
|
||||||
|
$error = $error->message;
|
||||||
|
}
|
||||||
|
|
||||||
|
$message = '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$error = __( 'Please complete all fields.', 'woocommerce' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $error ) $redirect = add_query_arg( 'wc_error', urlencode( esc_attr( $error ) ), $redirect );
|
||||||
|
if ( $message ) $redirect = add_query_arg( 'wc_message', urlencode( esc_attr( $message ) ), $redirect );
|
||||||
|
|
||||||
|
wp_safe_redirect( $redirect );
|
||||||
|
exit;
|
||||||
|
|
||||||
|
} elseif ( ! empty( $_REQUEST['syc-account'] ) && $_REQUEST['syc-account'] == 'recover' ) {
|
||||||
|
|
||||||
|
$this->init_share_your_cart();
|
||||||
|
|
||||||
|
$error = $message = '';
|
||||||
|
|
||||||
|
$redirect = remove_query_arg( 'saved' );
|
||||||
|
$redirect = remove_query_arg( 'wc_error', $redirect );
|
||||||
|
$redirect = remove_query_arg( 'wc_message', $redirect );
|
||||||
|
|
||||||
|
if ( ! empty( $_POST['domain'] ) && ! empty( $_POST['email'] ) ) {
|
||||||
|
|
||||||
|
if ( ! $this->shareYourCartWooCommerce->recover( $this->shareYourCartWooCommerce->getSecretKey(), $_POST['domain'], $_POST['email'], $message ) ) {
|
||||||
|
|
||||||
|
$error = $message;
|
||||||
|
|
||||||
|
if ( json_decode($error) ) {
|
||||||
|
$error = json_decode($error);
|
||||||
|
$error = $error->message;
|
||||||
|
}
|
||||||
|
|
||||||
|
$message = '';
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$redirect = remove_query_arg( 'syc-account', $redirect );
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$error = __( 'Please complete all fields.', 'woocommerce' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $error ) $redirect = add_query_arg( 'wc_error', urlencode( esc_attr( $error ) ), $redirect );
|
||||||
|
if ( $message ) $redirect = add_query_arg( 'wc_message', urlencode( esc_attr( $message ) ), $redirect );
|
||||||
|
|
||||||
|
wp_safe_redirect( $redirect );
|
||||||
|
exit;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin Options
|
||||||
|
*
|
||||||
|
* Setup the gateway settings screen.
|
||||||
|
* Override this in your gateway.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
function admin_options() {
|
||||||
|
|
||||||
|
if ( $this->enabled == 'yes' ) {
|
||||||
|
// Installation
|
||||||
|
$this->shareYourCartWooCommerce->install();
|
||||||
|
|
||||||
|
// Check status
|
||||||
|
$this->shareYourCartWooCommerce->admin_settings_page();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( ! $this->client_id && ! $this->app_key ) {
|
||||||
|
|
||||||
|
if ( ! empty( $_REQUEST['syc-account'] ) && $_REQUEST['syc-account'] == 'create' ) {
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="updated">
|
||||||
|
<h3><?php _e('Create a ShareYourCart account', 'woocommerce') ?></h3>
|
||||||
|
<table class="form-table">
|
||||||
|
<tr>
|
||||||
|
<th><?php _e('Domain', 'woocommerce'); ?></th>
|
||||||
|
<td><input type="text" name="domain" id="domain" class="regular-text" value="<?php echo (isset($_POST['domain']) ? $_POST['domain'] : site_url()); ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php _e('Email', 'woocommerce'); ?></th>
|
||||||
|
<td><input type="text" name="email" id="email" class="regular-text" value="<?php echo (isset($_POST['email']) ? $_POST['email'] : get_option('admin_email')); ?>"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th> </th>
|
||||||
|
<td><input class="buttonCheckbox" name="syc-terms-agreement" id="syc-terms-agreement" type="checkbox" /> <label for="syc-terms-agreement"><?php printf(__('I agree to the <a href="%s">ShareYourCart terms and conditions</a>', 'woocommerce'), 'http://shareyourcart.com/terms'); ?></label></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Create Account', 'woocommerce') ?>" /></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
} elseif ( ! empty( $_REQUEST['syc-account'] ) && $_REQUEST['syc-account'] == 'recover' ) {
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="updated">
|
||||||
|
<h3><?php _e('Recover your ShareYourCart account', 'woocommerce') ?></h3>
|
||||||
|
<table class="form-table">
|
||||||
|
<tr>
|
||||||
|
<th><?php _e('Domain', 'woocommerce'); ?></th>
|
||||||
|
<td><input type="text" name="domain" id="domain" class="regular-text" value="<?php echo (isset($_POST['domain']) ? $_POST['domain'] : site_url()); ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php _e('Email', 'woocommerce'); ?></th>
|
||||||
|
<td><input type="text" name="email" id="email" class="regular-text" value="<?php echo (isset($_POST['email']) ? $_POST['email'] : get_option('admin_email')); ?>"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Email me my details', 'woocommerce') ?>" /></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div id="wc_get_started">
|
||||||
|
<span class="main"><?php _e('Setup your ShareYourCart account', 'woocommerce'); ?></span>
|
||||||
|
<span><?php echo $this->method_description; ?></span>
|
||||||
|
<p><a href="<?php echo add_query_arg( 'syc-account', 'create', admin_url( 'admin.php?page=woocommerce&tab=integration§ion=shareyourcart' ) ); ?>" class="button button-primary api-link"><?php _e('Create an account', 'woocommerce'); ?></a> <a href="<?php echo add_query_arg( 'syc-account', 'recover', admin_url( 'admin.php?page=woocommerce&tab=integration§ion=shareyourcart' ) ); ?>" class="button api-link"><?php _e('Can\'t access your account?', 'woocommerce'); ?></a></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<h3><a href="http://shareyourcart.com/"><img src="' . plugins_url( 'sdk/img/shareyourcart-logo.png', __FILE__ ) . '" alt="ShareYourCart" /></a></h3>';
|
||||||
|
echo wpautop( $this->method_description );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<table class="form-table">
|
||||||
|
<?php $this->generate_settings_html(); ?>
|
||||||
|
<?php if ( $this->client_id && $this->app_key ) : ?>
|
||||||
|
<tr>
|
||||||
|
<th><?php _e('Configure ShareYourCart', 'woocommerce'); ?></th>
|
||||||
|
<td>
|
||||||
|
<p><?php _e('You can choose how much of a discount to give (in fixed amount, percentage, or free shipping) and to which social media channels it should it be applied. You can also define what the advertisement should say, so that it fully benefits your sales.', 'woocommerce'); ?></p>
|
||||||
|
<p><a href="http://www.shareyourcart.com/configure/?app_key=<?php echo $this->app_key; ?>&client_id=<?php echo $this->client_id; ?>&email=<?php echo $this->email; ?>" class="button" target="_blank"><?php _e('Configure', 'woocommerce'); ?></a></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
jQuery('#woocommerce_shareyourcart_button_style').change(function(){
|
||||||
|
|
||||||
|
var value = jQuery(this).val();
|
||||||
|
|
||||||
|
if ( value == 'standard_button' ) {
|
||||||
|
jQuery('.standard_button').closest('tr').show();
|
||||||
|
jQuery('.image_button').closest('tr').hide();
|
||||||
|
jQuery('.custom_html').closest('tr').hide();
|
||||||
|
}
|
||||||
|
if ( value == 'image_button' ) {
|
||||||
|
jQuery('.standard_button').closest('tr').hide();
|
||||||
|
jQuery('.image_button').closest('tr').show();
|
||||||
|
jQuery('.custom_html').closest('tr').hide();
|
||||||
|
}
|
||||||
|
if ( value == 'custom_html' ) {
|
||||||
|
jQuery('.standard_button').closest('tr').hide();
|
||||||
|
jQuery('.image_button').closest('tr').hide();
|
||||||
|
jQuery('.custom_html').closest('tr').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}).change();
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Section -->
|
||||||
|
<div><input type="hidden" name="section" value="<?php echo $this->id; ?>" /></div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise Settings Form Fields
|
||||||
|
*/
|
||||||
|
function init_form_fields() {
|
||||||
|
|
||||||
|
$this->form_fields = array(
|
||||||
|
'enabled' => array(
|
||||||
|
'title' => __( 'Enable/Disable', 'woocommerce' ),
|
||||||
|
'label' => __( 'Enable ShareYourCart integration', 'woocommerce' ),
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'default' => 'no',
|
||||||
|
),
|
||||||
|
'client_id' => array(
|
||||||
|
'title' => __( 'Client ID', 'woocommerce' ),
|
||||||
|
'description' => __( 'Get your client ID by creating a ShareYourCart account.', 'woocommerce' ),
|
||||||
|
'type' => 'text',
|
||||||
|
'default' => '',
|
||||||
|
'css' => 'width: 300px'
|
||||||
|
),
|
||||||
|
'app_key' => array(
|
||||||
|
'title' => __( 'App Key', 'woocommerce' ),
|
||||||
|
'description' => __( 'Get your app key by creating a ShareYourCart account.', 'woocommerce' ),
|
||||||
|
'type' => 'text',
|
||||||
|
'default' => '',
|
||||||
|
'css' => 'width: 300px'
|
||||||
|
),
|
||||||
|
'email' => array(
|
||||||
|
'title' => __( 'Email address', 'woocommerce' ),
|
||||||
|
'description' => __( 'The email address you used to sign up for ShareYourCart.', 'woocommerce' ),
|
||||||
|
'type' => 'text',
|
||||||
|
'default' => get_option('admin_email'),
|
||||||
|
'css' => 'width: 300px'
|
||||||
|
),
|
||||||
|
'show_on_product' => array(
|
||||||
|
'title' => __( 'Show button by default on:', 'woocommerce' ),
|
||||||
|
'label' => __( 'Product page', 'woocommerce' ),
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'default' => 'yes',
|
||||||
|
),
|
||||||
|
'show_on_cart' => array(
|
||||||
|
'label' => __( 'Cart page', 'woocommerce' ),
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'default' => 'yes',
|
||||||
|
),
|
||||||
|
'button_style' => array(
|
||||||
|
'title' => __( 'Button style', 'woocommerce' ),
|
||||||
|
'description' => __( 'Select a style for your share buttons', 'woocommerce' ),
|
||||||
|
'default' => 'standard_button',
|
||||||
|
'type' => 'select',
|
||||||
|
'options' => array(
|
||||||
|
'standard_button' => __( 'Standard Button', 'woocommerce' ),
|
||||||
|
'custom_html' => __( 'Custom HTML', 'woocommerce' )
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'button_skin' => array(
|
||||||
|
'title' => __( 'Button skin', 'woocommerce' ),
|
||||||
|
'description' => __( 'Select a skin for your share buttons', 'woocommerce' ),
|
||||||
|
'default' => 'orange',
|
||||||
|
'type' => 'select',
|
||||||
|
'options' => array(
|
||||||
|
'orange' => __( 'Orange', 'woocommerce' ),
|
||||||
|
'blue' => __( 'Blue', 'woocommerce' ),
|
||||||
|
'light' => __( 'Light', 'woocommerce' ),
|
||||||
|
'dark' => __( 'Dark', 'woocommerce' )
|
||||||
|
),
|
||||||
|
'class' => 'standard_button'
|
||||||
|
),
|
||||||
|
'button_position' => array(
|
||||||
|
'title' => __( 'Button position', 'woocommerce' ),
|
||||||
|
'description' => __( 'Where should the button be positioned?', 'woocommerce' ),
|
||||||
|
'default' => 'normal',
|
||||||
|
'type' => 'select',
|
||||||
|
'options' => array(
|
||||||
|
'normal' => __( 'Normal', 'woocommerce' ),
|
||||||
|
'floating' => __( 'Floating', 'woocommerce' )
|
||||||
|
),
|
||||||
|
'class' => 'standard_button'
|
||||||
|
),
|
||||||
|
'button_html' => array(
|
||||||
|
'title' => __( 'HTML for the button', 'woocommerce' ),
|
||||||
|
'description' => __( 'Enter the HTML code for your custom button.', 'woocommerce' ),
|
||||||
|
'default' => '<button>Get a <div class="shareyourcart-discount"></div> discount</button>',
|
||||||
|
'type' => 'textarea',
|
||||||
|
'class' => 'custom_html'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
} // End init_form_fields()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the integration to WooCommerce
|
||||||
|
**/
|
||||||
|
function add_shareyourcart_integration( $integrations ) {
|
||||||
|
if ( ! class_exists('ShareYourCartAPI') ) // Only allow this integration if we're not already using shareyourcart via another plugin
|
||||||
|
$integrations[] = 'WC_ShareYourCart';
|
||||||
|
return $integrations;
|
||||||
|
}
|
||||||
|
add_filter('woocommerce_integrations', 'add_shareyourcart_integration' );
|
|
@ -0,0 +1,24 @@
|
||||||
|
.button_iframe iframe {
|
||||||
|
width: 58px;
|
||||||
|
height: 230px;
|
||||||
|
position: fixed;
|
||||||
|
top:360px;
|
||||||
|
right:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_iframe-normal iframe {
|
||||||
|
float:right;
|
||||||
|
height: 58px;
|
||||||
|
width: 230px;
|
||||||
|
position:relative;
|
||||||
|
z-index:1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_iframe-normal.button_height {
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#shareyourcart_button {
|
||||||
|
margin: .5em 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
|
@ -0,0 +1,479 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* CLASS: Share Your Cart API
|
||||||
|
* AUTHOR: Barandi Solutions
|
||||||
|
* COUNTRY: Romania
|
||||||
|
* EMAIL: catalin.paun@barandisolutions.ro
|
||||||
|
* VERSION : 1.0
|
||||||
|
* DESCRIPTION: This class is used as a wrapper to communicate to the ShareYourCart API.
|
||||||
|
* * Copyright (C) 2011 Barandi Solutions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(!class_exists('ShareYourCartAPI',false)){
|
||||||
|
|
||||||
|
class ShareYourCartAPI {
|
||||||
|
|
||||||
|
protected $SHAREYOURCART_URL = "www.shareyourcart.com";
|
||||||
|
protected $SHAREYOURCART_SANDBOX_URL = "sandbox.shareyourcart.com";
|
||||||
|
protected $SHAREYOURCART_API;
|
||||||
|
protected $SHAREYOURCART_API_REGISTER;
|
||||||
|
protected $SHAREYOURCART_API_RECOVER;
|
||||||
|
protected $SHAREYOURCART_API_ACTIVATE;
|
||||||
|
protected $SHAREYOURCART_API_DEACTIVATE;
|
||||||
|
protected $SHAREYOURCART_API_CREATE;
|
||||||
|
protected $SHAREYOURCART_API_VALIDATE;
|
||||||
|
protected $SHAREYOURCART_API_STATUS;
|
||||||
|
protected $SHAREYOURCART_CONFIGURE;
|
||||||
|
protected $SHAREYOURCART_BUTTON_JS;
|
||||||
|
protected $SHAREYOURCART_BUTTON_URL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param null
|
||||||
|
*/
|
||||||
|
function __construct() {
|
||||||
|
|
||||||
|
$is_live = true;
|
||||||
|
|
||||||
|
//check if the current object has a secret key function
|
||||||
|
//this is for backward compatibility
|
||||||
|
if(method_exists ($this,'getSecretKey')){
|
||||||
|
$secretKey = $this->getSecretKey();
|
||||||
|
if(empty($secretKey)){
|
||||||
|
throw new Exception("You must specify a valid secret key");
|
||||||
|
}
|
||||||
|
|
||||||
|
//check if the secret key is a sandbox one
|
||||||
|
if(strpos($secretKey,"sndbx_") === 0){
|
||||||
|
$this->SHAREYOURCART_URL = $this->SHAREYOURCART_SANDBOX_URL;
|
||||||
|
$is_live = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->SHAREYOURCART_API = (isset($_SERVER['HTTPS']) && !strcasecmp($_SERVER['HTTPS'],'on') ? 'https://' : 'http://') . $this->SHAREYOURCART_URL;
|
||||||
|
$this->SHAREYOURCART_REGISTER = $this->SHAREYOURCART_API.'/account/create';
|
||||||
|
$this->SHAREYOURCART_API_REGISTER = $this->SHAREYOURCART_API.'/account/create';
|
||||||
|
$this->SHAREYOURCART_API_RECOVER = $this->SHAREYOURCART_API.'/account/recover';
|
||||||
|
$this->SHAREYOURCART_API_ACTIVATE = $this->SHAREYOURCART_API.'/account/activate';
|
||||||
|
$this->SHAREYOURCART_API_DEACTIVATE = $this->SHAREYOURCART_API.'/account/deactivate';
|
||||||
|
$this->SHAREYOURCART_API_CREATE = $this->SHAREYOURCART_API.'/session/create';
|
||||||
|
$this->SHAREYOURCART_API_VALIDATE = $this->SHAREYOURCART_API.'/session/validate';
|
||||||
|
$this->SHAREYOURCART_API_STATUS = $this->SHAREYOURCART_API.'/sdk';
|
||||||
|
$this->SHAREYOURCART_CONFIGURE = $this->SHAREYOURCART_API.'/configure';
|
||||||
|
$this->SHAREYOURCART_BUTTON_JS = $this->SHAREYOURCART_API.'/js/'.($is_live ? 'button.js' : 'button_sandbox.js');
|
||||||
|
$this->SHAREYOURCART_BUTTON_URL = $this->SHAREYOURCART_API.'/button';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* startSession
|
||||||
|
* @param array $params
|
||||||
|
* @return array $data
|
||||||
|
*/
|
||||||
|
public function startSession($params) {
|
||||||
|
//make sure the session is started
|
||||||
|
if(session_id() == '')
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
$session = curl_init($this->SHAREYOURCART_API_CREATE);
|
||||||
|
|
||||||
|
// Tell curl to use HTTP POST
|
||||||
|
curl_setopt($session, CURLOPT_POST, true);
|
||||||
|
// Tell curl that this is the body of the POST
|
||||||
|
curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($params,'','&'));
|
||||||
|
// Tell curl not to return headers, but do return the response
|
||||||
|
curl_setopt($session, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$response = curl_exec($session);
|
||||||
|
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($session);
|
||||||
|
|
||||||
|
// If the operation was not succesfull, print the error
|
||||||
|
if($httpCode != 200)
|
||||||
|
throw new Exception($response);
|
||||||
|
|
||||||
|
// Decode the result
|
||||||
|
$results = json_decode($response, true);
|
||||||
|
|
||||||
|
// Find the token
|
||||||
|
if(isset($results['token'])) {
|
||||||
|
|
||||||
|
// Link the token with the current cart ( held in session id )
|
||||||
|
$data = array(
|
||||||
|
'token' => $results['token'],
|
||||||
|
'session_id' => session_id(),
|
||||||
|
);
|
||||||
|
|
||||||
|
// A token was obtained, so redirect the browser
|
||||||
|
header("Location: $results[session_url]", true, 302);
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//show the raw response received ( for debug purposes )
|
||||||
|
throw new Exception($response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* make sure the coupon is valid
|
||||||
|
* @param null
|
||||||
|
*/
|
||||||
|
public function assertCouponIsValid($token, $coupon_code, $coupon_value, $coupon_type) {
|
||||||
|
|
||||||
|
// Verifies POST information
|
||||||
|
if(!isset($token, $coupon_code, $coupon_value, $coupon_type)) {
|
||||||
|
|
||||||
|
throw new Exception(SyC::t('sdk',"At least one of the parameters is missing."));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Urlencode and concatenate the POST arguments
|
||||||
|
$params = array(
|
||||||
|
'token' => $token,
|
||||||
|
'coupon_code' => $coupon_code,
|
||||||
|
'coupon_value' => $coupon_value,
|
||||||
|
'coupon_type'=> $coupon_type,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Make the API call
|
||||||
|
$session = curl_init($this->SHAREYOURCART_API_VALIDATE);
|
||||||
|
|
||||||
|
// Tell curl to use HTTP POST
|
||||||
|
curl_setopt($session, CURLOPT_POST, true);
|
||||||
|
// Tell curl that this is the body of the POST
|
||||||
|
curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($params,'','&'));
|
||||||
|
// Tell curl not to return headers, but do return the response
|
||||||
|
curl_setopt($session, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$response = curl_exec($session);
|
||||||
|
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($session);
|
||||||
|
|
||||||
|
//if the operation was not succesfull, print the error
|
||||||
|
if($httpCode != 200)
|
||||||
|
throw new Exception(SyC::t('sdk',"Coupon Invalid: {coupon}", array('{coupon}' => $response)));
|
||||||
|
|
||||||
|
$results = json_decode($response, true);
|
||||||
|
|
||||||
|
//if the result is not valid, print it
|
||||||
|
if(!isset($results['valid']) || !($results['valid'] === true))
|
||||||
|
throw new Exception(SyC::t('sdk',"Coupon Invalid: {coupon}", array('{coupon}' => $response)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* register
|
||||||
|
* @param string $secretKey
|
||||||
|
* @param string $domain
|
||||||
|
* @param string $email
|
||||||
|
* @param string $message
|
||||||
|
* @return array json_decode
|
||||||
|
*/
|
||||||
|
public function register($secretKey, $domain, $email, &$message = null) {
|
||||||
|
|
||||||
|
// Urlencode and concatenate the POST arguments
|
||||||
|
$params = array(
|
||||||
|
'secret_key' => $secretKey,
|
||||||
|
'domain' => $domain,
|
||||||
|
'email' => $email,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Make the API call
|
||||||
|
$session = curl_init($this->SHAREYOURCART_API_REGISTER);
|
||||||
|
|
||||||
|
// Tell curl to use HTTP POST
|
||||||
|
curl_setopt($session, CURLOPT_POST, true);
|
||||||
|
// Tell curl that this is the body of the POST
|
||||||
|
curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($params,'','&'));
|
||||||
|
// Tell curl not to return headers, but do return the response
|
||||||
|
curl_setopt($session, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$response = curl_exec($session);
|
||||||
|
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($session);
|
||||||
|
|
||||||
|
// If the operation was not succesfull, return FALSE
|
||||||
|
if($httpCode != 200) {
|
||||||
|
if(isset($message)) $message = $response;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if the caller is expecting a message
|
||||||
|
//let him know what happened
|
||||||
|
if(isset($message)){
|
||||||
|
|
||||||
|
$message = SyC::t('sdk','The account has been registered');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the response after decoding it
|
||||||
|
return json_decode($response, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* recover
|
||||||
|
* @param string $secretKey
|
||||||
|
* @param string $domain
|
||||||
|
* @param string $email
|
||||||
|
* @param string $message
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function recover($secretKey, $domain, $email, &$message = null) {
|
||||||
|
|
||||||
|
// Urlencode and concatenate the POST arguments
|
||||||
|
$params = array(
|
||||||
|
'secret_key' => $secretKey,
|
||||||
|
'domain' => $domain,
|
||||||
|
'email' => $email,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Make the API call
|
||||||
|
$session = curl_init($this->SHAREYOURCART_API_RECOVER);
|
||||||
|
|
||||||
|
// Tell curl to use HTTP POST
|
||||||
|
curl_setopt($session, CURLOPT_POST, true);
|
||||||
|
// Tell curl that this is the body of the POST
|
||||||
|
curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($params,'','&'));
|
||||||
|
// Tell curl not to return headers, but do return the response
|
||||||
|
curl_setopt($session, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$response = curl_exec($session);
|
||||||
|
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($session);
|
||||||
|
|
||||||
|
//if the operation was not succesfull, return FALSE
|
||||||
|
if($httpCode != 200) {
|
||||||
|
if(isset($message)) $message = $response;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if the caller is expecting a message
|
||||||
|
//let him know what happened
|
||||||
|
if(isset($message)){
|
||||||
|
|
||||||
|
$message = (!empty($response) ? $response : SyC::t('sdk',"An email has been sent with your credentials at {email}",array('{email}' => $email)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setAccountStatus
|
||||||
|
* @param string $secretKey
|
||||||
|
* @param string $clientId
|
||||||
|
* @param string $appKey
|
||||||
|
* @param string $activate
|
||||||
|
* @param string $message
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function setAccountStatus($secretKey, $clientId, $appKey, $activate = true, &$message = null) {
|
||||||
|
|
||||||
|
// Urlencode and concatenate the POST arguments
|
||||||
|
$params = array(
|
||||||
|
'secret_key' => $secretKey,
|
||||||
|
'client_id' => $clientId,
|
||||||
|
'app_key' => $appKey,
|
||||||
|
);
|
||||||
|
|
||||||
|
//make the API call
|
||||||
|
$session = curl_init($activate ? $this->SHAREYOURCART_API_ACTIVATE : $this->SHAREYOURCART_API_DEACTIVATE);
|
||||||
|
|
||||||
|
// Tell curl to use HTTP POST
|
||||||
|
curl_setopt($session, CURLOPT_POST, true);
|
||||||
|
// Tell curl that this is the body of the POST
|
||||||
|
curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($params,'','&'));
|
||||||
|
// Tell curl not to return headers, but do return the response
|
||||||
|
curl_setopt($session, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$response = curl_exec($session);
|
||||||
|
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($session);
|
||||||
|
|
||||||
|
// Notify the caller
|
||||||
|
if($httpCode != 200) {
|
||||||
|
if(isset($message)) $message = $response;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if the caller is expecting a message
|
||||||
|
//let him know what happened
|
||||||
|
if(isset($message)){
|
||||||
|
|
||||||
|
$message = (!empty($response) ? $response : ($activate ? SyC::t('sdk','The account has been enabled') : SyC::t('sdk','The account has been disabled')));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setAccountStatus
|
||||||
|
* @param string $secretKey
|
||||||
|
* @param string $clientId
|
||||||
|
* @param string $appKey
|
||||||
|
* @param string $message
|
||||||
|
* @return array or FALSE
|
||||||
|
*/
|
||||||
|
public function getSDKStatus($secretKey=null, $clientId=null, $appKey=null, &$message = null)
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if(isset($secretKey)) $params['secret_key'] = $secretKey;
|
||||||
|
if(isset($clientId)) $params['client_id'] = $clientId;
|
||||||
|
if(isset($appKey)) $params['app_key'] = $appKey;
|
||||||
|
|
||||||
|
//make the API call
|
||||||
|
$session = curl_init($this->SHAREYOURCART_API_STATUS);
|
||||||
|
|
||||||
|
// Tell curl to use HTTP POST
|
||||||
|
curl_setopt($session, CURLOPT_POST, true);
|
||||||
|
// Tell curl that this is the body of the POST
|
||||||
|
curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($params,'','&'));
|
||||||
|
// Tell curl not to return headers, but do return the response
|
||||||
|
curl_setopt($session, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$response = curl_exec($session);
|
||||||
|
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($session);
|
||||||
|
|
||||||
|
// Notify the caller
|
||||||
|
if($httpCode != 200) {
|
||||||
|
if(isset($message)) $message = $response;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decode the result
|
||||||
|
return json_decode($response, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This class should contain all the static methods in the SDK
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class SyC
|
||||||
|
{
|
||||||
|
static $_messages;
|
||||||
|
static $_language = 'en';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Change the language the SDK should be displayed in
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static function setLanguage($newLanguage = null){
|
||||||
|
self::$_language = $newLanguage;
|
||||||
|
|
||||||
|
//reset the old messages, so that they are reloaded
|
||||||
|
self::$_messages = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Translate the specified message
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static function t($category,$message,$params=array())
|
||||||
|
{
|
||||||
|
//load the translation from file if not done so
|
||||||
|
if(!isset(self::$_messages)){
|
||||||
|
|
||||||
|
//The language is the folder name, and the category is the name of the file
|
||||||
|
$messageFile = dirname(__FILE__).DIRECTORY_SEPARATOR.'messages'.DIRECTORY_SEPARATOR.self::$_language.DIRECTORY_SEPARATOR.$category.'.php';
|
||||||
|
|
||||||
|
if(is_file($messageFile))
|
||||||
|
{
|
||||||
|
self::$_messages=include($messageFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
//make sure we have an array for this variable
|
||||||
|
if(!is_array(self::$_messages)) self::$_messages=array();
|
||||||
|
}
|
||||||
|
|
||||||
|
//check if the text has a valid translation
|
||||||
|
if(isset(self::$_messages[$message]) && !empty(self::$_messages[$message])){
|
||||||
|
$message = self::$_messages[$message];
|
||||||
|
}
|
||||||
|
|
||||||
|
//return the translated message, with the parameters replaced
|
||||||
|
return $params!==array() ? strtr($message,$params) : $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function relativepath($from, $to, $ps = '/' ,$ds = DIRECTORY_SEPARATOR)
|
||||||
|
{
|
||||||
|
$arFrom = explode($ds, rtrim($from, $ds));
|
||||||
|
$arTo = explode($ds, rtrim($to, $ds));
|
||||||
|
|
||||||
|
while(count($arFrom) && count($arTo) && ($arFrom[0] == $arTo[0]))
|
||||||
|
{
|
||||||
|
array_shift($arFrom);
|
||||||
|
array_shift($arTo);
|
||||||
|
}
|
||||||
|
return str_pad("", count($arFrom) * 3, '..'.$ps).implode($ps, $arTo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rel2Abs
|
||||||
|
* @param string $src
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function rel2Abs($rel, $base) {
|
||||||
|
|
||||||
|
/* return if already absolute URL */
|
||||||
|
if (parse_url($rel, PHP_URL_SCHEME) != '')
|
||||||
|
return $rel;
|
||||||
|
|
||||||
|
/* queries and anchors */
|
||||||
|
if ($rel[0] == '#' || $rel[0] == '?')
|
||||||
|
return $base . $rel;
|
||||||
|
|
||||||
|
/* parse base URL and convert to local variables:
|
||||||
|
$scheme, $host, $path */
|
||||||
|
extract(parse_url($base));
|
||||||
|
|
||||||
|
/* remove non-directory element from path */
|
||||||
|
$path = preg_replace('#/[^/]*$#', '', @$path);
|
||||||
|
|
||||||
|
/* destroy path if relative url points to root */
|
||||||
|
if ($rel[0] == '/')
|
||||||
|
$path = '';
|
||||||
|
|
||||||
|
/* dirty absolute URL */
|
||||||
|
$abs = "$host$path/$rel";
|
||||||
|
|
||||||
|
/* replace '//' or '/./' or '/foo/../' with '/' */
|
||||||
|
$re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#');
|
||||||
|
for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* absolute URL is ready! */
|
||||||
|
return $scheme . '://' . $abs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* htmlIndent
|
||||||
|
* @param string $src
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function htmlIndent($src) {
|
||||||
|
|
||||||
|
//replace all leading spaces with
|
||||||
|
//Attention: this will render wrong html if you split a tag on more lines!
|
||||||
|
return preg_replace_callback('/(^|\n)( +)/', create_function('$match', 'return str_repeat(" ", strlen($match[0]));'
|
||||||
|
), $src);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} //END IF
|
||||||
|
?>
|
|
@ -0,0 +1,406 @@
|
||||||
|
.shareyourcart-button-orange {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
padding: 15px 20px !important;
|
||||||
|
text-align: center !important;
|
||||||
|
border: 1px solid #a15400;
|
||||||
|
width: 170px;
|
||||||
|
color: #623505 !important;
|
||||||
|
font-size: 16px !important;
|
||||||
|
font-weight: bold;
|
||||||
|
text-shadow: 0 1px 1px #ffce97 !important;
|
||||||
|
|
||||||
|
background-color: #fcc436 !important;
|
||||||
|
background-image: -moz-linear-gradient(top, #fcc436, #ff7a01) !important;
|
||||||
|
background-image: -o-linear-gradient(top, #fcc436, #ff7a01) !important;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#fcc436), to(#ff7a01)) !important;
|
||||||
|
|
||||||
|
background-image: linear-gradient(top, #fcc436, #ff7a01) !important;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#fcc436', EndColorStr='#ff7a01') !important;
|
||||||
|
|
||||||
|
border-radius: 10px !important;
|
||||||
|
-moz-border-radius: 10px !important;
|
||||||
|
-webkit-border-radius: 10px !important;
|
||||||
|
|
||||||
|
box-shadow: 0 2px 2px #bfc7cb, inset 0 1px 0px #fee6a9;
|
||||||
|
-moz-box-shadow: 0 2px 2px #bfc7cb, inset 0 1px 0px #fee6a9;
|
||||||
|
-webkit-box-shadow: 0 2px 2px #bfc7cb, inset 0 1px 0px #fee6a9;
|
||||||
|
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-blue {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
padding: 15px 20px !important;
|
||||||
|
text-align: center !important;
|
||||||
|
border: 1px solid #688da9;
|
||||||
|
width: 170px;
|
||||||
|
color: #005fa9 !important;
|
||||||
|
|
||||||
|
font-size: 16px !important;
|
||||||
|
font-weight: bold;
|
||||||
|
text-shadow: 0 1px 1px #fcfdfe !important;
|
||||||
|
|
||||||
|
background-color: #cde5f5 !important;
|
||||||
|
background-image: -moz-linear-gradient(top, #ebf5fb, #b3d8ef) !important;
|
||||||
|
background-image: -o-linear-gradient(top, #ebf5fb, #b3d8ef) !important;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#ebf5fb), to(#b3d8ef)) !important;
|
||||||
|
background-image: -webkit-linear-gradient(top, #ebf5fb, #b3d8ef) !important;
|
||||||
|
background-image: linear-gradient(top, #ebf5fb, #b3d8ef) !important;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ebf5fb', EndColorStr='#b3d8ef');
|
||||||
|
|
||||||
|
border-radius: 10px !important;
|
||||||
|
-moz-border-radius: 10px !important;
|
||||||
|
-webkit-border-radius: 10px !important;
|
||||||
|
|
||||||
|
box-shadow: 0 2px 2px #fcfdfe, inset 0 1px 0px #fcfdfe;
|
||||||
|
-moz-box-shadow: 0 2px 2px #fcfdfe, inset 0 1px 0px #fcfdfe;
|
||||||
|
-webkit-box-shadow: inset 0 1px 0px #fcfdfe;
|
||||||
|
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-orange:hover
|
||||||
|
{
|
||||||
|
background-color: #fff449 !important;
|
||||||
|
background-image: -moz-linear-gradient(top, #fff449, #ff9c01) !important;
|
||||||
|
background-image: -o-linear-gradient(top, #fff449, #ff9c01) !important;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff449), to(#ff9c01)) !important;
|
||||||
|
background-image: -webkit-linear-gradient(top, #fff449, #ff9c01) !important;
|
||||||
|
background-image: linear-gradient(top, #fff449, #ff9c01) !important;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#fff449', EndColorStr='#ff9c01');
|
||||||
|
|
||||||
|
text-shadow: 0 1px 1px #fff !important;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-blue:hover
|
||||||
|
{
|
||||||
|
background-color: #fff449;
|
||||||
|
background-image: -moz-linear-gradient(top, #f4fbff, #d1e6ef) !important;
|
||||||
|
background-image: -o-linear-gradient(top, #f4fbff, #d1e6ef) !important;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#f4fbff), to(#d1e6ef)) !important;
|
||||||
|
background-image: -webkit-linear-gradient(top, #f4fbff, #d1e6ef) !important;
|
||||||
|
background-image: linear-gradient(top, #f4fbff, #d1e6ef) !important;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f4fbff', EndColorStr='#d1e6ef') !important;
|
||||||
|
|
||||||
|
text-shadow: 0 1px 1px #fff;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
.shareyourcart-button-blue:hover, .shareyourcart-button-blue:visited{
|
||||||
|
color: #005fa9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-orange:active {
|
||||||
|
background-image: -moz-linear-gradient(top, #ff7a01, #fcc436);
|
||||||
|
background-image: -o-linear-gradient(top, #ff7a01, #fcc436);
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#ff7a01), to(#fcc436));
|
||||||
|
background-image: -webkit-linear-gradient(top, #ff7a01, #fcc436);
|
||||||
|
background-image: linear-gradient(top, #ff7a01, #fcc436);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ff7a01', EndColorStr='#fcc436');
|
||||||
|
|
||||||
|
box-shadow: 0 0 2px #888, inset 0 1px 0px #fee6a9;
|
||||||
|
-moz-box-shadow: 0 0 2px #888, inset 0 1px 0px #fee6a9;
|
||||||
|
-webkit-box-shadow: 0 0 2px #888, inset 0 1px 0px #fee6a9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-blue:active {
|
||||||
|
background-image: -moz-linear-gradient(top, #d1e6ef, #f4fbff);
|
||||||
|
background-image: -o-linear-gradient(top, #d1e6ef, #f4fbff);
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#d1e6ef), to(#f4fbff));
|
||||||
|
background-image: -webkit-linear-gradient(top, #d1e6ef, #f4fbff);
|
||||||
|
background-image: linear-gradient(top, #d1e6ef, #f4fbff);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#d1e6ef', EndColorStr='#f4fbff');
|
||||||
|
|
||||||
|
box-shadow: 0 0 2px #888, inset 0 1px 0px #fee6a9;
|
||||||
|
-moz-box-shadow: 0 0 2px #888, inset 0 1px 0px #fee6a9;
|
||||||
|
-webkit-box-shadow: 0 0 2px #888, inset 0 1px 0px #fee6a9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-orange p, .shareyourcart-button-blue p{
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px !important;
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-orange small, .shareyourcart-button-blue small{
|
||||||
|
display: block;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-orange img, .shareyourcart-button-blue img{
|
||||||
|
float: left;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PLUGIN OPTIONS STYLE*/
|
||||||
|
.shareyourcart-logo{
|
||||||
|
margin-top: 15px;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#button_skin{
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-table th{
|
||||||
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-table a {
|
||||||
|
color:blue;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-table a:hover {
|
||||||
|
text-decoration:underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.updated p, div.error p{
|
||||||
|
margin: 1em 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.regular-text {
|
||||||
|
width:320px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li#toplevel_page_shareyourcart .wp-menu-toggle{
|
||||||
|
width:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-table {
|
||||||
|
width:90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-table-api {
|
||||||
|
width:80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-small {
|
||||||
|
width:45%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-small tr th {
|
||||||
|
text-align: left;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-small tr td {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-table td {
|
||||||
|
padding-bottom:8px;
|
||||||
|
padding-top:12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-table th {
|
||||||
|
padding-top: 7px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
table tr td {
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonOption {
|
||||||
|
float:left;
|
||||||
|
width:33%;
|
||||||
|
height: 290px;
|
||||||
|
background: url('../img/spacer.png') right top repeat-y;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonOption.last {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
float:none !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background-color: #F9F9F9;
|
||||||
|
border: 1px dashed #2F6FAB;
|
||||||
|
color: black;
|
||||||
|
line-height: 1.1em;
|
||||||
|
padding: 1em;
|
||||||
|
font-family: sans-serif;
|
||||||
|
overflow:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
margin:0;
|
||||||
|
background-color:#d8d7cf;
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.syc-slogan {
|
||||||
|
float: left;
|
||||||
|
font-size: 18px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.syc-update-nag {
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 5px 0;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: center;
|
||||||
|
/*margin: 0 15px;*/
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
/*border-top-width: 0;
|
||||||
|
border-top-style: none;*/
|
||||||
|
-moz-border-radius: 0 0 3px 3px;
|
||||||
|
-webkit-border-bottom-right-radius: 3px;
|
||||||
|
-webkit-border-bottom-left-radius: 3px;
|
||||||
|
-khtml-border-bottom-right-radius: 3px;
|
||||||
|
-khtml-border-bottom-left-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
|
||||||
|
background-color: #FFFBCC;
|
||||||
|
border-color: #E6DB55;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clr {
|
||||||
|
clear:both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrap {
|
||||||
|
padding:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.api-status {
|
||||||
|
line-height: 25px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.api-button {
|
||||||
|
width: 120px;
|
||||||
|
text-align: center !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.api-link {
|
||||||
|
color: #1122CC;
|
||||||
|
font-weight:bold;
|
||||||
|
text-decoration:underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.api-link:hover {
|
||||||
|
color: #1122CC;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.green {
|
||||||
|
color: #118C11;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
color: #F71414;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonOptionLabel {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonOptionRadio {
|
||||||
|
margin:7px 5px 13px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonTextarea {
|
||||||
|
width:280px;
|
||||||
|
height:230px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonCheckbox {
|
||||||
|
margin:4px 4px 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.configure-button-container{
|
||||||
|
margin: auto;
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 212px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#button-container{
|
||||||
|
margin: auto;
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_iframe iframe
|
||||||
|
{
|
||||||
|
width: 58px;
|
||||||
|
height: 230px;
|
||||||
|
position: fixed;
|
||||||
|
top:360px;
|
||||||
|
right:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_iframe-normal iframe
|
||||||
|
{
|
||||||
|
float:right;
|
||||||
|
height: 58px;
|
||||||
|
width: 230px;
|
||||||
|
position:relative;
|
||||||
|
z-index:99999;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ------- VERTICAL BUTTON STYLING -------------*/
|
||||||
|
.vertical{
|
||||||
|
-webkit-transform: rotate(-90deg);
|
||||||
|
-moz-transform: rotate(-90deg);
|
||||||
|
-o-transform: rotate(-90deg);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||||
|
position: absolute !important;
|
||||||
|
right: -165px;
|
||||||
|
position: fixed;
|
||||||
|
height: 235px;
|
||||||
|
width: 235px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vertical-left
|
||||||
|
{
|
||||||
|
-webkit-transform: rotate(-90deg);
|
||||||
|
-moz-transform: rotate(-90deg);
|
||||||
|
-o-transform: rotate(-90deg);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||||
|
position: absolute !important;
|
||||||
|
left: -85px;
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
/* ------- VERTICAL BUTTON STYLING -------------*/
|
||||||
|
|
||||||
|
/* -------- UPDATE MESSAGES --------------- */
|
||||||
|
|
||||||
|
.wrap div.updated, .wrap div.error {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
padding: 0 .6em;
|
||||||
|
margin: 5px 0 15px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
-khtml-border-radius: 3px;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
|
||||||
|
background-color: lightYellow;
|
||||||
|
border-color: #E6DB55;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------- FINISH UPDATE MESSAGES --------------- */
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
.shareyourcart-button-orange{color: #623505 !important;}
|
||||||
|
|
||||||
|
.shareyourcart-button-orange p,
|
||||||
|
.shareyourcart-button-blue p
|
||||||
|
{
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
line-height: 17px;
|
||||||
|
}
|
||||||
|
.shareyourcart-button-orange small,
|
||||||
|
.shareyourcart-button-blue small
|
||||||
|
{
|
||||||
|
display: block;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
line-height: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vertical{right: 0px;}
|
||||||
|
.vertical-left{left:0px;}
|
||||||
|
|
||||||
|
|
||||||
|
/* IE NEEDED STYLES (because ie doesn't display the button vertical on hover) */
|
||||||
|
.shareyourcart-button-blue.vertical:hover,
|
||||||
|
.shareyourcart-button-blue.vertical:active,
|
||||||
|
.shareyourcart-button-orange.vertical:hover,
|
||||||
|
.shareyourcart-button-orange.vertical:active
|
||||||
|
{
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f4fbff', EndColorStr='#d1e6ef')
|
||||||
|
progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shareyourcart-button-blue.vertical-left:hover,
|
||||||
|
.shareyourcart-button-blue.vertical-left:active,
|
||||||
|
.shareyourcart-button-orange.vertical-left:hover,
|
||||||
|
.shareyourcart-button-orange.vertical-left:active
|
||||||
|
{
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f4fbff', EndColorStr='#d1e6ef')
|
||||||
|
progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
.button_iframe iframe {
|
||||||
|
width: 58px;
|
||||||
|
height: 230px;
|
||||||
|
position: fixed;
|
||||||
|
top:360px;
|
||||||
|
right:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_iframe-normal iframe {
|
||||||
|
float:right;
|
||||||
|
height: 58px;
|
||||||
|
width: 230px;
|
||||||
|
position:relative;
|
||||||
|
z-index:1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_iframe-normal.button_height {
|
||||||
|
height: 60px;
|
||||||
|
}
|
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 43 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 781 B |
After Width: | Height: | Size: 3.3 KiB |
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This is the configuration for generating message translations
|
||||||
|
* for the app. It is used by the 'yiic message' command.
|
||||||
|
*/
|
||||||
|
return array(
|
||||||
|
'sourcePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..', //the "sdk" folder's parent ( the actual plugin )
|
||||||
|
'messagePath'=>dirname(__FILE__), //put in this directory
|
||||||
|
'translator' => 'SyC::t', //the functions name that we use to translate the SDK
|
||||||
|
'languages'=>array('ro','fr','cs'),
|
||||||
|
'fileTypes'=>array('php'),
|
||||||
|
'overwrite' => true, //override old translation file
|
||||||
|
'removeOld' => true, //remove old translations
|
||||||
|
'exclude'=>array(
|
||||||
|
'.svn',
|
||||||
|
'/messages',
|
||||||
|
),
|
||||||
|
);
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Message translations.
|
||||||
|
*
|
||||||
|
* This file is automatically generated by 'yiic message' command.
|
||||||
|
* It contains the localizable messages extracted from source code.
|
||||||
|
* You may modify this file by translating the extracted messages.
|
||||||
|
*
|
||||||
|
* Each array element represents the translation (value) of a message (key).
|
||||||
|
* If the value is empty, the message is considered as not translated.
|
||||||
|
* Messages that no longer need translation will have their translations
|
||||||
|
* enclosed between a pair of '@@' marks.
|
||||||
|
*
|
||||||
|
* Message string can be used with plural forms format. Check i18n section
|
||||||
|
* of the guide for details.
|
||||||
|
*
|
||||||
|
* NOTE, this file must be saved in UTF-8 encoding.
|
||||||
|
*
|
||||||
|
* @version $Id: $
|
||||||
|
*/
|
||||||
|
return array (
|
||||||
|
'API Status:' => '',
|
||||||
|
'App Key' => '',
|
||||||
|
'Blue' => '',
|
||||||
|
'Build your own HTML button' => '',
|
||||||
|
'Button position' => '',
|
||||||
|
'Button skin' => '',
|
||||||
|
'Can\'t access your account?' => '',
|
||||||
|
'Check this if you want the button to be shown on it\'s own row' => '',
|
||||||
|
'Checkout page' => '',
|
||||||
|
'Client ID' => '',
|
||||||
|
'Configure' => '',
|
||||||
|
'Contact' => '',
|
||||||
|
'Create a ShareYourCart account' => '',
|
||||||
|
'Create account' => '',
|
||||||
|
'Create an account' => '',
|
||||||
|
'Custom Button' => '',
|
||||||
|
'Description:' => '',
|
||||||
|
'Disable' => '',
|
||||||
|
'Disabled' => '',
|
||||||
|
'Domain:' => '',
|
||||||
|
'Email:' => '',
|
||||||
|
'Enable' => '',
|
||||||
|
'Enabled' => '',
|
||||||
|
'Enter the domain and email you used when you created the ShareYourCart account' => '',
|
||||||
|
'Failed to save the coupon' => '',
|
||||||
|
'Floating' => '',
|
||||||
|
'For the button to work, you need to specify the following properties in the meta description area' => '',
|
||||||
|
'Generated by ShareYourCart.com' => '',
|
||||||
|
'Get a {value} discount' => '',
|
||||||
|
'Here you can enter the details that will be used by {brand}' => '',
|
||||||
|
'Hover image:' => '',
|
||||||
|
'I agree to create the account on {brand}' => '',
|
||||||
|
'If you want to fully style the {brand} button, use instead the following HTML code' => '',
|
||||||
|
'If you want to use the {brand} button directly in a <strong>theme</strong> or <strong>page template</strong> you have to use the following function call:' => '',
|
||||||
|
'If you want to use the {brand} button on a product\'s page, you need to <strong>append</strong> {product-property} to the {callback-url} value, where {product-property} is the product\'s id' => '',
|
||||||
|
'If you\'ve got 30 seconds, we\'d {link-1} love to know what ideal outcome you\'d like ShareYourCart to help bring to your business</a>, or if you have a private question, you can {link-2} contact us directly</a>' => '',
|
||||||
|
'Image:' => '',
|
||||||
|
'In order to see the {brand} button on a <strong>post</strong> or <strong>page</strong> you can use the following shortcode:' => '',
|
||||||
|
'Include the currency sign as well. I.e: $10' => '',
|
||||||
|
'Increase your social media exposure by 10%!' => '',
|
||||||
|
'Leave blank to use the main description' => '',
|
||||||
|
'New to ShareYourCart™?' => '',
|
||||||
|
'Normal' => '',
|
||||||
|
'Orange' => '',
|
||||||
|
'Product Image:' => '',
|
||||||
|
'Product Price:' => '',
|
||||||
|
'Product page' => '',
|
||||||
|
'Recover my account' => '',
|
||||||
|
'Remarks' => '',
|
||||||
|
'Save' => '',
|
||||||
|
'Show button by default on: ' => '',
|
||||||
|
'Standard Button' => '',
|
||||||
|
'This plugin allows you to easilly set the above meta properties directly in the post or page edit form' => '',
|
||||||
|
'To position the {brand} button, you need to override the following CSS classes' => '',
|
||||||
|
'Use Image Button' => '',
|
||||||
|
'Use Standard Button' => '',
|
||||||
|
'Use wordpress\' featured image functionality. You can find it on the right side.' => '',
|
||||||
|
'You can choose how much of a discount to give (in fixed amount, percentage, or free shipping) and to which social media channels it should it be applied. You can also define what the advertisement should say, so that it fully benefits your sales.' => '',
|
||||||
|
'or' => '',
|
||||||
|
'{brand} helps you get more customers by motivating satisfied customers to talk with their friends about your products. Each customer that promotes your products, via social media, will receive a coupon that they can apply to their shopping cart in order to get a small discount.' => '',
|
||||||
|
'{css_class} for the horrizontal button' => '',
|
||||||
|
'{css_class} for the vertical button' => '',
|
||||||
|
);
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Message translations.
|
||||||
|
*
|
||||||
|
* This file is automatically generated by 'yiic message' command.
|
||||||
|
* It contains the localizable messages extracted from source code.
|
||||||
|
* You may modify this file by translating the extracted messages.
|
||||||
|
*
|
||||||
|
* Each array element represents the translation (value) of a message (key).
|
||||||
|
* If the value is empty, the message is considered as not translated.
|
||||||
|
* Messages that no longer need translation will have their translations
|
||||||
|
* enclosed between a pair of '@@' marks.
|
||||||
|
*
|
||||||
|
* Message string can be used with plural forms format. Check i18n section
|
||||||
|
* of the guide for details.
|
||||||
|
*
|
||||||
|
* NOTE, this file must be saved in UTF-8 encoding.
|
||||||
|
*
|
||||||
|
* @version $Id: $
|
||||||
|
*/
|
||||||
|
return array (
|
||||||
|
'API Status:' => '',
|
||||||
|
'App Key' => '',
|
||||||
|
'Blue' => '',
|
||||||
|
'Build your own HTML button' => '',
|
||||||
|
'Button position' => '',
|
||||||
|
'Button skin' => '',
|
||||||
|
'Can\'t access your account?' => '',
|
||||||
|
'Check this if you want the button to be shown on it\'s own row' => '',
|
||||||
|
'Checkout page' => '',
|
||||||
|
'Client ID' => '',
|
||||||
|
'Configure' => '',
|
||||||
|
'Contact' => '',
|
||||||
|
'Create a ShareYourCart account' => '',
|
||||||
|
'Create account' => '',
|
||||||
|
'Create an account' => '',
|
||||||
|
'Custom Button' => '',
|
||||||
|
'Description:' => '',
|
||||||
|
'Disable' => '',
|
||||||
|
'Disabled' => '',
|
||||||
|
'Domain:' => '',
|
||||||
|
'Email:' => '',
|
||||||
|
'Enable' => '',
|
||||||
|
'Enabled' => '',
|
||||||
|
'Enter the domain and email you used when you created the ShareYourCart account' => '',
|
||||||
|
'Failed to save the coupon' => '',
|
||||||
|
'Floating' => '',
|
||||||
|
'For the button to work, you need to specify the following properties in the meta description area' => '',
|
||||||
|
'Generated by ShareYourCart.com' => '',
|
||||||
|
'Get a {value} discount' => '',
|
||||||
|
'Here you can enter the details that will be used by {brand}' => '',
|
||||||
|
'Hover image:' => '',
|
||||||
|
'I agree to create the account on {brand}' => '',
|
||||||
|
'If you want to fully style the {brand} button, use instead the following HTML code' => '',
|
||||||
|
'If you want to use the {brand} button directly in a <strong>theme</strong> or <strong>page template</strong> you have to use the following function call:' => '',
|
||||||
|
'If you want to use the {brand} button on a product\'s page, you need to <strong>append</strong> {product-property} to the {callback-url} value, where {product-property} is the product\'s id' => '',
|
||||||
|
'If you\'ve got 30 seconds, we\'d {link-1} love to know what ideal outcome you\'d like ShareYourCart to help bring to your business</a>, or if you have a private question, you can {link-2} contact us directly</a>' => '',
|
||||||
|
'Image:' => '',
|
||||||
|
'In order to see the {brand} button on a <strong>post</strong> or <strong>page</strong> you can use the following shortcode:' => '',
|
||||||
|
'Include the currency sign as well. I.e: $10' => '',
|
||||||
|
'Increase your social media exposure by 10%!' => '',
|
||||||
|
'Leave blank to use the main description' => '',
|
||||||
|
'New to ShareYourCart™?' => '',
|
||||||
|
'Normal' => '',
|
||||||
|
'Orange' => '',
|
||||||
|
'Product Image:' => '',
|
||||||
|
'Product Price:' => '',
|
||||||
|
'Product page' => '',
|
||||||
|
'Recover my account' => '',
|
||||||
|
'Remarks' => '',
|
||||||
|
'Save' => '',
|
||||||
|
'Show button by default on: ' => '',
|
||||||
|
'Standard Button' => '',
|
||||||
|
'This plugin allows you to easilly set the above meta properties directly in the post or page edit form' => '',
|
||||||
|
'To position the {brand} button, you need to override the following CSS classes' => '',
|
||||||
|
'Use Image Button' => '',
|
||||||
|
'Use Standard Button' => '',
|
||||||
|
'Use wordpress\' featured image functionality. You can find it on the right side.' => '',
|
||||||
|
'You can choose how much of a discount to give (in fixed amount, percentage, or free shipping) and to which social media channels it should it be applied. You can also define what the advertisement should say, so that it fully benefits your sales.' => '',
|
||||||
|
'or' => '',
|
||||||
|
'{brand} helps you get more customers by motivating satisfied customers to talk with their friends about your products. Each customer that promotes your products, via social media, will receive a coupon that they can apply to their shopping cart in order to get a small discount.' => '',
|
||||||
|
'{css_class} for the horrizontal button' => '',
|
||||||
|
'{css_class} for the vertical button' => '',
|
||||||
|
);
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Message translations.
|
||||||
|
*
|
||||||
|
* This file is automatically generated by 'yiic message' command.
|
||||||
|
* It contains the localizable messages extracted from source code.
|
||||||
|
* You may modify this file by translating the extracted messages.
|
||||||
|
*
|
||||||
|
* Each array element represents the translation (value) of a message (key).
|
||||||
|
* If the value is empty, the message is considered as not translated.
|
||||||
|
* Messages that no longer need translation will have their translations
|
||||||
|
* enclosed between a pair of '@@' marks.
|
||||||
|
*
|
||||||
|
* Message string can be used with plural forms format. Check i18n section
|
||||||
|
* of the guide for details.
|
||||||
|
*
|
||||||
|
* NOTE, this file must be saved in UTF-8 encoding.
|
||||||
|
*
|
||||||
|
* @version $Id: $
|
||||||
|
*/
|
||||||
|
return array (
|
||||||
|
'API Status:' => '',
|
||||||
|
'App Key' => '',
|
||||||
|
'Blue' => '',
|
||||||
|
'Build your own HTML button' => '',
|
||||||
|
'Button position' => '',
|
||||||
|
'Button skin' => '',
|
||||||
|
'Can\'t access your account?' => '',
|
||||||
|
'Check this if you want the button to be shown on it\'s own row' => '',
|
||||||
|
'Checkout page' => '',
|
||||||
|
'Client ID' => '',
|
||||||
|
'Configure' => '',
|
||||||
|
'Contact' => '',
|
||||||
|
'Create a ShareYourCart account' => '',
|
||||||
|
'Create account' => '',
|
||||||
|
'Create an account' => '',
|
||||||
|
'Custom Button' => '',
|
||||||
|
'Description:' => '',
|
||||||
|
'Disable' => '',
|
||||||
|
'Disabled' => '',
|
||||||
|
'Domain:' => '',
|
||||||
|
'Email:' => '',
|
||||||
|
'Enable' => '',
|
||||||
|
'Enabled' => '',
|
||||||
|
'Enter the domain and email you used when you created the ShareYourCart account' => '',
|
||||||
|
'Failed to save the coupon' => '',
|
||||||
|
'Floating' => '',
|
||||||
|
'For the button to work, you need to specify the following properties in the meta description area' => '',
|
||||||
|
'Generated by ShareYourCart.com' => '',
|
||||||
|
'Get a {value} discount' => '',
|
||||||
|
'Here you can enter the details that will be used by {brand}' => '',
|
||||||
|
'Hover image:' => '',
|
||||||
|
'I agree to create the account on {brand}' => '',
|
||||||
|
'If you want to fully style the {brand} button, use instead the following HTML code' => '',
|
||||||
|
'If you want to use the {brand} button directly in a <strong>theme</strong> or <strong>page template</strong> you have to use the following function call:' => '',
|
||||||
|
'If you want to use the {brand} button on a product\'s page, you need to <strong>append</strong> {product-property} to the {callback-url} value, where {product-property} is the product\'s id' => '',
|
||||||
|
'If you\'ve got 30 seconds, we\'d {link-1} love to know what ideal outcome you\'d like ShareYourCart to help bring to your business</a>, or if you have a private question, you can {link-2} contact us directly</a>' => '',
|
||||||
|
'Image:' => '',
|
||||||
|
'In order to see the {brand} button on a <strong>post</strong> or <strong>page</strong> you can use the following shortcode:' => '',
|
||||||
|
'Include the currency sign as well. I.e: $10' => '',
|
||||||
|
'Increase your social media exposure by 10%!' => '',
|
||||||
|
'Leave blank to use the main description' => '',
|
||||||
|
'New to ShareYourCart™?' => '',
|
||||||
|
'Normal' => '',
|
||||||
|
'Orange' => '',
|
||||||
|
'Product Image:' => '',
|
||||||
|
'Product Price:' => '',
|
||||||
|
'Product page' => '',
|
||||||
|
'Recover my account' => '',
|
||||||
|
'Remarks' => '',
|
||||||
|
'Save' => '',
|
||||||
|
'Show button by default on: ' => '',
|
||||||
|
'Standard Button' => '',
|
||||||
|
'This plugin allows you to easilly set the above meta properties directly in the post or page edit form' => '',
|
||||||
|
'To position the {brand} button, you need to override the following CSS classes' => '',
|
||||||
|
'Use Image Button' => '',
|
||||||
|
'Use Standard Button' => '',
|
||||||
|
'Use wordpress\' featured image functionality. You can find it on the right side.' => '',
|
||||||
|
'You can choose how much of a discount to give (in fixed amount, percentage, or free shipping) and to which social media channels it should it be applied. You can also define what the advertisement should say, so that it fully benefits your sales.' => '',
|
||||||
|
'or' => '',
|
||||||
|
'{brand} helps you get more customers by motivating satisfied customers to talk with their friends about your products. Each customer that promotes your products, via social media, will receive a coupon that they can apply to their shopping cart in order to get a small discount.' => '',
|
||||||
|
'{css_class} for the horrizontal button' => '',
|
||||||
|
'{css_class} for the vertical button' => '',
|
||||||
|
);
|
|
@ -0,0 +1,35 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
if(_gaq) _gaq.push(['_trackPageview', '/admin/create-view']);
|
||||||
|
</script>
|
||||||
|
<?php echo SyC::t('sdk','Create a ShareYourCart account'); ?>
|
||||||
|
<form method="POST">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="domain"><?php echo SyC::t('sdk','Domain:'); ?></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="domain" id="domain" class="regular-text" value="<?php echo (isset($_POST['domain']) ? $_POST['domain'] : $this->getDomain()); ?>"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="email"><?php echo SyC::t('sdk','Email:'); ?></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="email" id="email" class="regular-text" value="<?php echo (isset($_POST['email']) ? $_POST['email'] : $this->getAdminEmail()); ?>"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input class="buttonCheckbox" name="syc-terms-agreement" id="syc-terms-agreement" <?php if( $_SERVER['REQUEST_METHOD'] !== 'POST' || isset($_POST['syc-terms-agreement'])){ echo 'checked="checked"'; } ?> type="checkbox" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/create-view/toogle-terms-agreement-click']);"><label for="syc-terms-agreement"><?php echo SyC::t('sdk','I agree to create the account on {brand}',array('{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/create-view/logo-terms-click\']);">www.shareyourcart.com</a>')); ?></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input type="submit" name="syc-create-account" value="<?php echo SyC::t('sdk','Create account'); ?>" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/create-view/save-click']);"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php echo $html;?>
|
||||||
|
</form>
|
|
@ -0,0 +1,30 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
if(_gaq) _gaq.push(['_trackPageview', '/admin/recover-view']);
|
||||||
|
</script>
|
||||||
|
<?php echo SyC::t('sdk','Enter the domain and email you used when you created the ShareYourCart account'); ?>
|
||||||
|
<form method="POST">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="domain"><?php echo SyC::t('sdk','Domain:'); ?></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="domain" id="domain" class="regular-text" value="<?php echo (isset($_POST['domain']) ? $_POST['domain'] : $this->getDomain()); ?>"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="email"><?php echo SyC::t('sdk','Email:'); ?></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="email" id="email" class="regular-text" value="<?php echo (isset($_POST['email']) ? $_POST['email'] : $this->getAdminEmail()); ?>"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input type="submit" name="syc-recover-account" value="<?php echo SyC::t('sdk','Recover my account'); ?>" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/recover-view/save-click']);" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php echo $html;?>
|
||||||
|
</form>
|
|
@ -0,0 +1,23 @@
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo $this->createUrl(dirname(__FILE__).'/../css/admin-style.css'); ?>" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
<?php if($this->SHAREYOURCART_URL == "www.shareyourcart.com"): //only if in production mode anonymously monitor the usage ?>
|
||||||
|
var _gaq = _gaq || [];
|
||||||
|
_gaq.push(['_setAccount', 'UA-2900571-7']);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||||
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||||
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||||
|
})();
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
document.getElementById('syc-form').addEventListener('submit', changetext, false);
|
||||||
|
};
|
||||||
|
|
||||||
|
var changetext = function(){
|
||||||
|
var textarea = document.getElementById('syc_button_textarea').value;
|
||||||
|
document.getElementById('syc_button_textarea').value = encodeURIComponent(textarea);
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,93 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
if(_gaq) _gaq.push(['_trackPageview', '/admin-view']);
|
||||||
|
</script>
|
||||||
|
<div class="wrap">
|
||||||
|
<?php if($show_header):?>
|
||||||
|
|
||||||
|
<?php echo $this->getUpdateNotification(); ?>
|
||||||
|
|
||||||
|
<h2>
|
||||||
|
<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart" class="shareyourcart-logo" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin-view/logo-click']);">
|
||||||
|
<img src="<?php echo $this->createUrl(dirname(__FILE__).'/../img/shareyourcart-logo.png'); ?>"/>
|
||||||
|
</a>
|
||||||
|
<div class="syc-slogan"><?php echo SyC::t('sdk','Increase your social media exposure by 10%!'); ?></div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if(isset($this->adminFix)) echo "<br /><br /><br /><br /><br />";
|
||||||
|
else echo "<br class=\"clr\" /> ";
|
||||||
|
?>
|
||||||
|
</h2>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if(!empty($status_message)): ?>
|
||||||
|
<div class="updated settings-error"><p><strong>
|
||||||
|
<?php echo $status_message; ?>
|
||||||
|
</strong></p></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<p><?php echo SyC::t('sdk','{brand} helps you get more customers by motivating satisfied customers to talk with their friends about your products. Each customer that promotes your products, via social media, will receive a coupon that they can apply to their shopping cart in order to get a small discount.',array('{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart™" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin-view/logo-click\']);">ShareYourCart™</a>')); ?></p>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div id="acount-options">
|
||||||
|
<form method="POST" name="account-form">
|
||||||
|
<fieldset>
|
||||||
|
<div class="api-status" align="right">
|
||||||
|
<?php echo SyC::t('sdk','API Status:'); ?>
|
||||||
|
<?php if($this->isActive()) : ?>
|
||||||
|
<span class="green"><?php echo SyC::t('sdk','Enabled'); ?></span>
|
||||||
|
<?php else :?>
|
||||||
|
<span class="red"><?php echo SyC::t('sdk','Disabled'); ?></span>
|
||||||
|
<?php endif;?>
|
||||||
|
<br />
|
||||||
|
<?php if($this->isActive()) : ?>
|
||||||
|
<input type="submit" value="<?php echo SyC::t('sdk','Disable'); ?>" name="disable-API" class="api-button" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin-view/disable-click']);" />
|
||||||
|
<?php else :?>
|
||||||
|
<input type="submit" value="<?php echo SyC::t('sdk','Enable'); ?>" name="enable-API" class="api-button" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin-view/enable-click']);" />
|
||||||
|
<?php endif;?>
|
||||||
|
</div>
|
||||||
|
<table class="form-table-api" name="shareyourcart_settings">
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo SyC::t('sdk','Client ID'); ?></th>
|
||||||
|
<td><input type="text" name="client_id" id="client_id" class="regular-text" value="<?php echo $this->getClientId(); ?>"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo SyC::t('sdk','App Key'); ?></th>
|
||||||
|
<td><input type="text" name="app_key" id="app_key" class="regular-text" value="<?php echo $this->getAppKey(); ?>"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td><a href="?<?php echo http_build_query(array_merge($_GET,array('syc-account'=>'recover')),'','&')?>" class="api-link" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin-view/recover-click']);"><?php echo SyC::t('sdk',"Can't access your account?"); ?></a> <strong><?php echo SyC::t('sdk','or'); ?></strong> <?php echo SyC::t('sdk','New to ShareYourCart™?'); ?> <a href="?<?php echo http_build_query(array_merge($_GET,array('syc-account'=>'create')),'','&')?>" id="account-recovery" class="api-link" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin-view/create-account-click']);"><?php echo SyC::t('sdk','Create an account'); ?></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php echo $html;?>
|
||||||
|
<div class="submit"><input type="submit" name="syc-account-form" class="button" value="<?php echo SyC::t('sdk','Save'); ?>" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin-view/save-click']);"></div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if($this->isActive()): //show the configure part only if it is active ?>
|
||||||
|
<br/>
|
||||||
|
<fieldset>
|
||||||
|
<p><?php echo SyC::t('sdk','You can choose how much of a discount to give (in fixed amount, percentage, or free shipping) and to which social media channels it should it be applied. You can also define what the advertisement should say, so that it fully benefits your sales.'); ?></p>
|
||||||
|
<br />
|
||||||
|
<form action="<?php echo $this->SHAREYOURCART_CONFIGURE; ?>" method="POST" id="configure-form" target="_blank">
|
||||||
|
|
||||||
|
<div class="configure-button-container" align="center">
|
||||||
|
<input type="submit" value="<?php echo SyC::t('sdk','Configure'); ?>" id="configure-button" class="shareyourcart-button-orange" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin-view/configure-click']);" />
|
||||||
|
<input type="hidden" name="app_key" value="<?php echo $this->getAppKey(); ?>" />
|
||||||
|
<input type="hidden" name="client_id" value="<?php echo $this->getClientId(); ?>" />
|
||||||
|
<input type="hidden" name="email" value="<?php echo $this->getAdminEmail(); ?>" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<?php if($show_footer):?>
|
||||||
|
<br />
|
||||||
|
<h2><?php echo SyC::t('sdk','Contact'); ?></h2>
|
||||||
|
<p><?php echo SyC::t('sdk',"If you've got 30 seconds, we'd {link-1} love to know what ideal outcome you'd like ShareYourCart to help bring to your business</a>, or if you have a private question, you can {link-2} contact us directly</a>", array('{link-1}' => '<a href="http://shareyourcart.uservoice.com" target="_blank" title="forum" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/forum-click\']);">', '{link-2}' => '<a href="http://www.shareyourcart.com/contact" target="_blank" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/contact-click\']);">')); ?></p>
|
||||||
|
<br />
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php endif; //show only if the cart is active ?>
|
||||||
|
</div>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button" <?php echo (isset($callback_url) && !empty($callback_url)) ? "data-syc-callback_url=$callback_url" : ''; ?> data-syc-layout="custom">
|
||||||
|
<?php echo $button_html;?>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function() {
|
||||||
|
var a = document.createElement('script'); a.type = 'text/javascript'; a.async = true;
|
||||||
|
a.src = '<?php echo $this->SHAREYOURCART_BUTTON_JS; ?>';
|
||||||
|
var b = document.getElementsByTagName('script')[0]; b.parentNode.insertBefore(a, b);
|
||||||
|
})();
|
||||||
|
</script>
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
// If only the hover is uploaded
|
||||||
|
if((!$button_img or !$button_img_width or !$button_img_height) and ($button_img_hover and $button_img_hover_width and $button_img_hover_height)) {
|
||||||
|
$button_img = $button_img_hover;
|
||||||
|
$button_img_width = $button_img_hover_width;
|
||||||
|
$button_img_height = $button_img_hover_height;
|
||||||
|
$button_img_hover = null;
|
||||||
|
$button_img_hover_width = null;
|
||||||
|
$button_img_hover_height = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$callbackDataAttr = '';
|
||||||
|
|
||||||
|
if(isset($callback_url) && !empty($callback_url)) {
|
||||||
|
$callbackDataAttr = 'data-syc-callback_url="' . $callback_url .'"';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button" <?php echo $callbackDataAttr; ?> data-syc-layout="custom">
|
||||||
|
ShareYourCart Discount
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.shareyourcart-button {
|
||||||
|
display: block;
|
||||||
|
background: url('<?php echo $button_img;?>') left top;
|
||||||
|
width: <?php echo $button_img_width; ?>px;
|
||||||
|
height: <?php echo $button_img_height; ?>px;
|
||||||
|
text-indent: -9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if($button_img_hover and $button_img_hover_width and $button_img_hover_height) {
|
||||||
|
?>
|
||||||
|
.shareyourcart-button:hover {
|
||||||
|
background-image: url('<?php echo $button_img_hover; ?>');
|
||||||
|
width: <?php echo $button_img_hover_width; ?>px;
|
||||||
|
height: <?php echo $button_img_hover_height; ?>px;
|
||||||
|
}
|
||||||
|
body:after {
|
||||||
|
content: url(<?php echo $button_img_hover; ?>);
|
||||||
|
background-image: url(<?php echo $button_img_hover; ?>);
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
left: -999em;
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function() {
|
||||||
|
var a = document.createElement('script'); a.type = 'text/javascript'; a.async = true;
|
||||||
|
a.src = '<?php echo $this->SHAREYOURCART_BUTTON_JS; ?>';
|
||||||
|
var b = document.getElementsByTagName('script')[0]; b.parentNode.insertBefore(a, b);
|
||||||
|
})();
|
||||||
|
</script>
|
|
@ -0,0 +1,145 @@
|
||||||
|
<?php if(!$this->isActive()) return; //if the plugin is not active, do not show this page ?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view']);
|
||||||
|
</script>
|
||||||
|
<div class="wrap">
|
||||||
|
<?php if($show_header):?>
|
||||||
|
|
||||||
|
<?php echo $this->getUpdateNotification(); ?>
|
||||||
|
|
||||||
|
<h2>
|
||||||
|
<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart" class="shareyourcart-logo" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/logo-click']);">
|
||||||
|
<img src="<?php echo $this->createUrl(dirname(__FILE__).'/../img/shareyourcart-logo.png'); ?>"/>
|
||||||
|
</a>
|
||||||
|
<div class="syc-slogan"><?php echo SyC::t('sdk','Increase your social media exposure by 10%!'); ?></div>
|
||||||
|
<br clear="all" />
|
||||||
|
</h2>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if (!empty($status_message)): ?>
|
||||||
|
<div class="updated settings-error"><p><strong>
|
||||||
|
<?php echo $status_message; ?>
|
||||||
|
</strong></p></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div id="visual-options">
|
||||||
|
<form method="POST" enctype="multipart/form-data" id="syc-form">
|
||||||
|
<fieldset>
|
||||||
|
|
||||||
|
<div class="buttonOption">
|
||||||
|
|
||||||
|
<input class="buttonOptionRadio" type="radio" value="1" id="button_type_1" <?php if ($current_button_type == '1'||$current_button_type == '') echo 'checked' ?> name="button_type" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/default-click']);" />
|
||||||
|
<label class="buttonOptionLabel" for="button_type_1"><?php echo SyC::t('sdk','Use Standard Button'); ?></label>
|
||||||
|
<br /><br />
|
||||||
|
<table class="form-table shareyourcart_button_standard" name="shareyourcart_button_standard">
|
||||||
|
<tr align="center">
|
||||||
|
<th scope="row"><?php echo SyC::t('sdk','Button skin'); ?></th>
|
||||||
|
</tr>
|
||||||
|
<tr align="center">
|
||||||
|
<td>
|
||||||
|
<select name="button_skin" id="button_skin" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/button-skin-click']);">
|
||||||
|
<option name="orange" <?php echo $current_skin == 'orange' ? 'selected="selected"' : ''; ?> value="orange"><?php echo SyC::t('sdk','Orange'); ?></option>
|
||||||
|
<option name="blue" <?php echo $current_skin == 'blue' ? 'selected="selected"' : ''; ?> value="blue"><?php echo SyC::t('sdk','Blue'); ?></option>
|
||||||
|
<option name="light" <?php echo $current_skin == 'light' ? 'selected="selected"' : ''; ?> value="light"><?php echo SyC::t('sdk','Light'); ?></option>
|
||||||
|
<option name="dark" <?php echo $current_skin == 'dark' ? 'selected="selected"' : ''; ?> value="dark"><?php echo SyC::t('sdk','Dark'); ?></option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr align="center">
|
||||||
|
<th scope="row"><?php echo SyC::t('sdk','Button position'); ?></th>
|
||||||
|
</tr>
|
||||||
|
<tr align="center">
|
||||||
|
<td>
|
||||||
|
<select name="button_position" id="button_position" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/button-position-click']);">
|
||||||
|
<option name="normal" <?php echo $current_position == 'normal' ? 'selected="selected"' : ''; ?> value="normal"><?php echo SyC::t('sdk','Normal'); ?></option>
|
||||||
|
<option name="floating" <?php echo $current_position == 'floating' ? 'selected="selected"' : ''; ?> value="floating"><?php echo SyC::t('sdk','Floating'); ?></option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- <tr align="center"> since we switched to <a> on the button, this does not seem to be needed anymore
|
||||||
|
<td>
|
||||||
|
<input class="buttonCheckbox" name="show_on_single_row" <?php echo $show_on_single_row ? 'checked="checked"' : ''; ?> type='checkbox' onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/toggle-show-on-single-row-click']);"><?php echo SyC::t('sdk','Check this if you want the button to be shown on it\'s own row'); ?></input>
|
||||||
|
</td>
|
||||||
|
</tr> -->
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttonOption">
|
||||||
|
<input class="buttonOptionRadio" type="radio" value="2" id="button_type_2" name="button_type" <?php if ($current_button_type == '2') echo 'checked' ?> onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/image-button-click']);"/>
|
||||||
|
<label class="buttonOptionLabel" for="button_type_2"><?php echo SyC::t('sdk','Use Image Button'); ?></label>
|
||||||
|
<br /><?php if (empty($button_img)){ ?><br /><?php } ?>
|
||||||
|
<table class="form-table shareyourcart_button_image" name="shareyourcart_button_image">
|
||||||
|
<tr align="center">
|
||||||
|
<th><label><?php echo SyC::t('sdk','Image:'); ?></label></th>
|
||||||
|
</tr>
|
||||||
|
<tr align="center">
|
||||||
|
<td>
|
||||||
|
<?php if (!empty($button_img)): ?>
|
||||||
|
<img src="<?php echo $button_img ?>" height="40" />
|
||||||
|
<?php endif; ?>
|
||||||
|
<br />
|
||||||
|
<input type="hidden" name="MAX_FILE_SIZE" value="100000000000" />
|
||||||
|
<input type="file" accept="image/gif, image/jpeg, image/jpg, image/png" name="button-img" id="button-img" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/upload-normal-img-click']);" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr align="center">
|
||||||
|
<th><label><?php echo SyC::t('sdk','Hover image:'); ?></label></th>
|
||||||
|
</tr>
|
||||||
|
<tr align="center">
|
||||||
|
<td>
|
||||||
|
<?php if (!empty($button_img_hover)): ?>
|
||||||
|
<img src="<?php echo $button_img_hover ?>" height="40" />
|
||||||
|
<?php endif; ?>
|
||||||
|
<br />
|
||||||
|
<input type="hidden" name="MAX_FILE_SIZE" value="100000000000" />
|
||||||
|
<input type="file" accept="image/gif, image/jpeg, image/jpg, image/png" name="button-img-hover" id="button-img-hover" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/upload-hover-img-click']);" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttonOption last">
|
||||||
|
<input class="buttonOptionRadio" type="radio" value="3" id="button_type_3" name="button_type" <?php if ($current_button_type == '3') echo 'checked' ?> onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/custom-button-click']);"/>
|
||||||
|
<label class="buttonOptionLabel" for="button_type_3"><?php echo SyC::t('sdk','Build your own HTML button'); ?></label>
|
||||||
|
<table class="form-table shareyourcart_button_html" name="shareyourcart_button_html">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<textarea id="syc_button_textarea" class="buttonTextarea" rows="7" cols="56" name="button_html"><?php echo ($button_html!=''?$button_html:'<button>'.SyC::t('sdk','Get a {value} discount',array('{value}' => '<div class="shareyourcart-discount"></div>')).'</button>'); ?></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php echo $html; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br clear="all" />
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
<br />
|
||||||
|
<table class="form-table table-small" name="shareyourcart_settings">
|
||||||
|
<tr>
|
||||||
|
<th scope="row" valign="top"><?php echo SyC::t('sdk','Show button by default on: '); ?></th>
|
||||||
|
<td>
|
||||||
|
<input class="buttonCheckbox" name="show_on_product" <?php echo $show_on_product ? 'checked="checked"' : ''; ?> type='checkbox' onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/toggle-show-on-product-click']);"><?php echo SyC::t('sdk','Product page'); ?></input>
|
||||||
|
<br />
|
||||||
|
<input class="buttonCheckbox" name="show_on_checkout" <?php echo $show_on_checkout ? 'checked="checked"' : ''; ?> type='checkbox' onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/toggle-show-on-checkout-click']);"><?php echo SyC::t('sdk','Checkout page'); ?></input>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="submit"><input type="submit" class="button" name="syc-visual-form" id="syc-visual-form" value="<?php echo SyC::t('sdk','Save'); ?>" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/button-settings-view/save-click']);"></div>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
<br />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if($show_footer):?>
|
||||||
|
<h2><?php echo SyC::t('sdk','Contact'); ?></h2>
|
||||||
|
<p><?php echo SyC::t('sdk',"If you've got 30 seconds, we'd {link-1} love to know what ideal outcome you'd like ShareYourCart to help bring to your business</a>, or if you have a private question, you can {link-2} contact us directly</a>", array('{link-1}' => '<a href="http://shareyourcart.uservoice.com" target="_blank" title="forum" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/forum-click\']);">', '{link-2}' => '<a href="http://www.shareyourcart.com/contact" target="_blank" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/contact-click\']);">')); ?></p>
|
||||||
|
<br />
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button <?php echo ( $this->getConfigValue('button_position') == 'floating' ? 'button_iframe' : 'button_iframe-normal');?> <?php echo ( !$this->getConfigValue('dont_set_height') ? 'button_height' : ''); ?>" <?php echo (isset($callback_url) && !empty($callback_url)) ? "data-syc-callback_url=$callback_url" : ''; ?> data-syc-skin="<?php echo $this->getConfigValue('button_skin');?>" data-syc-orientation="<?php echo $this->getConfigValue('button_position'); ?>" >
|
||||||
|
ShareYourCart Discount
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function() {
|
||||||
|
var a = document.createElement('script'); a.type = 'text/javascript'; a.async = true;
|
||||||
|
a.src = '<?php echo $this->SHAREYOURCART_BUTTON_JS; ?>';
|
||||||
|
var b = document.getElementsByTagName('script')[0]; b.parentNode.insertBefore(a, b);
|
||||||
|
})();
|
||||||
|
</script>
|
|
@ -0,0 +1,85 @@
|
||||||
|
<?php if(!$this->isActive()) return; //if the plugin is not active, do not show this page ?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
if(_gaq) _gaq.push(['_trackPageview', '/admin/documentation']);
|
||||||
|
</script>
|
||||||
|
<div class="wrap">
|
||||||
|
<?php if($show_header):?>
|
||||||
|
|
||||||
|
<?php echo $this->getUpdateNotification(); ?>
|
||||||
|
|
||||||
|
<h2>
|
||||||
|
<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart" class="shareyourcart-logo" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/documentation/logo-click']);">
|
||||||
|
<img src="<?php echo $this->createUrl(dirname(__FILE__).'/../img/shareyourcart-logo.png'); ?>"/>
|
||||||
|
</a>
|
||||||
|
<div class="syc-slogan"><?php echo SyC::t('sdk','Increase your social media exposure by 10%!'); ?></div>
|
||||||
|
<br clear="all" />
|
||||||
|
</h2>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div id="doc-content">
|
||||||
|
<h2><?php echo SyC::t('sdk','Standard Button'); ?></h2>
|
||||||
|
<p><?php echo SyC::t('sdk','In order to see the {brand} button on a <strong>post</strong> or <strong>page</strong> you can use the following shortcode:', array( '{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart™" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/logo-click\']);">ShareYourCart™</a>')); ?></p>
|
||||||
|
<pre><code>[shareyourcart]</code></pre>
|
||||||
|
|
||||||
|
<p><?php echo SyC::t('sdk','If you want to use the {brand} button directly in a <strong>theme</strong> or <strong>page template</strong> you have to use the following function call:', array('{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart™" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/logo-click\']);">ShareYourCart™</a>')); ?></p>
|
||||||
|
<pre><code>echo do_shortcode('[shareyourcart]');</code></pre>
|
||||||
|
<h3><?php echo SyC::t('sdk','Remarks'); ?></h3>
|
||||||
|
<ol>
|
||||||
|
|
||||||
|
<?php if (!(isset($action_url) && !empty($action_url))): //if no shopping cart is active ?>
|
||||||
|
<li><p><?php echo SyC::t('sdk','For the button to work, you need to specify the following properties in the meta description area'); ?></p>
|
||||||
|
<pre><code><?php echo SyC::htmlIndent(nl2br(htmlspecialchars('<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:og="http://ogp.me/ns#"
|
||||||
|
xmlns:syc="http://www.shareyourcart.com">
|
||||||
|
<head>
|
||||||
|
<meta property="og:image" content="http://www.example.com/product-image.jpg"/>
|
||||||
|
<meta property="syc:price" content="$10" />
|
||||||
|
<meta property="og:description"
|
||||||
|
content="
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
|
Proin feugiat nunc quis nibh congue luctus.
|
||||||
|
Maecenas ac est nec turpis fermentum imperdiet.
|
||||||
|
"/>
|
||||||
|
...
|
||||||
|
</head>
|
||||||
|
...
|
||||||
|
</html>'))); ?></code></pre></li>
|
||||||
|
<li><?php echo SyC::t('sdk','This plugin allows you to easilly set the above meta properties directly in the post or page edit form'); ?></li>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<li><p><?php echo SyC::t('sdk','To position the {brand} button, you need to override the following CSS classes', array('{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart™" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/logo-click\']);">ShareYourCart™</a>')); ?></p>
|
||||||
|
<ul>
|
||||||
|
<li><?php echo SyC::t('sdk','{css_class} for the horrizontal button', array('{css_class}' => '<code>button_iframe-normal</code>')); ?></li>
|
||||||
|
<li><?php echo SyC::t('sdk','{css_class} for the vertical button', array('{css_class}' => '<code>button_iframe</code>')); ?></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
|
||||||
|
<h2><?php echo SyC::t('sdk','Custom Button'); ?></h2>
|
||||||
|
<p><?php echo SyC::t('sdk','If you want to fully style the {brand} button, use instead the following HTML code', array('{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart™" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/logo-click\']);">ShareYourCart™</a>')); ?></p>
|
||||||
|
|
||||||
|
<?php $custom_button = '<button class="shareyourcart-button" data-syc-layout="custom"';
|
||||||
|
if (isset($action_url) && !empty($action_url)){
|
||||||
|
//if there is no action url, it means none of the supported shopping carts are active,
|
||||||
|
//so there would be no need for the callback attribute
|
||||||
|
$custom_button .= ' data-syc-callback_url="'.$action_url.'" ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$custom_button .= '>
|
||||||
|
Get a <div class="shareyourcart-discount" ></div> discount
|
||||||
|
</button>'; ?>
|
||||||
|
<pre><code><?php echo SyC::htmlIndent(nl2br(htmlspecialchars($custom_button))); ?></code></pre>
|
||||||
|
|
||||||
|
<?php if (isset($action_url) && !empty($action_url)): //only show if a known shopping cart is active ?>
|
||||||
|
<h3><?php echo SyC::t('sdk','Remarks'); ?></h3>
|
||||||
|
<p><?php echo SyC::t('sdk','If you want to use the {brand} button on a product\'s page, you need to <strong>append</strong> {product-property} to the {callback-url} value, where {product-property} is the product\'s id', array('{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart™" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/logo-click\']);">ShareYourCart™</a>', '{product-property}' => '<code>&p=<product_id></code>', '{callback-url}' => '<strong>data-syc-callback_url</strong>')); ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if($show_footer):?>
|
||||||
|
<h2><?php echo SyC::t('sdk','Contact'); ?></h2>
|
||||||
|
<p><?php echo SyC::t('sdk',"If you've got 30 seconds, we'd {link-1} love to know what ideal outcome you'd like ShareYourCart to help bring to your business</a>, or if you have a private question, you can {link-2} contact us directly</a>", array('{link-1}' => '<a href="http://shareyourcart.uservoice.com" target="_blank" title="forum" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/forum-click\']);">', '{link-2}' => '<a href="http://www.shareyourcart.com/contact" target="_blank" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/contact-click\']);">')); ?></p>
|
||||||
|
<br />
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,15 @@
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo $this->createUrl(dirname(__FILE__).'/../css/style.css'); ?>" />
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<link rel="stylesheet" href="<?php echo $this->createUrl(dirname(__FILE__).'/../css/ie.css'); ?>" type="text/css"/>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
<meta property="syc:client_id" content="<?php echo $this->getClientId(); ?>" />
|
||||||
|
<?php if($this->isActive() & is_array($data)): ?>
|
||||||
|
|
||||||
|
<meta property="og:title" content="<?php echo htmlspecialchars(@$data['item_name']); ?>" />
|
||||||
|
<meta property="og:url" content="<?php echo @$data['item_url'] ?>" />
|
||||||
|
<meta property="og:description" content="<?php echo htmlspecialchars(@$data['item_description']); ?>" />
|
||||||
|
<meta property="og:image" content="<?php echo @$data['item_picture_url'] ?>" />
|
||||||
|
<meta property="syc:price" content="<?php echo @$data['item_price'] ?>" />
|
||||||
|
|
||||||
|
<?php endif; ?>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php if($this->hasNewerVersion()): //if there is a newer version, show the upgrade message?>
|
||||||
|
<div class="syc-update-nag">
|
||||||
|
<strong><?php echo SyC::t('sdk','{link}ShareYourCart {version}</a> is available! {link}Please update now</a>.', array('{version}' => $this->getConfigValue('latest_version'), '{link}' => '<a href="'.$this->getConfigValue("download_url").'" target="_blank">')); ?></strong>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
|
@ -198,6 +198,14 @@ class WC_Flat_Rate extends WC_Shipping_Method {
|
||||||
if ($per_order_cost) {
|
if ($per_order_cost) {
|
||||||
$extra_rate['cost']['order'] = $this_cost;
|
$extra_rate['cost']['order'] = $this_cost;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
$total_quantity = 0;
|
||||||
|
|
||||||
|
// Shipping per item
|
||||||
|
foreach ( $package['contents'] as $item_id => $values )
|
||||||
|
if ( $values['quantity'] > 0 && $values['data']->needs_shipping() )
|
||||||
|
$total_quantity += $values['quantity'];
|
||||||
|
|
||||||
// Per-product shipping
|
// Per-product shipping
|
||||||
$extra_rate['cost']['order'] = $this_cost * $total_quantity;
|
$extra_rate['cost']['order'] = $this_cost * $total_quantity;
|
||||||
}
|
}
|
||||||
|
@ -307,7 +315,6 @@ class WC_Flat_Rate extends WC_Shipping_Method {
|
||||||
function item_shipping( $package ) {
|
function item_shipping( $package ) {
|
||||||
// Per item shipping so we pass an array of costs (per item) instead of a single value
|
// Per item shipping so we pass an array of costs (per item) instead of a single value
|
||||||
$costs = array();
|
$costs = array();
|
||||||
$total_quantity = 0;
|
|
||||||
|
|
||||||
// Shipping per item
|
// Shipping per item
|
||||||
foreach ( $package['contents'] as $item_id => $values ) {
|
foreach ( $package['contents'] as $item_id => $values ) {
|
||||||
|
@ -327,9 +334,6 @@ class WC_Flat_Rate extends WC_Shipping_Method {
|
||||||
}
|
}
|
||||||
|
|
||||||
$costs[$item_id] = ( ( $cost + $fee ) * $values['quantity'] );
|
$costs[$item_id] = ( ( $cost + $fee ) * $values['quantity'] );
|
||||||
|
|
||||||
$total_quantity += $values['quantity'];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class WC_Product_Cat_List_Walker extends Walker {
|
||||||
if ( $args['current_category_ancestors'] && $args['current_category'] && in_array( $cat->term_id, $args['current_category_ancestors'] ) )
|
if ( $args['current_category_ancestors'] && $args['current_category'] && in_array( $cat->term_id, $args['current_category_ancestors'] ) )
|
||||||
$output .= ' current-cat-parent';
|
$output .= ' current-cat-parent';
|
||||||
|
|
||||||
$output .= '"><a href="' . get_term_link( $cat->slug, 'product_cat' ) . '">' . $cat->name . '</a>';
|
$output .= '"><a href="' . get_term_link( (int) $cat->term_id, 'product_cat' ) . '">' . $cat->name . '</a>';
|
||||||
|
|
||||||
if ( $args['show_count'] )
|
if ( $args['show_count'] )
|
||||||
$output .= ' <span class="count">(' . $cat->count . ')</span>';
|
$output .= ' <span class="count">(' . $cat->count . ')</span>';
|
||||||
|
|
|
@ -2,8 +2,8 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: WooCommerce v1.5.4\n"
|
"Project-Id-Version: WooCommerce v1.5.4\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2012-04-18 14:33+0100\n"
|
"POT-Creation-Date: 2012-04-22 15:43+0100\n"
|
||||||
"PO-Revision-Date: 2012-04-18 14:34+0100\n"
|
"PO-Revision-Date: 2012-04-22 15:45+0100\n"
|
||||||
"Last-Translator: Frederik Svarre <FRS@FSLab.dk>\n"
|
"Last-Translator: Frederik Svarre <FRS@FSLab.dk>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -111,20 +111,20 @@ msgid "No products found"
|
||||||
msgstr "Ingen produkter fundet"
|
msgstr "Ingen produkter fundet"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: woocommerce-core-functions.php:586
|
#: woocommerce-core-functions.php:592
|
||||||
#: woocommerce-core-functions.php:650
|
#: woocommerce-core-functions.php:656
|
||||||
msgid "Download Permissions Granted"
|
msgid "Download Permissions Granted"
|
||||||
msgstr "Downloadtilladelse givet"
|
msgstr "Downloadtilladelse givet"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: woocommerce-core-functions.php:684
|
#: woocommerce-core-functions.php:690
|
||||||
#: woocommerce.php:524
|
#: woocommerce.php:524
|
||||||
msgctxt "slug"
|
msgctxt "slug"
|
||||||
msgid "product"
|
msgid "product"
|
||||||
msgstr "produkt"
|
msgstr "produkt"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: woocommerce-core-functions.php:777
|
#: woocommerce-core-functions.php:783
|
||||||
msgid "Select a category"
|
msgid "Select a category"
|
||||||
msgstr "Vælg en kategori"
|
msgstr "Vælg en kategori"
|
||||||
|
|
||||||
|
@ -3249,608 +3249,616 @@ msgstr "mm"
|
||||||
msgid "in"
|
msgid "in"
|
||||||
msgstr "in"
|
msgstr "in"
|
||||||
|
|
||||||
|
#: admin/woocommerce-admin-settings.php:642
|
||||||
|
msgid "yd"
|
||||||
|
msgstr "yd"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:648
|
#: admin/woocommerce-admin-settings.php:649
|
||||||
msgid "Product Reviews"
|
msgid "Product Reviews"
|
||||||
msgstr "Produktanmeldelser"
|
msgstr "Produktanmeldelser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:648
|
#: admin/woocommerce-admin-settings.php:649
|
||||||
msgid "The following options affect product reviews (comments)."
|
msgid "The following options affect product reviews (comments)."
|
||||||
msgstr "Følgende indstillinger påvirker produktanmeldelser (kommentarer)."
|
msgstr "Følgende indstillinger påvirker produktanmeldelser (kommentarer)."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:651
|
#: admin/woocommerce-admin-settings.php:652
|
||||||
msgid "Ratings"
|
msgid "Ratings"
|
||||||
msgstr "Bedømmelser"
|
msgstr "Bedømmelser"
|
||||||
|
|
||||||
#: admin/woocommerce-admin-settings.php:652
|
#: admin/woocommerce-admin-settings.php:653
|
||||||
msgid "Enable the star rating field on the review form"
|
msgid "Enable the star rating field on the review form"
|
||||||
msgstr "Aktiver stjerne-bedømmelsesfeltet ved anmeldelsesformularen"
|
msgstr "Aktiver stjerne-bedømmelsesfeltet ved anmeldelsesformularen"
|
||||||
|
|
||||||
#: admin/woocommerce-admin-settings.php:661
|
#: admin/woocommerce-admin-settings.php:662
|
||||||
msgid "Ratings are required to leave a review"
|
msgid "Ratings are required to leave a review"
|
||||||
msgstr "Bedømmelse er påkrævet for at afgive en anmeldelse"
|
msgstr "Bedømmelse er påkrævet for at afgive en anmeldelse"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:671
|
#: admin/woocommerce-admin-settings.php:672
|
||||||
msgid "Pricing Options"
|
msgid "Pricing Options"
|
||||||
msgstr "Prisindstillinger"
|
msgstr "Prisindstillinger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:671
|
#: admin/woocommerce-admin-settings.php:672
|
||||||
msgid "The following options affect how prices are displayed on the frontend."
|
msgid "The following options affect how prices are displayed on the frontend."
|
||||||
msgstr "Følgende indstillinger påvirker hvordan priser vises på brugerfladen."
|
msgstr "Følgende indstillinger påvirker hvordan priser vises på brugerfladen."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:674
|
#: admin/woocommerce-admin-settings.php:675
|
||||||
msgid "Currency Position"
|
msgid "Currency Position"
|
||||||
msgstr "Valuta position"
|
msgstr "Valuta position"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:675
|
#: admin/woocommerce-admin-settings.php:676
|
||||||
msgid "This controls the position of the currency symbol."
|
msgid "This controls the position of the currency symbol."
|
||||||
msgstr "Denne kontrollerer positionen af valutasymbolet."
|
msgstr "Denne kontrollerer positionen af valutasymbolet."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:682
|
#: admin/woocommerce-admin-settings.php:683
|
||||||
msgid "Left"
|
msgid "Left"
|
||||||
msgstr "Venstre"
|
msgstr "Venstre"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:683
|
#: admin/woocommerce-admin-settings.php:684
|
||||||
msgid "Right"
|
msgid "Right"
|
||||||
msgstr "Højre"
|
msgstr "Højre"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:684
|
#: admin/woocommerce-admin-settings.php:685
|
||||||
msgid "Left (with space)"
|
msgid "Left (with space)"
|
||||||
msgstr "Venstre (med plads)"
|
msgstr "Venstre (med plads)"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:685
|
#: admin/woocommerce-admin-settings.php:686
|
||||||
msgid "Right (with space)"
|
msgid "Right (with space)"
|
||||||
msgstr "Højre (med plads)"
|
msgstr "Højre (med plads)"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:691
|
#: admin/woocommerce-admin-settings.php:692
|
||||||
msgid "Thousand separator"
|
msgid "Thousand separator"
|
||||||
msgstr "Tusindeseparator"
|
msgstr "Tusindeseparator"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:692
|
#: admin/woocommerce-admin-settings.php:693
|
||||||
msgid "This sets the thousand separator of displayed prices."
|
msgid "This sets the thousand separator of displayed prices."
|
||||||
msgstr "Denne fastsætter tusindeseparatoren i viste priser. "
|
msgstr "Denne fastsætter tusindeseparatoren i viste priser. "
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:702
|
#: admin/woocommerce-admin-settings.php:703
|
||||||
msgid "Decimal separator"
|
msgid "Decimal separator"
|
||||||
msgstr "Decimalseparator"
|
msgstr "Decimalseparator"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:703
|
#: admin/woocommerce-admin-settings.php:704
|
||||||
msgid "This sets the decimal separator of displayed prices."
|
msgid "This sets the decimal separator of displayed prices."
|
||||||
msgstr "Denne fastsætter decimalseparatoren i viste priser."
|
msgstr "Denne fastsætter decimalseparatoren i viste priser."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:713
|
#: admin/woocommerce-admin-settings.php:714
|
||||||
msgid "Number of decimals"
|
msgid "Number of decimals"
|
||||||
msgstr "Antallet af decimaler"
|
msgstr "Antallet af decimaler"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:714
|
#: admin/woocommerce-admin-settings.php:715
|
||||||
msgid "This sets the number of decimal points shown in displayed prices."
|
msgid "This sets the number of decimal points shown in displayed prices."
|
||||||
msgstr "Denne fastsætter antallet af decimaler vist i viste priser"
|
msgstr "Denne fastsætter antallet af decimaler vist i viste priser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:724
|
#: admin/woocommerce-admin-settings.php:725
|
||||||
msgid "Trailing zeros"
|
msgid "Trailing zeros"
|
||||||
msgstr "Efterfølgende nuller"
|
msgstr "Efterfølgende nuller"
|
||||||
|
|
||||||
#: admin/woocommerce-admin-settings.php:725
|
#: admin/woocommerce-admin-settings.php:726
|
||||||
msgid "Remove zeros after the decimal point. e.g. <code>$10.00</code> becomes <code>$10</code>"
|
msgid "Remove zeros after the decimal point. e.g. <code>$10.00</code> becomes <code>$10</code>"
|
||||||
msgstr "Fjern nuller efter decimaltegnet. fx <code>$10.00</code> bliver <code>$10</code>"
|
msgstr "Fjern nuller efter decimaltegnet. fx <code>$10.00</code> bliver <code>$10</code>"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:733
|
#: admin/woocommerce-admin-settings.php:734
|
||||||
msgid "Image Options"
|
msgid "Image Options"
|
||||||
msgstr "Billed indstillinger"
|
msgstr "Billed indstillinger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:733
|
#: admin/woocommerce-admin-settings.php:734
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "These settings affect the actual dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to <a href=\"%s\">regenerate your thumbnails</a>."
|
msgid "These settings affect the actual dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to <a href=\"%s\">regenerate your thumbnails</a>."
|
||||||
msgstr "Disse indstillinger påvirker dimensionerne på billeder i dit katalog - Visning på front-end siden vil stadig være påvirket af CSS styles. Efter ændring af disse indstillinger kan du blive nødt til at <a href=\"%s\">regenerere dine miniaturebilleder</a>."
|
msgstr "Disse indstillinger påvirker dimensionerne på billeder i dit katalog - Visning på front-end siden vil stadig være påvirket af CSS styles. Efter ændring af disse indstillinger kan du blive nødt til at <a href=\"%s\">regenerere dine miniaturebilleder</a>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:736
|
#: admin/woocommerce-admin-settings.php:737
|
||||||
msgid "Catalog Images"
|
msgid "Catalog Images"
|
||||||
msgstr "Katalog billeder"
|
msgstr "Katalog billeder"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:737
|
#: admin/woocommerce-admin-settings.php:738
|
||||||
msgid "This size is usually used in product listings"
|
msgid "This size is usually used in product listings"
|
||||||
msgstr "Denne størrelse anvendes normalt i produktlister"
|
msgstr "Denne størrelse anvendes normalt i produktlister"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:746
|
#: admin/woocommerce-admin-settings.php:747
|
||||||
msgid "Single Product Image"
|
msgid "Single Product Image"
|
||||||
msgstr "Enkelt Produkt Billede"
|
msgstr "Enkelt Produkt Billede"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:747
|
#: admin/woocommerce-admin-settings.php:748
|
||||||
msgid "This is the size used by the main image on the product page."
|
msgid "This is the size used by the main image on the product page."
|
||||||
msgstr "Dette er størrelsen, der bliver anvendt på det primære billede på produktsiden."
|
msgstr "Dette er størrelsen, der bliver anvendt på det primære billede på produktsiden."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:756
|
#: admin/woocommerce-admin-settings.php:757
|
||||||
msgid "Product Thumbnails"
|
msgid "Product Thumbnails"
|
||||||
msgstr "Produktminiaturebilleder"
|
msgstr "Produktminiaturebilleder"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:757
|
#: admin/woocommerce-admin-settings.php:758
|
||||||
msgid "This size is usually used for the gallery of images on the product page."
|
msgid "This size is usually used for the gallery of images on the product page."
|
||||||
msgstr "Denne størrelse anvendes normalt i galleribilleder på produktsiden."
|
msgstr "Denne størrelse anvendes normalt i galleribilleder på produktsiden."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:772
|
#: admin/woocommerce-admin-settings.php:773
|
||||||
msgid "Inventory Options"
|
msgid "Inventory Options"
|
||||||
msgstr "Beholdningsindstillinger"
|
msgstr "Beholdningsindstillinger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:775
|
#: admin/woocommerce-admin-settings.php:776
|
||||||
msgid "Manage stock"
|
msgid "Manage stock"
|
||||||
msgstr "Administrer lager"
|
msgstr "Administrer lager"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:776
|
#: admin/woocommerce-admin-settings.php:777
|
||||||
msgid "Enable stock management"
|
msgid "Enable stock management"
|
||||||
msgstr "Aktiver lageradministration"
|
msgstr "Aktiver lageradministration"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:783
|
#: admin/woocommerce-admin-settings.php:784
|
||||||
msgid "Notifications"
|
msgid "Notifications"
|
||||||
msgstr "Meddelelser"
|
msgstr "Meddelelser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:784
|
#: admin/woocommerce-admin-settings.php:785
|
||||||
msgid "Enable low stock notifications"
|
msgid "Enable low stock notifications"
|
||||||
msgstr "Aktiver lav lagerstatus meddelelser"
|
msgstr "Aktiver lav lagerstatus meddelelser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:792
|
#: admin/woocommerce-admin-settings.php:793
|
||||||
msgid "Enable out of stock notifications"
|
msgid "Enable out of stock notifications"
|
||||||
msgstr "Aktiver ikke på lager meddelelser"
|
msgstr "Aktiver ikke på lager meddelelser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:800
|
#: admin/woocommerce-admin-settings.php:801
|
||||||
msgid "Low stock threshold"
|
msgid "Low stock threshold"
|
||||||
msgstr "Lav lagergrænse"
|
msgstr "Lav lagergrænse"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:810
|
#: admin/woocommerce-admin-settings.php:811
|
||||||
msgid "Out of stock threshold"
|
msgid "Out of stock threshold"
|
||||||
msgstr "Ikke på lager grænse"
|
msgstr "Ikke på lager grænse"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:820
|
#: admin/woocommerce-admin-settings.php:821
|
||||||
msgid "Out of stock visibility"
|
msgid "Out of stock visibility"
|
||||||
msgstr "Ikke på lager synlighed"
|
msgstr "Ikke på lager synlighed"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:821
|
#: admin/woocommerce-admin-settings.php:822
|
||||||
msgid "Hide out of stock items from the catalog"
|
msgid "Hide out of stock items from the catalog"
|
||||||
msgstr "Skjul produkter der ikke er på laget fra kataloget"
|
msgstr "Skjul produkter der ikke er på laget fra kataloget"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:834
|
#: admin/woocommerce-admin-settings.php:835
|
||||||
#: admin/woocommerce-admin-settings.php:1290
|
#: admin/woocommerce-admin-settings.php:1300
|
||||||
msgid "Shipping Options"
|
msgid "Shipping Options"
|
||||||
msgstr "Forsendelsesmuligheder"
|
msgstr "Forsendelsesmuligheder"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:834
|
#: admin/woocommerce-admin-settings.php:835
|
||||||
msgid "Shipping can be enabled and disabled from this section."
|
msgid "Shipping can be enabled and disabled from this section."
|
||||||
msgstr "Forsendelse kan aktiveres og deaktiveres fra denne sektion"
|
msgstr "Forsendelse kan aktiveres og deaktiveres fra denne sektion"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:837
|
#: admin/woocommerce-admin-settings.php:838
|
||||||
#: admin/woocommerce-admin-settings.php:846
|
#: admin/woocommerce-admin-settings.php:847
|
||||||
#: admin/woocommerce-admin-settings.php:855
|
#: admin/woocommerce-admin-settings.php:856
|
||||||
msgid "Shipping calculations"
|
msgid "Shipping calculations"
|
||||||
msgstr "Forsendelsesberegninger"
|
msgstr "Forsendelsesberegninger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:838
|
#: admin/woocommerce-admin-settings.php:839
|
||||||
msgid "Enable shipping"
|
msgid "Enable shipping"
|
||||||
msgstr "Aktiver forsendelse"
|
msgstr "Aktiver forsendelse"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:847
|
#: admin/woocommerce-admin-settings.php:848
|
||||||
msgid "Enable the shipping calculator on the cart page"
|
msgid "Enable the shipping calculator on the cart page"
|
||||||
msgstr "Aktiver forsendelsesberegneren på kurvsiden"
|
msgstr "Aktiver forsendelsesberegneren på kurvsiden"
|
||||||
|
|
||||||
#: admin/woocommerce-admin-settings.php:856
|
#: admin/woocommerce-admin-settings.php:857
|
||||||
msgid "Hide shipping costs until an address is entered"
|
msgid "Hide shipping costs until an address is entered"
|
||||||
msgstr "Skjul forsendelsesomkostninger indtil en adresse er angivet"
|
msgstr "Skjul forsendelsesomkostninger indtil en adresse er angivet"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:864
|
#: admin/woocommerce-admin-settings.php:865
|
||||||
msgid "Shipping destination"
|
msgid "Shipping destination"
|
||||||
msgstr "Forsendelsesdestination"
|
msgstr "Forsendelsesdestination"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:865
|
#: admin/woocommerce-admin-settings.php:866
|
||||||
msgid "Only ship to the users billing address"
|
msgid "Only ship to the users billing address"
|
||||||
msgstr "Send kun til kundens faktureringsadresse"
|
msgstr "Send kun til kundens faktureringsadresse"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:873
|
#: admin/woocommerce-admin-settings.php:874
|
||||||
msgid "Ship to billing address by default"
|
msgid "Ship to billing address by default"
|
||||||
msgstr "Send til faktureringsadresse som standard"
|
msgstr "Send til faktureringsadresse som standard"
|
||||||
|
|
||||||
|
#: admin/woocommerce-admin-settings.php:882
|
||||||
|
msgid "Collect shipping address even when not required"
|
||||||
|
msgstr "Indsaml forsendelsesadresse selvom den ikke er påkrævet"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:887
|
#: admin/woocommerce-admin-settings.php:896
|
||||||
msgid "Tax Options"
|
msgid "Tax Options"
|
||||||
msgstr "Momsegenskaber"
|
msgstr "Momsegenskaber"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:890
|
#: admin/woocommerce-admin-settings.php:899
|
||||||
msgid "Tax calculations"
|
msgid "Tax calculations"
|
||||||
msgstr "Momsberegninger"
|
msgstr "Momsberegninger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:891
|
#: admin/woocommerce-admin-settings.php:900
|
||||||
msgid "Enable taxes and tax calculations"
|
msgid "Enable taxes and tax calculations"
|
||||||
msgstr "Aktiver moms og momsberegninger"
|
msgstr "Aktiver moms og momsberegninger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:899
|
#: admin/woocommerce-admin-settings.php:908
|
||||||
msgid "Display taxes on cart page"
|
msgid "Display taxes on cart page"
|
||||||
msgstr "Vis moms på kurvsiden"
|
msgstr "Vis moms på kurvsiden"
|
||||||
|
|
||||||
#: admin/woocommerce-admin-settings.php:907
|
#: admin/woocommerce-admin-settings.php:916
|
||||||
msgid "Display taxes even when the amount is zero"
|
msgid "Display taxes even when the amount is zero"
|
||||||
msgstr "Vis moms selvom beløbet er nul"
|
msgstr "Vis moms selvom beløbet er nul"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:915
|
#: admin/woocommerce-admin-settings.php:924
|
||||||
msgid "Round tax at subtotal level, instead of per line"
|
msgid "Round tax at subtotal level, instead of per line"
|
||||||
msgstr "Afrund moms ved subtotal niveau i stedet for pr. linje"
|
msgstr "Afrund moms ved subtotal niveau i stedet for pr. linje"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:923
|
#: admin/woocommerce-admin-settings.php:932
|
||||||
msgid "Catalog Prices"
|
msgid "Catalog Prices"
|
||||||
msgstr "Katalog priser"
|
msgstr "Katalog priser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:924
|
#: admin/woocommerce-admin-settings.php:933
|
||||||
msgid "Catalog prices defined including tax"
|
msgid "Catalog prices defined including tax"
|
||||||
msgstr "Katalogpriser defineret incl. moms"
|
msgstr "Katalogpriser defineret incl. moms"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:933
|
#: admin/woocommerce-admin-settings.php:942
|
||||||
msgid "Display cart contents excluding tax"
|
msgid "Display cart contents excluding tax"
|
||||||
msgstr "Vis kurvindhold ekskl. moms"
|
msgstr "Vis kurvindhold ekskl. moms"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:942
|
#: admin/woocommerce-admin-settings.php:951
|
||||||
msgid "Display cart totals excluding tax"
|
msgid "Display cart totals excluding tax"
|
||||||
msgstr "Vis kurvtotaler ekskl. moms"
|
msgstr "Vis kurvtotaler ekskl. moms"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:951
|
#: admin/woocommerce-admin-settings.php:960
|
||||||
msgid "Additional Tax classes"
|
msgid "Additional Tax classes"
|
||||||
msgstr "Yderligere momsklasser"
|
msgstr "Yderligere momsklasser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:952
|
#: admin/woocommerce-admin-settings.php:961
|
||||||
msgid "List 1 per line. This is in addition to the default <em>Standard Rate</em>."
|
msgid "List 1 per line. This is in addition to the default <em>Standard Rate</em>."
|
||||||
msgstr "List 1 pr. linje. Dette er i tillæg med standardindstillingen <em>Standardsats</em>."
|
msgstr "List 1 pr. linje. Dette er i tillæg med standardindstillingen <em>Standardsats</em>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:953
|
#: admin/woocommerce-admin-settings.php:962
|
||||||
msgid "List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate."
|
msgid "List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate."
|
||||||
msgstr "List produkt og forsendelsesmoms klasser her, fx ingen moms, reduceret sats."
|
msgstr "List produkt og forsendelsesmoms klasser her, fx ingen moms, reduceret sats."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:957
|
#: admin/woocommerce-admin-settings.php:966
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Reduced Rate%sZero Rate"
|
msgid "Reduced Rate%sZero Rate"
|
||||||
msgstr "Reduceret sats%snulsats"
|
msgstr "Reduceret sats%snulsats"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:961
|
#: admin/woocommerce-admin-settings.php:970
|
||||||
msgid "Tax rates"
|
msgid "Tax rates"
|
||||||
msgstr "Momssatser"
|
msgstr "Momssatser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:962
|
#: admin/woocommerce-admin-settings.php:971
|
||||||
msgid "All fields are required."
|
msgid "All fields are required."
|
||||||
msgstr "Alle felter er påkrævet."
|
msgstr "Alle felter er påkrævet."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:963
|
#: admin/woocommerce-admin-settings.php:972
|
||||||
msgid "To avoid rounding errors, insert tax rates with 4 decimal places."
|
msgid "To avoid rounding errors, insert tax rates with 4 decimal places."
|
||||||
msgstr "For at undgå afrundingsfejl, indsæt momssatser med 4 decimaler."
|
msgstr "For at undgå afrundingsfejl, indsæt momssatser med 4 decimaler."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:976
|
#: admin/woocommerce-admin-settings.php:985
|
||||||
msgid "Email Recipient Options"
|
msgid "Email Recipient Options"
|
||||||
msgstr "E-mail modtagerindstillinger"
|
msgstr "E-mail modtagerindstillinger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:979
|
#: admin/woocommerce-admin-settings.php:988
|
||||||
msgid "New order notifications"
|
msgid "New order notifications"
|
||||||
msgstr "Ny ordre notifikationer"
|
msgstr "Ny ordre notifikationer"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:980
|
#: admin/woocommerce-admin-settings.php:989
|
||||||
msgid "The recipient of new order emails. Defaults to the admin email."
|
msgid "The recipient of new order emails. Defaults to the admin email."
|
||||||
msgstr "Modtageren af ny ordre e-mails. Standard til admin e-mail."
|
msgstr "Modtageren af ny ordre e-mails. Standard til admin e-mail."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:988
|
#: admin/woocommerce-admin-settings.php:997
|
||||||
msgid "Inventory notifications"
|
msgid "Inventory notifications"
|
||||||
msgstr "Beholdningsmeddelelser"
|
msgstr "Beholdningsmeddelelser"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:989
|
#: admin/woocommerce-admin-settings.php:998
|
||||||
msgid "The recipient of stock emails. Defaults to the admin email."
|
msgid "The recipient of stock emails. Defaults to the admin email."
|
||||||
msgstr "Modtageren af lager e-mails. Standard til admin e-mailen."
|
msgstr "Modtageren af lager e-mails. Standard til admin e-mailen."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:998
|
#: admin/woocommerce-admin-settings.php:1007
|
||||||
msgid "Email Sender Options"
|
msgid "Email Sender Options"
|
||||||
msgstr "E-mail sendeindstillinger"
|
msgstr "E-mail sendeindstillinger"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:998
|
#: admin/woocommerce-admin-settings.php:1007
|
||||||
msgid "The following options affect the sender (email address and name) used in WooCommerce emails."
|
msgid "The following options affect the sender (email address and name) used in WooCommerce emails."
|
||||||
msgstr "Følgende indstillinger påvirker afsenderen (e-mailadresse og navn) brugt i WooCommerce e-mails."
|
msgstr "Følgende indstillinger påvirker afsenderen (e-mailadresse og navn) brugt i WooCommerce e-mails."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1001
|
#: admin/woocommerce-admin-settings.php:1010
|
||||||
msgid "\"From\" name"
|
msgid "\"From\" name"
|
||||||
msgstr "Afsendernavn"
|
msgstr "Afsendernavn"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1010
|
#: admin/woocommerce-admin-settings.php:1019
|
||||||
msgid "\"From\" email address"
|
msgid "\"From\" email address"
|
||||||
msgstr "Afsender e-mailadresse"
|
msgstr "Afsender e-mailadresse"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1020
|
#: admin/woocommerce-admin-settings.php:1029
|
||||||
msgid "Email template"
|
msgid "Email template"
|
||||||
msgstr "E-mail template"
|
msgstr "E-mail template"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1020
|
#: admin/woocommerce-admin-settings.php:1029
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "This section lets you customise the WooCommerce emails. <a href=\"%s\" target=\"_blank\">Click here to preview your email template</a>. For more advanced control copy <code>woocommerce/templates/emails/</code> to <code>yourtheme/woocommerce/emails/</code>."
|
msgid "This section lets you customise the WooCommerce emails. <a href=\"%s\" target=\"_blank\">Click here to preview your email template</a>. For more advanced control copy <code>woocommerce/templates/emails/</code> to <code>yourtheme/woocommerce/emails/</code>."
|
||||||
msgstr "Denne sektion lader dig konfigurerer WooCommerce e-mails. <a href=\"%s\" target=\"_blank\">Klik her for at se din e-mailtemplate</a>. For mere advanceret kontrol kopier <code>woocommerce/templates/emails/</code> til <code>dittema/woocommerce/emails/</code>."
|
msgstr "Denne sektion lader dig konfigurerer WooCommerce e-mails. <a href=\"%s\" target=\"_blank\">Klik her for at se din e-mailtemplate</a>. For mere advanceret kontrol kopier <code>woocommerce/templates/emails/</code> til <code>dittema/woocommerce/emails/</code>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1023
|
#: admin/woocommerce-admin-settings.php:1032
|
||||||
msgid "Header image"
|
msgid "Header image"
|
||||||
msgstr "Header billede"
|
msgstr "Header billede"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1024
|
#: admin/woocommerce-admin-settings.php:1033
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Enter a URL to an image you want to show in the email's header. Upload your image using the <a href=\"%s\">media uploader</a>."
|
msgid "Enter a URL to an image you want to show in the email's header. Upload your image using the <a href=\"%s\">media uploader</a>."
|
||||||
msgstr "Angiv en URL til billedet du vil vise i e-mail header'en. Upload dit billede ved at bruge <a href=\"%s\">Medie uploader</a>."
|
msgstr "Angiv en URL til billedet du vil vise i e-mail header'en. Upload dit billede ved at bruge <a href=\"%s\">Medie uploader</a>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1032
|
#: admin/woocommerce-admin-settings.php:1041
|
||||||
msgid "Email footer text"
|
msgid "Email footer text"
|
||||||
msgstr "E-mail footer tekst"
|
msgstr "E-mail footer tekst"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1033
|
#: admin/woocommerce-admin-settings.php:1042
|
||||||
msgid "The text to appear in the footer of WooCommerce emails."
|
msgid "The text to appear in the footer of WooCommerce emails."
|
||||||
msgstr "Teksten der vises i bunden af WooCommerce e-mails."
|
msgstr "Teksten der vises i bunden af WooCommerce e-mails."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1037
|
#: admin/woocommerce-admin-settings.php:1046
|
||||||
msgid "Powered by WooCommerce"
|
msgid "Powered by WooCommerce"
|
||||||
msgstr "Leveret af WooCommerce"
|
msgstr "Leveret af WooCommerce"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1041
|
#: admin/woocommerce-admin-settings.php:1050
|
||||||
msgid "Base colour"
|
msgid "Base colour"
|
||||||
msgstr "Basis farve"
|
msgstr "Basis farve"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1042
|
#: admin/woocommerce-admin-settings.php:1051
|
||||||
msgid "The base colour for WooCommerce email templates. Default <code>#557da1</code>."
|
msgid "The base colour for WooCommerce email templates. Default <code>#557da1</code>."
|
||||||
msgstr "Basisfarven for WooCommerce e-mail templates. Standard <code>#557da1</code>."
|
msgstr "Basisfarven for WooCommerce e-mail templates. Standard <code>#557da1</code>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1050
|
#: admin/woocommerce-admin-settings.php:1059
|
||||||
msgid "Background colour"
|
msgid "Background colour"
|
||||||
msgstr "Baggrundsfarve"
|
msgstr "Baggrundsfarve"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1051
|
#: admin/woocommerce-admin-settings.php:1060
|
||||||
msgid "The background colour for WooCommerce email templates. Default <code>#eeeeee</code>."
|
msgid "The background colour for WooCommerce email templates. Default <code>#eeeeee</code>."
|
||||||
msgstr "Baggrundsfarven for WooCommerce e-mail templates. Standard <code>#eeeeee</code>."
|
msgstr "Baggrundsfarven for WooCommerce e-mail templates. Standard <code>#eeeeee</code>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1059
|
#: admin/woocommerce-admin-settings.php:1068
|
||||||
msgid "Email body background colour"
|
msgid "Email body background colour"
|
||||||
msgstr "E-mail body baggrundsfarve"
|
msgstr "E-mail body baggrundsfarve"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1060
|
#: admin/woocommerce-admin-settings.php:1069
|
||||||
msgid "The main body background colour. Default <code>#fdfdfd</code>."
|
msgid "The main body background colour. Default <code>#fdfdfd</code>."
|
||||||
msgstr "Body baggrundsfarven. Standard <code>#fdfdfd</code>."
|
msgstr "Body baggrundsfarven. Standard <code>#fdfdfd</code>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1068
|
#: admin/woocommerce-admin-settings.php:1077
|
||||||
msgid "Email body text colour"
|
msgid "Email body text colour"
|
||||||
msgstr "E-mail body tekst farve"
|
msgstr "E-mail body tekst farve"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1069
|
#: admin/woocommerce-admin-settings.php:1078
|
||||||
msgid "The main body text colour. Default <code>#505050</code>."
|
msgid "The main body text colour. Default <code>#505050</code>."
|
||||||
msgstr "Body tekst farven. Standard <code>#505050</code>."
|
msgstr "Body tekst farven. Standard <code>#505050</code>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1082
|
#: admin/woocommerce-admin-settings.php:1091
|
||||||
msgid "ShareThis"
|
msgid "ShareThis"
|
||||||
msgstr "ShareThis"
|
msgstr "ShareThis"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1082
|
#: admin/woocommerce-admin-settings.php:1091
|
||||||
msgid "ShareThis offers a sharing widget which will allow customers to share links to products with their friends."
|
msgid "ShareThis offers a sharing widget which will allow customers to share links to products with their friends."
|
||||||
msgstr "ShareThis tilbyder en delings widget, som tillader kunder at dele produktlinks til deres venner."
|
msgstr "ShareThis tilbyder en delings widget, som tillader kunder at dele produktlinks til deres venner."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1085
|
#: admin/woocommerce-admin-settings.php:1094
|
||||||
msgid "ShareThis Publisher ID"
|
msgid "ShareThis Publisher ID"
|
||||||
msgstr "ShareThis udgiver ID"
|
msgstr "ShareThis udgiver ID"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1086
|
#: admin/woocommerce-admin-settings.php:1095
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Enter your %1$sShareThis publisher ID%2$s to show social sharing buttons on product pages."
|
msgid "Enter your %1$sShareThis publisher ID%2$s to show social sharing buttons on product pages."
|
||||||
msgstr "Angiv dit %1$sShareThis udgiver ID%2$s for at vise delingsknapper på produktsider."
|
msgstr "Angiv dit %1$sShareThis udgiver ID%2$s for at vise delingsknapper på produktsider."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1095
|
#: admin/woocommerce-admin-settings.php:1104
|
||||||
msgid "ShareDaddy"
|
msgid "ShareDaddy"
|
||||||
msgstr "ShareDaddy"
|
msgstr "ShareDaddy"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1095
|
#: admin/woocommerce-admin-settings.php:1104
|
||||||
msgid "ShareDaddy is a sharing plugin bundled with JetPack."
|
msgid "ShareDaddy is a sharing plugin bundled with JetPack."
|
||||||
msgstr "ShareDaddy er et delingsplugin bundtet med JetPack."
|
msgstr "ShareDaddy er et delingsplugin bundtet med JetPack."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1098
|
#: admin/woocommerce-admin-settings.php:1107
|
||||||
msgid "Output ShareDaddy button?"
|
msgid "Output ShareDaddy button?"
|
||||||
msgstr "Vis ShareDaddy knap?"
|
msgstr "Vis ShareDaddy knap?"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1099
|
#: admin/woocommerce-admin-settings.php:1108
|
||||||
msgid "Enable this option to show the ShareDaddy button (if installed) on the product page."
|
msgid "Enable this option to show the ShareDaddy button (if installed) on the product page."
|
||||||
msgstr "Aktiver denne indstilling for at vise ShareDaddy knappen (hvis installeret) på produktsider."
|
msgstr "Aktiver denne indstilling for at vise ShareDaddy knappen (hvis installeret) på produktsider."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1107
|
#: admin/woocommerce-admin-settings.php:1116
|
||||||
msgid "Google Analytics"
|
msgid "Google Analytics"
|
||||||
msgstr "Google Analytics"
|
msgstr "Google Analytics"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1107
|
#: admin/woocommerce-admin-settings.php:1116
|
||||||
msgid "Google Analytics is a free service offered by Google that generates detailed statistics about the visitors to a website."
|
msgid "Google Analytics is a free service offered by Google that generates detailed statistics about the visitors to a website."
|
||||||
msgstr "Google Analytics er en gratis service leveret af Google, som genererer detaljeret statistik omkring besøg på en hjemmeside.."
|
msgstr "Google Analytics er en gratis service leveret af Google, som genererer detaljeret statistik omkring besøg på en hjemmeside.."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1110
|
#: admin/woocommerce-admin-settings.php:1119
|
||||||
msgid "Google Analytics ID"
|
msgid "Google Analytics ID"
|
||||||
msgstr "Google Analytics ID"
|
msgstr "Google Analytics ID"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1111
|
#: admin/woocommerce-admin-settings.php:1120
|
||||||
msgid "Log into your google analytics account to find your ID. e.g. <code>UA-XXXXX-X</code>"
|
msgid "Log into your google analytics account to find your ID. e.g. <code>UA-XXXXX-X</code>"
|
||||||
msgstr "Log ind på din Google Analytics konto for at finde dit ID. Fx <code>UA-XXXXX-X</code>"
|
msgstr "Log ind på din Google Analytics konto for at finde dit ID. Fx <code>UA-XXXXX-X</code>"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1118
|
#: admin/woocommerce-admin-settings.php:1127
|
||||||
#: admin/woocommerce-admin-settings.php:1126
|
#: admin/woocommerce-admin-settings.php:1135
|
||||||
msgid "Tracking code"
|
msgid "Tracking code"
|
||||||
msgstr "Tracking kode"
|
msgstr "Tracking kode"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1119
|
#: admin/woocommerce-admin-settings.php:1128
|
||||||
msgid "Add tracking code to your site's footer. You don't need to enable this if using a 3rd party analytics plugin."
|
msgid "Add tracking code to your site's footer. You don't need to enable this if using a 3rd party analytics plugin."
|
||||||
msgstr "Tilføj tracking kode til din sides footer. Du behøver ikke aktivere dette, hvis du bruger et tredjeparts Analytics plugin."
|
msgstr "Tilføj tracking kode til din sides footer. Du behøver ikke aktivere dette, hvis du bruger et tredjeparts Analytics plugin."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1127
|
#: admin/woocommerce-admin-settings.php:1136
|
||||||
msgid "Add eCommerce tracking code to the thankyou page"
|
msgid "Add eCommerce tracking code to the thankyou page"
|
||||||
msgstr "Tilføj eCommerce tracking kode til takkesiden"
|
msgstr "Tilføj eCommerce tracking kode til takkesiden"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1194
|
#: admin/woocommerce-admin-settings.php:1204
|
||||||
msgid "Your settings have been saved."
|
msgid "Your settings have been saved."
|
||||||
msgstr "Dine indstillinger er blevet gemt."
|
msgstr "Dine indstillinger er blevet gemt."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1228
|
#: admin/woocommerce-admin-settings.php:1238
|
||||||
msgid "<strong>Congratulations!</strong> – WooCommerce has been installed and setup. Enjoy :)"
|
msgid "<strong>Congratulations!</strong> – WooCommerce has been installed and setup. Enjoy :)"
|
||||||
msgstr "<strong>Tillykke!</strong> – WooCommerce er blevet installeret og opsat. God fornøjelse :)"
|
msgstr "<strong>Tillykke!</strong> – WooCommerce er blevet installeret og opsat. God fornøjelse :)"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1253
|
#: admin/woocommerce-admin-settings.php:1263
|
||||||
#: admin/woocommerce-admin-settings.php:1361
|
#: admin/woocommerce-admin-settings.php:1371
|
||||||
#: admin/woocommerce-admin-settings.php:1374
|
#: admin/woocommerce-admin-settings.php:1384
|
||||||
msgid "Payment Gateways"
|
msgid "Payment Gateways"
|
||||||
msgstr "Betalings Gateways"
|
msgstr "Betalings Gateways"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1272
|
#: admin/woocommerce-admin-settings.php:1282
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "More functionality and gateway options available via <a href=\"%s\" target=\"_blank\">WC official extensions</a>."
|
msgid "More functionality and gateway options available via <a href=\"%s\" target=\"_blank\">WC official extensions</a>."
|
||||||
msgstr "Mere funktionalitet og flere gatewayindstillinger tilgængelige via <a href=\"%s\" target=\"_blank\">WC officielle udvidelser</a>."
|
msgstr "Mere funktionalitet og flere gatewayindstillinger tilgængelige via <a href=\"%s\" target=\"_blank\">WC officielle udvidelser</a>."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1306
|
#: admin/woocommerce-admin-settings.php:1316
|
||||||
msgid "Shipping Methods"
|
msgid "Shipping Methods"
|
||||||
msgstr "Forsendelsesmetoder"
|
msgstr "Forsendelsesmetoder"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1307
|
#: admin/woocommerce-admin-settings.php:1317
|
||||||
msgid "Your activated shipping methods are listed below. Drag and drop rows to re-order them for display on the frontend."
|
msgid "Your activated shipping methods are listed below. Drag and drop rows to re-order them for display on the frontend."
|
||||||
msgstr "Dine aktiverede fragtmetoder er listet nedenfor. Træk og slip rækker for at organisere dem til visning på brugerfladen."
|
msgstr "Dine aktiverede fragtmetoder er listet nedenfor. Træk og slip rækker for at organisere dem til visning på brugerfladen."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1311
|
#: admin/woocommerce-admin-settings.php:1321
|
||||||
#: admin/woocommerce-admin-settings.php:1379
|
#: admin/woocommerce-admin-settings.php:1389
|
||||||
msgid "Default"
|
msgid "Default"
|
||||||
msgstr "Standard"
|
msgstr "Standard"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1312
|
#: admin/woocommerce-admin-settings.php:1322
|
||||||
msgid "Shipping Method"
|
msgid "Shipping Method"
|
||||||
msgstr "Forsendelsesmetode"
|
msgstr "Forsendelsesmetode"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1313
|
#: admin/woocommerce-admin-settings.php:1323
|
||||||
#: admin/woocommerce-admin-settings.php:1381
|
#: admin/woocommerce-admin-settings.php:1391
|
||||||
#: admin/post-types/shop_order.php:34
|
#: admin/post-types/shop_order.php:34
|
||||||
msgid "Status"
|
msgid "Status"
|
||||||
msgstr "Status"
|
msgstr "Status"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1328
|
#: admin/woocommerce-admin-settings.php:1338
|
||||||
msgid "Method ID"
|
msgid "Method ID"
|
||||||
msgstr "Metode ID"
|
msgstr "Metode ID"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1375
|
#: admin/woocommerce-admin-settings.php:1385
|
||||||
msgid "Your activated payment gateways are listed below. Drag and drop rows to re-order them for display on the checkout."
|
msgid "Your activated payment gateways are listed below. Drag and drop rows to re-order them for display on the checkout."
|
||||||
msgstr "Dine aktiverede betalings gateways er listet nedenfor. Træk og slip rækker for at organisere dem til visning ved kassen."
|
msgstr "Dine aktiverede betalings gateways er listet nedenfor. Træk og slip rækker for at organisere dem til visning ved kassen."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1380
|
#: admin/woocommerce-admin-settings.php:1390
|
||||||
msgid "Gateway"
|
msgid "Gateway"
|
||||||
msgstr "Gateway"
|
msgstr "Gateway"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1397
|
#: admin/woocommerce-admin-settings.php:1407
|
||||||
msgid "Gateway ID"
|
msgid "Gateway ID"
|
||||||
msgstr "Gateway ID"
|
msgstr "Gateway ID"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1433
|
#: admin/woocommerce-admin-settings.php:1443
|
||||||
msgid "Save changes"
|
msgid "Save changes"
|
||||||
msgstr "Gem ændringer"
|
msgstr "Gem ændringer"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: admin/woocommerce-admin-settings.php:1488
|
#: admin/woocommerce-admin-settings.php:1498
|
||||||
msgid "The changes you made will be lost if you navigate away from this page."
|
msgid "The changes you made will be lost if you navigate away from this page."
|
||||||
msgstr "Ændringerne du har foretaget dig vil gå tabt hvis du navigerer væk fra denne side."
|
msgstr "Ændringerne du har foretaget dig vil gå tabt hvis du navigerer væk fra denne side."
|
||||||
|
|
||||||
|
@ -5663,10 +5671,10 @@ msgstr "<a href=\"%s\" class=\"button\">%s</a> Du kan ikke tilføje den mængde
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-cart.php:1468
|
#: classes/class-wc-cart.php:1468
|
||||||
#: classes/class-wc-order.php:462
|
#: classes/class-wc-order.php:462
|
||||||
#: classes/class-wc-product.php:598
|
#: classes/class-wc-product.php:625
|
||||||
#: classes/class-wc-product.php:607
|
#: classes/class-wc-product.php:634
|
||||||
#: classes/class-wc-product.php:638
|
#: classes/class-wc-product.php:665
|
||||||
#: classes/class-wc-product.php:644
|
#: classes/class-wc-product.php:671
|
||||||
msgid "Free!"
|
msgid "Free!"
|
||||||
msgstr "Gratis!"
|
msgstr "Gratis!"
|
||||||
|
|
||||||
|
@ -5752,42 +5760,42 @@ msgid "is not a valid email address."
|
||||||
msgstr "er ikke en gyldig e-mail adresse."
|
msgstr "er ikke en gyldig e-mail adresse."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:219
|
#: classes/class-wc-checkout.php:218
|
||||||
msgid "Please enter an account username."
|
msgid "Please enter an account username."
|
||||||
msgstr "Indtast venligst et konto brugernavn."
|
msgstr "Indtast venligst et konto brugernavn."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:220
|
#: classes/class-wc-checkout.php:219
|
||||||
msgid "Please enter an account password."
|
msgid "Please enter an account password."
|
||||||
msgstr "Indtast venligst en konto adgangskode."
|
msgstr "Indtast venligst en konto adgangskode."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:225
|
#: classes/class-wc-checkout.php:224
|
||||||
msgid "Invalid email/username."
|
msgid "Invalid email/username."
|
||||||
msgstr "Ugyldig e-mail/brugernavn."
|
msgstr "Ugyldig e-mail/brugernavn."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:227
|
#: classes/class-wc-checkout.php:226
|
||||||
msgid "An account is already registered with that username. Please choose another."
|
msgid "An account is already registered with that username. Please choose another."
|
||||||
msgstr "En konto er allerede registreret med dette brugernavn. Vælg venligst et andet."
|
msgstr "En konto er allerede registreret med dette brugernavn. Vælg venligst et andet."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:232
|
#: classes/class-wc-checkout.php:231
|
||||||
msgid "An account is already registered with your email address. Please login."
|
msgid "An account is already registered with your email address. Please login."
|
||||||
msgstr "En konto er allerede registreret med din e-mail adresse. Log venligst ind."
|
msgstr "En konto er allerede registreret med din e-mail adresse. Log venligst ind."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:238
|
#: classes/class-wc-checkout.php:237
|
||||||
msgid "You must accept our Terms & Conditions."
|
msgid "You must accept our Terms & Conditions."
|
||||||
msgstr "Du skal acceptere vores betingelser & vilkår."
|
msgstr "Du skal acceptere vores betingelser & vilkår."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:246
|
#: classes/class-wc-checkout.php:245
|
||||||
msgid "Invalid shipping method."
|
msgid "Invalid shipping method."
|
||||||
msgstr "Ugyldig forsendelsesmetode."
|
msgstr "Ugyldig forsendelsesmetode."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-checkout.php:255
|
#: classes/class-wc-checkout.php:254
|
||||||
msgid "Invalid payment method."
|
msgid "Invalid payment method."
|
||||||
msgstr "Ugyldig betalingsmetode."
|
msgstr "Ugyldig betalingsmetode."
|
||||||
|
|
||||||
|
@ -7885,30 +7893,30 @@ msgid "Order item stock reduced successfully."
|
||||||
msgstr "Ordreprodukters lagerstatus reduceret korrekt."
|
msgstr "Ordreprodukters lagerstatus reduceret korrekt."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-product.php:414
|
#: classes/class-wc-product.php:441
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "%s in stock"
|
msgid "%s in stock"
|
||||||
msgstr "%s på lager"
|
msgstr "%s på lager"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-product.php:417
|
#: classes/class-wc-product.php:444
|
||||||
msgid "(backorders allowed)"
|
msgid "(backorders allowed)"
|
||||||
msgstr "(restordrer tilladt)"
|
msgstr "(restordrer tilladt)"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-product.php:424
|
#: classes/class-wc-product.php:451
|
||||||
#: classes/class-wc-product.php:437
|
#: classes/class-wc-product.php:464
|
||||||
msgid "Available on backorder"
|
msgid "Available on backorder"
|
||||||
msgstr "Findes på restordre"
|
msgstr "Findes på restordre"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-product.php:658
|
#: classes/class-wc-product.php:685
|
||||||
msgctxt "min_price"
|
msgctxt "min_price"
|
||||||
msgid "From:"
|
msgid "From:"
|
||||||
msgstr "Fra:"
|
msgstr "Fra:"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: classes/class-wc-product.php:702
|
#: classes/class-wc-product.php:729
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Rated %s out of 5"
|
msgid "Rated %s out of 5"
|
||||||
msgstr "Vurderet %s ud af 5"
|
msgstr "Vurderet %s ud af 5"
|
||||||
|
@ -8847,27 +8855,27 @@ msgid "Quantity"
|
||||||
msgstr "Antal"
|
msgstr "Antal"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: templates/cart/cart.php:35
|
#: templates/cart/cart.php:37
|
||||||
msgid "Remove this item"
|
msgid "Remove this item"
|
||||||
msgstr "Fjern dette produkt"
|
msgstr "Fjern dette produkt"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: templates/cart/cart.php:50
|
#: templates/cart/cart.php:58
|
||||||
msgid "Available on backorder."
|
msgid "Available on backorder."
|
||||||
msgstr "Findes på restordre."
|
msgstr "Findes på restordre."
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: templates/cart/cart.php:93
|
#: templates/cart/cart.php:105
|
||||||
msgid "Apply Coupon"
|
msgid "Apply Coupon"
|
||||||
msgstr "Anvend kupon"
|
msgstr "Anvend kupon"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: templates/cart/cart.php:98
|
#: templates/cart/cart.php:110
|
||||||
msgid "Update Cart"
|
msgid "Update Cart"
|
||||||
msgstr "Opdater indkøbskurv"
|
msgstr "Opdater indkøbskurv"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: templates/cart/cart.php:98
|
#: templates/cart/cart.php:110
|
||||||
msgid "Proceed to Checkout →"
|
msgid "Proceed to Checkout →"
|
||||||
msgstr "Gå til kassen →"
|
msgstr "Gå til kassen →"
|
||||||
|
|
||||||
|
@ -9049,8 +9057,8 @@ msgstr "Betal for ordre"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: templates/checkout/form-shipping.php:25
|
#: templates/checkout/form-shipping.php:25
|
||||||
msgid "Ship to same address?"
|
msgid "Ship to billing address?"
|
||||||
msgstr "Send til samme adresse?"
|
msgstr "Send til faktureringsadresse?"
|
||||||
|
|
||||||
# @ woocommerce
|
# @ woocommerce
|
||||||
#: templates/checkout/form-shipping.php:52
|
#: templates/checkout/form-shipping.php:52
|
||||||
|
|
28
readme.txt
|
@ -28,8 +28,8 @@ Keep a birds-eye view of incoming sales and reviews, stock levels and general st
|
||||||
= FEATURES =
|
= FEATURES =
|
||||||
Seriously, WooCommerce has got more features than you can shake a stick at. But don’t just take our word for it, try it for yourself.
|
Seriously, WooCommerce has got more features than you can shake a stick at. But don’t just take our word for it, try it for yourself.
|
||||||
|
|
||||||
= BUNDLED GATEWAYS AND SHIPPING =
|
= BUNDLED GATEWAYS, SHIPPING AND INTEGRATIONS =
|
||||||
WooCommerce has enough power to be used straight out of the box and comes with the following payment gateways and shipping methods:
|
WooCommerce has enough power to be used straight out of the box and comes with the following payment gateways, shipping methods and third party integrations:
|
||||||
|
|
||||||
* PayPal Standard
|
* PayPal Standard
|
||||||
* BACS
|
* BACS
|
||||||
|
@ -40,6 +40,10 @@ WooCommerce has enough power to be used straight out of the box and comes with t
|
||||||
* International delivery
|
* International delivery
|
||||||
* Local delivery
|
* Local delivery
|
||||||
* Local Pickup
|
* Local Pickup
|
||||||
|
* Google Analytics
|
||||||
|
* Sharedaddy
|
||||||
|
* ShareThis
|
||||||
|
* ShareYourCart
|
||||||
|
|
||||||
= EXTENSIONS =
|
= EXTENSIONS =
|
||||||
Need a specific payment gateway? Perhaps additional shipping methods? WooCommerce has a plethora of eCommerce extensions available to provide just that: [View our extensions](http://www.woothemes.com/extensions/woocommerce-extensions/ "eCommerce extensions for WooCommerce from WooThemes").
|
Need a specific payment gateway? Perhaps additional shipping methods? WooCommerce has a plethora of eCommerce extensions available to provide just that: [View our extensions](http://www.woothemes.com/extensions/woocommerce-extensions/ "eCommerce extensions for WooCommerce from WooThemes").
|
||||||
|
@ -144,18 +148,38 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
= 1.5.5 =
|
= 1.5.5 =
|
||||||
|
* Feature - Settings now include colours for things like buttons and tabs.
|
||||||
|
* Feature - New integration section which allows other class-based integrations to be added.
|
||||||
|
* Feature - ShareYourCart integration built in.
|
||||||
* Feature - is_sold_individually() function for disabling quantity inputs for products
|
* Feature - is_sold_individually() function for disabling quantity inputs for products
|
||||||
|
* Feature - Collect shipping address even when not required option
|
||||||
|
* Feature - Stock display options - show no stock amount, low stock amount, or always show stock amount
|
||||||
|
* Feature - woocommerce_form_field select type
|
||||||
|
* Tweak - Removed nonces from add to cart urls, this makes them easier to make use of; you can hardcode add to cart links or link to your add to cart link from other places without needing to use WC functions.
|
||||||
* Tweak - Cart.php display with more filters
|
* Tweak - Cart.php display with more filters
|
||||||
|
* Tweak - is_product_category and is_product_tag support term argument
|
||||||
* Tweak - Added minus symbol before discount on view order page
|
* Tweak - Added minus symbol before discount on view order page
|
||||||
* Tweak - Added yards as dimensions unit
|
* Tweak - Added yards as dimensions unit
|
||||||
* Tweak - Allow more readable flat rate options to be entered
|
* Tweak - Allow more readable flat rate options to be entered
|
||||||
* Tweak - Changed category and tag link to filter product list in admin panel
|
* Tweak - Changed category and tag link to filter product list in admin panel
|
||||||
* Tweak - Removed product 'exists' variable in favour of the exists() method. Tweaked exist method to look for ID in DB.
|
* Tweak - Removed product 'exists' variable in favour of the exists() method. Tweaked exist method to look for ID in DB.
|
||||||
|
* Tweak - Only use rm=2 for paypal when SSL is enabled, to avoid security warnings when returning to the site.
|
||||||
|
* Tweak - Show sku in stock reports.
|
||||||
|
* Tweak - When sending the order as a whole to paypal, send the shipping separately.
|
||||||
|
* Tweak - Clear cache along with transients
|
||||||
|
* Tweak - Protocol-relative AJAX URL
|
||||||
|
* Tweak - Hidden some uncommon settings
|
||||||
|
* Tweak - Fixed labels for settings API.
|
||||||
|
* Tweak - New WC_Order Class Formatting Filters and Function for totals (thanks thenbrent)
|
||||||
* Fix - Replacing use of deprecated function get_current_theme() with wp_get_theme()
|
* Fix - Replacing use of deprecated function get_current_theme() with wp_get_theme()
|
||||||
* Fix - Body classes now correct for WordPress themes with non alphanumeric characters
|
* Fix - Body classes now correct for WordPress themes with non alphanumeric characters
|
||||||
* Fix - PayPal http_build_query & -> & on some PHP 5.3 servers
|
* Fix - PayPal http_build_query & -> & on some PHP 5.3 servers
|
||||||
* Fix - update_count_callback for tags
|
* Fix - update_count_callback for tags
|
||||||
* Fix - Pass shipping calc state to checkout
|
* Fix - Pass shipping calc state to checkout
|
||||||
|
* Fix - Removed space from postcode validation
|
||||||
|
* Fix - per product flat rate.
|
||||||
|
* Fix - Use term_id instead of term slug to get term link (allows numeric slugs for product categories)
|
||||||
|
* Fix - Replace spaces with + signs in download url after decode (allows + characters in email addresses for downloads)
|
||||||
* Localization - Slovak translation by Dušan Beleščák
|
* Localization - Slovak translation by Dušan Beleščák
|
||||||
* Localization - Updated localisations
|
* Localization - Updated localisations
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ function woocommerce_pay() {
|
||||||
</li>
|
</li>
|
||||||
<li class="total">
|
<li class="total">
|
||||||
<?php _e('Total:', 'woocommerce'); ?>
|
<?php _e('Total:', 'woocommerce'); ?>
|
||||||
<strong><?php echo woocommerce_price($order->order_total); ?></strong>
|
<strong><?php echo $order->get_formatted_order_total(); ?></strong>
|
||||||
</li>
|
</li>
|
||||||
<?php if ($order->payment_method_title) : ?>
|
<?php if ($order->payment_method_title) : ?>
|
||||||
<li class="method">
|
<li class="method">
|
||||||
|
|
|
@ -72,14 +72,16 @@ global $woocommerce;
|
||||||
<td class="product-quantity">
|
<td class="product-quantity">
|
||||||
<?php
|
<?php
|
||||||
if ( $_product->is_sold_individually() ) {
|
if ( $_product->is_sold_individually() ) {
|
||||||
echo '1';
|
$product_quantity = '1';
|
||||||
} else {
|
} else {
|
||||||
$data_min = apply_filters( 'woocommerce_cart_item_data_min', '', $_product );
|
$data_min = apply_filters( 'woocommerce_cart_item_data_min', '', $_product );
|
||||||
$data_max = ( $_product->backorders_allowed() ) ? '' : $_product->get_stock_quantity();
|
$data_max = ( $_product->backorders_allowed() ) ? '' : $_product->get_stock_quantity();
|
||||||
$data_max = apply_filters( 'woocommerce_cart_item_data_max', $data_max, $_product );
|
$data_max = apply_filters( 'woocommerce_cart_item_data_max', $data_max, $_product );
|
||||||
|
|
||||||
printf( '<div class="quantity"><input name="cart[%s][qty]" data-min="%s" data-max="%s" value="%s" size="4" title="Qty" class="input-text qty text" maxlength="12" /></div>', $cart_item_key, $data_min, $data_max, esc_attr( $values['quantity'] ) );
|
$product_quantity = sprintf( '<div class="quantity"><input name="cart[%s][qty]" data-min="%s" data-max="%s" value="%s" size="4" title="Qty" class="input-text qty text" maxlength="12" /></div>', $cart_item_key, $data_min, $data_max, esc_attr( $values['quantity'] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key );
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@ -102,7 +104,11 @@ global $woocommerce;
|
||||||
|
|
||||||
<?php if ( get_option( 'woocommerce_enable_coupons' ) == 'yes' ) { ?>
|
<?php if ( get_option( 'woocommerce_enable_coupons' ) == 'yes' ) { ?>
|
||||||
<div class="coupon">
|
<div class="coupon">
|
||||||
|
|
||||||
<label for="coupon_code"><?php _e('Coupon', 'woocommerce'); ?>:</label> <input name="coupon_code" class="input-text" id="coupon_code" value="" /> <input type="submit" class="button" name="apply_coupon" value="<?php _e('Apply Coupon', 'woocommerce'); ?>" />
|
<label for="coupon_code"><?php _e('Coupon', 'woocommerce'); ?>:</label> <input name="coupon_code" class="input-text" id="coupon_code" value="" /> <input type="submit" class="button" name="apply_coupon" value="<?php _e('Apply Coupon', 'woocommerce'); ?>" />
|
||||||
|
|
||||||
|
<?php do_action('woocommerce_cart_coupon'); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ if ( get_option( 'woocommerce_enable_coupons' ) == 'no' || get_option( 'woocomme
|
||||||
$info_message = apply_filters('woocommerce_checkout_coupon_message', __('Have a coupon?', 'woocommerce'));
|
$info_message = apply_filters('woocommerce_checkout_coupon_message', __('Have a coupon?', 'woocommerce'));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p class="info"><?php echo $info_message; ?> <a href="#" class="showcoupon"><?php _e('Click here to enter your code', 'woocommerce'); ?></a></p>
|
<p class="woocommerce_info"><?php echo $info_message; ?> <a href="#" class="showcoupon"><?php _e('Click here to enter your code', 'woocommerce'); ?></a></p>
|
||||||
|
|
||||||
<form class="checkout_coupon" method="post">
|
<form class="checkout_coupon" method="post">
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,6 @@ if (get_option('woocommerce_enable_signup_and_login_from_checkout')=="no") retur
|
||||||
$info_message = apply_filters('woocommerce_checkout_login_message', __('Already registered?', 'woocommerce'));
|
$info_message = apply_filters('woocommerce_checkout_login_message', __('Already registered?', 'woocommerce'));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p class="info"><?php echo $info_message; ?> <a href="#" class="showlogin"><?php _e('Click here to login', 'woocommerce'); ?></a></p>
|
<p class="woocommerce_info"><?php echo $info_message; ?> <a href="#" class="showlogin"><?php _e('Click here to login', 'woocommerce'); ?></a></p>
|
||||||
|
|
||||||
<?php woocommerce_login_form( array( 'message' => __('If you have shopped with us before, please enter your username and password in the boxes below. If you are a new customer please proceed to the Billing & Shipping section.', 'woocommerce'), 'redirect' => get_permalink(woocommerce_get_page_id('checkout')) ) ); ?>
|
<?php woocommerce_login_form( array( 'message' => __('If you have shopped with us before, please enter your username and password in the boxes below. If you are a new customer please proceed to the Billing & Shipping section.', 'woocommerce'), 'redirect' => get_permalink(woocommerce_get_page_id('checkout')) ) ); ?>
|
|
@ -4,11 +4,11 @@
|
||||||
*/
|
*/
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if ( $woocommerce->cart->needs_shipping() && ! $woocommerce->cart->ship_to_billing_address_only() ) : ?>
|
<?php if ( ( $woocommerce->cart->needs_shipping() || get_option('woocommerce_require_shipping_address') == 'yes' ) && ! $woocommerce->cart->ship_to_billing_address_only() ) : ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (!isset($_POST) || !$_POST) :
|
if ( empty( $_POST ) ) :
|
||||||
|
|
||||||
$shiptobilling = (get_option('woocommerce_ship_to_same_address')=='yes') ? 1 : 0;
|
$shiptobilling = (get_option('woocommerce_ship_to_same_address')=='yes') ? 1 : 0;
|
||||||
$shiptobilling = apply_filters('woocommerce_shiptobilling_default', $shiptobilling);
|
$shiptobilling = apply_filters('woocommerce_shiptobilling_default', $shiptobilling);
|
||||||
|
@ -22,7 +22,7 @@ global $woocommerce;
|
||||||
|
|
||||||
<p class="form-row" id="shiptobilling">
|
<p class="form-row" id="shiptobilling">
|
||||||
<input id="shiptobilling-checkbox" class="input-checkbox" <?php checked($shiptobilling, 1); ?> type="checkbox" name="shiptobilling" value="1" />
|
<input id="shiptobilling-checkbox" class="input-checkbox" <?php checked($shiptobilling, 1); ?> type="checkbox" name="shiptobilling" value="1" />
|
||||||
<label for="shiptobilling-checkbox" class="checkbox"><?php _e('Ship to same address?', 'woocommerce'); ?></label>
|
<label for="shiptobilling-checkbox" class="checkbox"><?php _e('Ship to billing address?', 'woocommerce'); ?></label>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3><?php _e('Shipping Address', 'woocommerce'); ?></h3>
|
<h3><?php _e('Shipping Address', 'woocommerce'); ?></h3>
|
||||||
|
|
|
@ -42,7 +42,7 @@ global $woocommerce;
|
||||||
</li>
|
</li>
|
||||||
<li class="total">
|
<li class="total">
|
||||||
<?php _e('Total:', 'woocommerce'); ?>
|
<?php _e('Total:', 'woocommerce'); ?>
|
||||||
<strong><?php echo woocommerce_price($order->order_total); ?></strong>
|
<strong><?php echo $order->get_formatted_order_total(); ?></strong>
|
||||||
</li>
|
</li>
|
||||||
<?php if ($order->payment_method_title) : ?>
|
<?php if ($order->payment_method_title) : ?>
|
||||||
<li class="method">
|
<li class="method">
|
||||||
|
|
|
@ -35,18 +35,7 @@ foreach ($items as $item) :
|
||||||
|
|
||||||
?></td>
|
?></td>
|
||||||
<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $item['qty'] ;?></td>
|
<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $item['qty'] ;?></td>
|
||||||
<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php
|
<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td>
|
||||||
|
|
||||||
// Tax
|
|
||||||
if ( $order->display_cart_ex_tax || !$order->prices_include_tax ) :
|
|
||||||
$ex_tax_label = ( $order->prices_include_tax ) ? 1 : 0;
|
|
||||||
echo woocommerce_price( $order->get_line_subtotal( $item ), array('ex_tax_label' => $ex_tax_label ));
|
|
||||||
else :
|
|
||||||
echo woocommerce_price( $order->get_line_subtotal( $item, true ) );
|
|
||||||
endif;
|
|
||||||
|
|
||||||
?></td>
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php if ($show_purchase_note && $purchase_note = get_post_meta( $_product->id, '_purchase_note', true)) : ?>
|
<?php if ($show_purchase_note && $purchase_note = get_post_meta( $_product->id, '_purchase_note', true)) : ?>
|
||||||
|
|
|
@ -46,7 +46,7 @@ if (!isset($woocommerce_loop['columns']) || !$woocommerce_loop['columns']) $wooc
|
||||||
|
|
||||||
endwhile; endif;
|
endwhile; endif;
|
||||||
|
|
||||||
if ($woocommerce_loop['loop']==0) echo '<li class="info">'.__('No products found which match your selection.', 'woocommerce').'</li>';
|
if ($woocommerce_loop['loop']==0) echo '<li class="woocommerce_info">'.__('No products found which match your selection.', 'woocommerce').'</li>';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ if ($customer_orders) :
|
||||||
<a href="<?php echo esc_url( add_query_arg('order', $order->id, get_permalink(woocommerce_get_page_id('view_order'))) ); ?>"><?php echo $order->get_order_number(); ?></a> – <time title="<?php echo esc_attr( strtotime($order->order_date) ); ?>"><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></time>
|
<a href="<?php echo esc_url( add_query_arg('order', $order->id, get_permalink(woocommerce_get_page_id('view_order'))) ); ?>"><?php echo $order->get_order_number(); ?></a> – <time title="<?php echo esc_attr( strtotime($order->order_date) ); ?>"><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></time>
|
||||||
</td>
|
</td>
|
||||||
<td class="order-shipto"><address><?php if ($order->get_formatted_shipping_address()) echo $order->get_formatted_shipping_address(); else echo '–'; ?></address></td>
|
<td class="order-shipto"><address><?php if ($order->get_formatted_shipping_address()) echo $order->get_formatted_shipping_address(); else echo '–'; ?></address></td>
|
||||||
<td class="order-total" width="1%"><?php echo woocommerce_price($order->order_total); ?></td>
|
<td class="order-total" width="1%"><?php echo $order->get_formatted_order_total(); ?></td>
|
||||||
<td class="order-status" style="text-align:left; white-space:nowrap;">
|
<td class="order-status" style="text-align:left; white-space:nowrap;">
|
||||||
<?php echo ucfirst( __( $status->name, 'woocommerce' ) ); ?>
|
<?php echo ucfirst( __( $status->name, 'woocommerce' ) ); ?>
|
||||||
<?php if (in_array($order->status, array('pending', 'failed'))) : ?>
|
<?php if (in_array($order->status, array('pending', 'failed'))) : ?>
|
||||||
|
|
|
@ -1,25 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Single Product Share
|
* Single Product Share
|
||||||
|
*
|
||||||
|
* Sharing plugins can hook into here or you can add your own code directly.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (get_option('woocommerce_sharethis')) : ?>
|
<?php do_action('woocommerce_share'); // Sharing plugins can hook into here ?>
|
||||||
|
|
||||||
<div class="social">
|
|
||||||
<iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
|
|
||||||
<span class="st_twitter"></span><span class="st_email"></span><span class="st_sharethis"></span><span class="st_plusone_button"></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php $sharethis = (is_ssl()) ? 'https://ws.sharethis.com/button/buttons.js' : 'http://w.sharethis.com/button/buttons.js'; ?>
|
|
||||||
|
|
||||||
<script type="text/javascript">var switchTo5x=true;</script><script type="text/javascript" src="<?php echo $sharethis; ?>"></script>
|
|
||||||
<script type="text/javascript">stLight.options({publisher:"<?php echo get_option('woocommerce_sharethis'); ?>"});</script>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if (get_option('woocommerce_sharedaddy') && function_exists('sharing_display')) : ?>
|
|
||||||
|
|
||||||
<div class="social"><?php echo sharing_display(); ?></div>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
|
@ -9,7 +9,7 @@ $show_attr = ( get_option( 'woocommerce_enable_dimension_product_attributes' ) =
|
||||||
|
|
||||||
if ( $product->has_attributes() || ( $show_attr && $product->has_dimensions() ) || ( $show_attr && $product->has_weight() ) ) {
|
if ( $product->has_attributes() || ( $show_attr && $product->has_dimensions() ) || ( $show_attr && $product->has_weight() ) ) {
|
||||||
?>
|
?>
|
||||||
<div class="panel" id="tab-attributes">
|
<div class="panel entry-content" id="tab-attributes">
|
||||||
|
|
||||||
<?php $heading = apply_filters('woocommerce_product_additional_information_heading', __('Additional Information', 'woocommerce')); ?>
|
<?php $heading = apply_filters('woocommerce_product_additional_information_heading', __('Additional Information', 'woocommerce')); ?>
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
global $woocommerce, $post;
|
global $woocommerce, $post;
|
||||||
|
|
||||||
if ( $post->post_content ) : ?>
|
if ( $post->post_content ) : ?>
|
||||||
<div class="panel" id="tab-description">
|
<div class="panel entry-content" id="tab-description">
|
||||||
|
|
||||||
<?php $heading = apply_filters('woocommerce_product_description_heading', __('Product Description', 'woocommerce')); ?>
|
<?php $heading = apply_filters('woocommerce_product_description_heading', __('Product Description', 'woocommerce')); ?>
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
global $woocommerce, $post;
|
global $woocommerce, $post;
|
||||||
|
|
||||||
if ( comments_open() ) : ?>
|
if ( comments_open() ) : ?>
|
||||||
<div class="panel" id="tab-reviews">
|
<div class="panel entry-content" id="tab-reviews">
|
||||||
|
|
||||||
<?php comments_template(); ?>
|
<?php comments_template(); ?>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ $show_attr = ( get_option( 'woocommerce_enable_dimension_product_attributes' ) =
|
||||||
|
|
||||||
if ( $product->has_attributes() || ( $show_attr && $product->has_dimensions() ) || ( $show_attr && $product->has_weight() ) ) {
|
if ( $product->has_attributes() || ( $show_attr && $product->has_dimensions() ) || ( $show_attr && $product->has_weight() ) ) {
|
||||||
?>
|
?>
|
||||||
<li><a href="#tab-attributes"><?php _e('Additional Information', 'woocommerce'); ?></a></li>
|
<li class="attributes_tab"><a href="#tab-attributes"><?php _e('Additional Information', 'woocommerce'); ?></a></li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -1,5 +1,5 @@
|
||||||
<?php global $post;
|
<?php global $post;
|
||||||
|
|
||||||
if ( $post->post_content ) : ?>
|
if ( $post->post_content ) : ?>
|
||||||
<li><a href="#tab-description"><?php _e('Description', 'woocommerce'); ?></a></li>
|
<li class="description_tab"><a href="#tab-description"><?php _e('Description', 'woocommerce'); ?></a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
|
@ -3,4 +3,4 @@
|
||||||
* Single Product Title
|
* Single Product Title
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<h1 itemprop="name" class="product_title page-title"><?php the_title(); ?></h1>
|
<h1 itemprop="name" class="product_title entry-title"><?php the_title(); ?></h1>
|
|
@ -37,9 +37,11 @@ wp_delete_post( get_option('woocommerce_pay_page_id'), true );
|
||||||
wp_delete_post( get_option('woocommerce_thanks_page_id'), true );
|
wp_delete_post( get_option('woocommerce_thanks_page_id'), true );
|
||||||
|
|
||||||
// Tables
|
// Tables
|
||||||
$wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."woocommerce_attribute_taxonomies");
|
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "woocommerce_attribute_taxonomies" );
|
||||||
$wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."woocommerce_downloadable_product_permissions");
|
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "woocommerce_downloadable_product_permissions" );
|
||||||
$wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."woocommerce_termmeta");
|
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "woocommerce_termmeta" );
|
||||||
|
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->base_prefix . "shareyourcart_tokens" );
|
||||||
|
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->base_prefix . "shareyourcart_coupons" );
|
||||||
|
|
||||||
// Delete options
|
// Delete options
|
||||||
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'woocommerce_%';");
|
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'woocommerce_%';");
|
|
@ -200,13 +200,13 @@ if (!function_exists('is_shop')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!function_exists('is_product_category')) {
|
if (!function_exists('is_product_category')) {
|
||||||
function is_product_category() {
|
function is_product_category( $term = '' ) {
|
||||||
return is_tax( 'product_cat' );
|
return is_tax( 'product_cat', $term );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!function_exists('is_product_tag')) {
|
if (!function_exists('is_product_tag')) {
|
||||||
function is_product_tag() {
|
function is_product_tag( $term = '' ) {
|
||||||
return is_tax( 'product_tag' );
|
return is_tax( 'product_tag', $term );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!function_exists('is_product')) {
|
if (!function_exists('is_product')) {
|
||||||
|
@ -528,9 +528,37 @@ if (!function_exists('woocommerce_hex_lighter')) {
|
||||||
return $color;
|
return $color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect if we should use a light or dark colour on a background colour
|
||||||
|
**/
|
||||||
if (!function_exists('woocommerce_light_or_dark')) {
|
if (!function_exists('woocommerce_light_or_dark')) {
|
||||||
function woocommerce_light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) {
|
function woocommerce_light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) {
|
||||||
return (hexdec($color) > 0xffffff/2) ? $dark : $light;
|
//return ( hexdec( $color ) > 0xffffff / 2 ) ? $dark : $light;
|
||||||
|
$hex = str_replace( '#', '', $color );
|
||||||
|
|
||||||
|
$c_r = hexdec( substr( $hex, 0, 2 ) );
|
||||||
|
$c_g = hexdec( substr( $hex, 2, 2 ) );
|
||||||
|
$c_b = hexdec( substr( $hex, 4, 2 ) );
|
||||||
|
$brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000;
|
||||||
|
|
||||||
|
return $brightness > 155 ? $dark : $light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format string as hex
|
||||||
|
**/
|
||||||
|
if (!function_exists('woocommerce_format_hex')) {
|
||||||
|
function woocommerce_format_hex( $hex ) {
|
||||||
|
|
||||||
|
$hex = trim( str_replace( '#', '', $hex ) );
|
||||||
|
|
||||||
|
if ( strlen( $hex ) == 3 ) {
|
||||||
|
$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $hex ) return '#' . $hex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -877,9 +905,10 @@ function woocommerce_order_terms( $the_term, $next_id, $taxonomy, $index=0, $ter
|
||||||
// no nextid meaning our term is in last position
|
// no nextid meaning our term is in last position
|
||||||
if( $term_in_level && null === $next_id )
|
if( $term_in_level && null === $next_id )
|
||||||
$index = woocommerce_set_term_order($id, $index+1, $taxonomy, true);
|
$index = woocommerce_set_term_order($id, $index+1, $taxonomy, true);
|
||||||
|
|
||||||
|
wp_cache_flush();
|
||||||
|
|
||||||
return $index;
|
return $index;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -168,7 +168,7 @@ function woocommerce_list_pages($pages){
|
||||||
**/
|
**/
|
||||||
function woocommerce_nav_menu_items( $items, $args ) {
|
function woocommerce_nav_menu_items( $items, $args ) {
|
||||||
if ( get_option('woocommerce_menu_logout_link')=='yes' && strstr($items, get_permalink(woocommerce_get_page_id('myaccount'))) && is_user_logged_in() ) :
|
if ( get_option('woocommerce_menu_logout_link')=='yes' && strstr($items, get_permalink(woocommerce_get_page_id('myaccount'))) && is_user_logged_in() ) :
|
||||||
$items .= '<li><a href="'. wp_logout_url(home_url()) .'">'.__('Logout', 'woocommerce').'</a></li>';
|
$items .= '<li class="logout"><a href="'. wp_logout_url(home_url()) .'">'.__('Logout', 'woocommerce').'</a></li>';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
|
@ -261,7 +261,7 @@ function woocommerce_update_cart_action() {
|
||||||
function woocommerce_add_to_cart_action( $url = false ) {
|
function woocommerce_add_to_cart_action( $url = false ) {
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
|
|
||||||
if (empty($_REQUEST['add-to-cart']) || !$woocommerce->verify_nonce('add_to_cart', '_REQUEST')) return;
|
if ( empty( $_REQUEST['add-to-cart'] ) ) return;
|
||||||
|
|
||||||
$added_to_cart = false;
|
$added_to_cart = false;
|
||||||
|
|
||||||
|
@ -797,7 +797,7 @@ function woocommerce_download_product() {
|
||||||
|
|
||||||
$download_file = (int) urldecode($_GET['download_file']);
|
$download_file = (int) urldecode($_GET['download_file']);
|
||||||
$order_key = urldecode( $_GET['order'] );
|
$order_key = urldecode( $_GET['order'] );
|
||||||
$email = urldecode( $_GET['email'] );
|
$email = str_replace( ' ', '+', urldecode( $_GET['email'] ) );
|
||||||
|
|
||||||
if (!is_email($email)) :
|
if (!is_email($email)) :
|
||||||
wp_die( __('Invalid email address.', 'woocommerce') . ' <a href="'.home_url().'">' . __('Go to homepage →', 'woocommerce') . '</a>' );
|
wp_die( __('Invalid email address.', 'woocommerce') . ' <a href="'.home_url().'">' . __('Go to homepage →', 'woocommerce') . '</a>' );
|
||||||
|
@ -1033,136 +1033,6 @@ function woocommerce_download_product() {
|
||||||
endif;
|
endif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Google Analytics standard tracking
|
|
||||||
**/
|
|
||||||
function woocommerce_google_tracking() {
|
|
||||||
global $woocommerce;
|
|
||||||
|
|
||||||
if ( is_admin() || current_user_can('manage_options') || get_option('woocommerce_ga_standard_tracking_enabled') == "no" ) return;
|
|
||||||
|
|
||||||
$tracking_id = get_option('woocommerce_ga_id');
|
|
||||||
|
|
||||||
if ( ! $tracking_id ) return;
|
|
||||||
|
|
||||||
$loggedin = ( is_user_logged_in() ) ? 'yes' : 'no';
|
|
||||||
if ( is_user_logged_in() ) {
|
|
||||||
$user_id = get_current_user_id();
|
|
||||||
$current_user = get_user_by('id', $user_id);
|
|
||||||
$username = $current_user->user_login;
|
|
||||||
} else {
|
|
||||||
$user_id = '';
|
|
||||||
$username = __('Guest', 'woocommerce');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
var _gaq = _gaq || [];
|
|
||||||
_gaq.push(
|
|
||||||
['_setAccount', '<?php echo $tracking_id; ?>'],
|
|
||||||
['_setCustomVar', 1, 'logged-in', '<?php echo $loggedin; ?>', 1],
|
|
||||||
['_setCustomVar', 2, 'user-id', '<?php echo $user_id; ?>', 1],
|
|
||||||
['_setCustomVar', 3, 'username', '<?php echo $username; ?>', 1],
|
|
||||||
['_trackPageview']
|
|
||||||
);
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Google Analytics eCommerce tracking
|
|
||||||
**/
|
|
||||||
function woocommerce_ecommerce_tracking( $order_id ) {
|
|
||||||
global $woocommerce;
|
|
||||||
|
|
||||||
if ( is_admin() || current_user_can('manage_options') || get_option('woocommerce_ga_ecommerce_tracking_enabled') == "no" ) return;
|
|
||||||
|
|
||||||
$tracking_id = get_option('woocommerce_ga_id');
|
|
||||||
|
|
||||||
if ( ! $tracking_id ) return;
|
|
||||||
|
|
||||||
// Doing eCommerce tracking so unhook standard tracking from the footer
|
|
||||||
remove_action('wp_footer', 'woocommerce_google_tracking');
|
|
||||||
|
|
||||||
// Get the order and output tracking code
|
|
||||||
$order = new WC_Order($order_id);
|
|
||||||
|
|
||||||
$loggedin = (is_user_logged_in()) ? 'yes' : 'no';
|
|
||||||
if (is_user_logged_in()) {
|
|
||||||
$user_id = get_current_user_id();
|
|
||||||
$current_user = get_user_by('id', $user_id);
|
|
||||||
$username = $current_user->user_login;
|
|
||||||
} else {
|
|
||||||
$user_id = '';
|
|
||||||
$username = __('Guest', 'woocommerce');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var _gaq = _gaq || [];
|
|
||||||
|
|
||||||
_gaq.push(
|
|
||||||
['_setAccount', '<?php echo $tracking_id; ?>'],
|
|
||||||
['_setCustomVar', 1, 'logged-in', '<?php echo $loggedin; ?>', 1],
|
|
||||||
['_setCustomVar', 2, 'user-id', '<?php echo $user_id; ?>', 1],
|
|
||||||
['_setCustomVar', 3, 'username', '<?php echo $username; ?>', 1],
|
|
||||||
['_trackPageview']
|
|
||||||
);
|
|
||||||
|
|
||||||
_gaq.push(['_addTrans',
|
|
||||||
'<?php echo $order_id; ?>', // order ID - required
|
|
||||||
'<?php bloginfo('name'); ?>', // affiliation or store name
|
|
||||||
'<?php echo $order->order_total; ?>', // total - required
|
|
||||||
'<?php echo $order->get_total_tax(); ?>', // tax
|
|
||||||
'<?php echo $order->get_shipping(); ?>', // shipping
|
|
||||||
'<?php echo $order->billing_city; ?>', // city
|
|
||||||
'<?php echo $order->billing_state; ?>', // state or province
|
|
||||||
'<?php echo $order->billing_country; ?>' // country
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Order items
|
|
||||||
<?php if ($order->get_items()) foreach($order->get_items() as $item) : $_product = $order->get_product_from_item( $item ); ?>
|
|
||||||
_gaq.push(['_addItem',
|
|
||||||
'<?php echo $order_id; ?>', // order ID - required
|
|
||||||
'<?php if (!empty($_product->sku))
|
|
||||||
echo __('SKU:', 'woocommerce') . ' ' . $_product->sku;
|
|
||||||
else
|
|
||||||
echo $_product->id;
|
|
||||||
?>', // SKU/code - required
|
|
||||||
'<?php echo $item['name']; ?>', // product name
|
|
||||||
'<?php if (isset($_product->variation_data)){
|
|
||||||
echo woocommerce_get_formatted_variation( $_product->variation_data, true );
|
|
||||||
} else {
|
|
||||||
$out = array();
|
|
||||||
$categories = get_the_terms($_product->id, 'product_cat');
|
|
||||||
foreach ( $categories as $category ){
|
|
||||||
$out[] = $category->name;
|
|
||||||
}
|
|
||||||
echo join( "/", $out);
|
|
||||||
}
|
|
||||||
?>', // category or variation
|
|
||||||
'<?php echo ($item['line_total']/$item['qty']); ?>', // unit price - required
|
|
||||||
'<?php echo $item['qty']; ?>' // quantity - required
|
|
||||||
]);
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
_gaq.push(['_trackTrans']); // submits transaction to the Analytics servers
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ecommerce tracking with piwik
|
* ecommerce tracking with piwik
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -137,8 +137,6 @@ add_action( 'init', 'woocommerce_process_registration' );
|
||||||
add_action('init', 'woocommerce_download_product');
|
add_action('init', 'woocommerce_download_product');
|
||||||
|
|
||||||
/* Analytics */
|
/* Analytics */
|
||||||
add_action( 'wp_footer', 'woocommerce_google_tracking' );
|
|
||||||
add_action( 'woocommerce_thankyou', 'woocommerce_ecommerce_tracking' );
|
|
||||||
add_action( 'woocommerce_thankyou', 'woocommerce_ecommerce_tracking_piwik' );
|
add_action( 'woocommerce_thankyou', 'woocommerce_ecommerce_tracking_piwik' );
|
||||||
|
|
||||||
/* RSS Feeds */
|
/* RSS Feeds */
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Plugin Name: WooCommerce
|
* Plugin Name: WooCommerce
|
||||||
* Plugin URI: http://www.woothemes.com/woocommerce/
|
* Plugin URI: http://www.woothemes.com/woocommerce/
|
||||||
* Description: An e-commerce toolkit that helps you sell anything. Beautifully.
|
* Description: An e-commerce toolkit that helps you sell anything. Beautifully.
|
||||||
* Version: 1.5.4
|
* Version: 1.5.5
|
||||||
* Author: WooThemes
|
* Author: WooThemes
|
||||||
* Author URI: http://woothemes.com
|
* Author URI: http://woothemes.com
|
||||||
* Requires at least: 3.3
|
* Requires at least: 3.3
|
||||||
|
@ -32,7 +32,7 @@ class Woocommerce {
|
||||||
|
|
||||||
/** Version ***************************************************************/
|
/** Version ***************************************************************/
|
||||||
|
|
||||||
var $version = '1.5.4';
|
var $version = '1.5.5';
|
||||||
|
|
||||||
/** URLS ******************************************************************/
|
/** URLS ******************************************************************/
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ class Woocommerce {
|
||||||
var $countries;
|
var $countries;
|
||||||
var $woocommerce_email;
|
var $woocommerce_email;
|
||||||
var $checkout;
|
var $checkout;
|
||||||
|
var $integrations;
|
||||||
|
|
||||||
/** Taxonomies ************************************************************/
|
/** Taxonomies ************************************************************/
|
||||||
|
|
||||||
|
@ -111,11 +112,17 @@ class Woocommerce {
|
||||||
include( 'classes/class-wc-product.php' ); // Product class
|
include( 'classes/class-wc-product.php' ); // Product class
|
||||||
include( 'classes/class-wc-product-variation.php' ); // Product variation class
|
include( 'classes/class-wc-product-variation.php' ); // Product variation class
|
||||||
include( 'classes/class-wc-tax.php' ); // Tax class
|
include( 'classes/class-wc-tax.php' ); // Tax class
|
||||||
|
include( 'classes/class-wc-settings-api.php' ); // Settings API
|
||||||
|
|
||||||
// Include shipping modules and gateways
|
// Include Core Payment Gateways
|
||||||
include( 'classes/class-wc-settings-api.php' );
|
|
||||||
include( 'classes/gateways/class-wc-payment-gateways.php' );
|
include( 'classes/gateways/class-wc-payment-gateways.php' );
|
||||||
include( 'classes/gateways/class-wc-payment-gateway.php' );
|
include( 'classes/gateways/class-wc-payment-gateway.php' );
|
||||||
|
include( 'classes/gateways/class-wc-bacs.php' );
|
||||||
|
include( 'classes/gateways/class-wc-cheque.php' );
|
||||||
|
include( 'classes/gateways/class-wc-paypal.php' );
|
||||||
|
include( 'classes/gateways/class-wc-cod.php' );
|
||||||
|
|
||||||
|
// Include Core Shipping Methods
|
||||||
include( 'classes/shipping/class-wc-shipping.php' );
|
include( 'classes/shipping/class-wc-shipping.php' );
|
||||||
include( 'classes/shipping/class-wc-shipping-method.php' );
|
include( 'classes/shipping/class-wc-shipping-method.php' );
|
||||||
include( 'classes/shipping/class-wc-flat-rate.php' );
|
include( 'classes/shipping/class-wc-flat-rate.php' );
|
||||||
|
@ -123,10 +130,14 @@ class Woocommerce {
|
||||||
include( 'classes/shipping/class-wc-free-shipping.php' );
|
include( 'classes/shipping/class-wc-free-shipping.php' );
|
||||||
include( 'classes/shipping/class-wc-local-delivery.php' );
|
include( 'classes/shipping/class-wc-local-delivery.php' );
|
||||||
include( 'classes/shipping/class-wc-local-pickup.php' );
|
include( 'classes/shipping/class-wc-local-pickup.php' );
|
||||||
include( 'classes/gateways/class-wc-bacs.php' );
|
|
||||||
include( 'classes/gateways/class-wc-cheque.php' );
|
// Include Core Integrations
|
||||||
include( 'classes/gateways/class-wc-paypal.php' );
|
include( 'classes/integrations/class-wc-integration.php' );
|
||||||
include( 'classes/gateways/class-wc-cod.php' );
|
include( 'classes/integrations/class-wc-integrations.php' );
|
||||||
|
include( 'classes/integrations/google-analytics/class-wc-google-analytics.php' );
|
||||||
|
include( 'classes/integrations/sharethis/class-wc-sharethis.php' );
|
||||||
|
include( 'classes/integrations/sharedaddy/class-wc-sharedaddy.php' );
|
||||||
|
include( 'classes/integrations/shareyourcart/class-wc-shareyourcart.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -187,10 +198,12 @@ class Woocommerce {
|
||||||
$this->payment_gateways = new WC_Payment_gateways(); // Payment gateways. Loads and stores payment methods
|
$this->payment_gateways = new WC_Payment_gateways(); // Payment gateways. Loads and stores payment methods
|
||||||
$this->shipping = new WC_Shipping(); // Shipping class. loads and stores shipping methods
|
$this->shipping = new WC_Shipping(); // Shipping class. loads and stores shipping methods
|
||||||
$this->countries = new WC_Countries(); // Countries class
|
$this->countries = new WC_Countries(); // Countries class
|
||||||
|
$this->integrations = new WC_Integrations(); // Integrations class
|
||||||
|
|
||||||
// Init shipping and payment gateways
|
// Init shipping, payment gateways, and integrations
|
||||||
$this->shipping->init();
|
$this->shipping->init();
|
||||||
$this->payment_gateways->init();
|
$this->payment_gateways->init();
|
||||||
|
$this->integrations->init();
|
||||||
|
|
||||||
// Classes/actions loaded for the frontend and for ajax requests
|
// Classes/actions loaded for the frontend and for ajax requests
|
||||||
if ( ! is_admin() || defined('DOING_AJAX') ) {
|
if ( ! is_admin() || defined('DOING_AJAX') ) {
|
||||||
|
@ -377,6 +390,12 @@ class Woocommerce {
|
||||||
if ( isset( $_SERVER['QUERY_STRING'] ) )
|
if ( isset( $_SERVER['QUERY_STRING'] ) )
|
||||||
$_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING'];
|
$_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NGINX Proxy
|
||||||
|
if ( ! isset( $_SERVER['REMOTE_ADDR'] ) && isset( $_SERVER['HTTP_REMOTE_ADDR'] ) )
|
||||||
|
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_REMOTE_ADDR'];
|
||||||
|
if ( ! isset( $_SERVER['HTTPS'] ) && ! empty( $_SERVER['HTTP_HTTPS'] ) )
|
||||||
|
$_SERVER['HTTPS'] = $_SERVER['HTTP_HTTPS'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1047,11 +1066,7 @@ class Woocommerce {
|
||||||
* Ajax URL
|
* Ajax URL
|
||||||
*/
|
*/
|
||||||
function ajax_url() {
|
function ajax_url() {
|
||||||
$url = admin_url( 'admin-ajax.php' );
|
return str_replace( array('https:', 'http:'), '', admin_url( 'admin-ajax.php' ) );
|
||||||
|
|
||||||
$url = ( is_ssl() ) ? $url : str_replace( 'https', 'http', $url );
|
|
||||||
|
|
||||||
return $url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1351,6 +1366,8 @@ class Woocommerce {
|
||||||
$wpdb->query("DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_wc_product_total_stock_%')");
|
$wpdb->query("DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_wc_product_total_stock_%')");
|
||||||
$wpdb->query("DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_wc_average_rating_%')");
|
$wpdb->query("DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_wc_average_rating_%')");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wp_cache_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Body Classes **********************************************************/
|
/** Body Classes **********************************************************/
|
||||||
|
|