diff --git a/admin/jigoshop-admin-attributes.php b/admin/admin-attributes.php similarity index 70% rename from admin/jigoshop-admin-attributes.php rename to admin/admin-attributes.php index b5ad3c63691..ab61e723722 100644 --- a/admin/jigoshop-admin-attributes.php +++ b/admin/admin-attributes.php @@ -2,11 +2,11 @@ /** * Functions used for the attributes section in WordPress Admin * - * The attributes section lets users add custom attributes to assign to products - they can also be used in the layered nav widgets. + * The attributes section lets users add custom attributes to assign to products - they can also be used in the layered nav widget. * - * @author Jigowatt + * @author WooThemes * @category Admin - * @package JigoShop + * @package WooCommerce */ /** @@ -14,11 +14,8 @@ * * Shows the created attributes and lets you add new ones. * The added attributes are stored in the database and can be used for layered navigation. - * - * @since 1.0 - * @usedby jigoshop_admin_menu2() */ -function jigoshop_attributes() { +function woocommerce_attributes() { global $wpdb; @@ -30,9 +27,9 @@ function jigoshop_attributes() { if ($attribute_name && $attribute_type && !taxonomy_exists('product_attribute_'.strtolower(sanitize_title($attribute_name)))) : - $wpdb->insert( $wpdb->prefix . "jigoshop_attribute_taxonomies", array( 'attribute_name' => $attribute_name, 'attribute_type' => $attribute_type ), array( '%s', '%s' ) ); + $wpdb->insert( $wpdb->prefix . "woocommerce_attribute_taxonomies", array( 'attribute_name' => $attribute_name, 'attribute_type' => $attribute_type ), array( '%s', '%s' ) ); - update_option('jigowatt_update_rewrite_rules', '1'); + update_option('woocommerce_update_rewrite_rules', '1'); wp_safe_redirect( get_admin_url() . 'admin.php?page=attributes' ); exit; @@ -47,7 +44,7 @@ function jigoshop_attributes() { $attribute_type = $_POST['attribute_type']; - $wpdb->update( $wpdb->prefix . "jigoshop_attribute_taxonomies", array( 'attribute_type' => $attribute_type ), array( 'attribute_id' => $_GET['edit'] ), array( '%s' ) ); + $wpdb->update( $wpdb->prefix . "woocommerce_attribute_taxonomies", array( 'attribute_type' => $attribute_type ), array( 'attribute_id' => $_GET['edit'] ), array( '%s' ) ); endif; @@ -60,9 +57,9 @@ function jigoshop_attributes() { if ($delete>0) : - $att_name = $wpdb->get_var("SELECT attribute_name FROM " . $wpdb->prefix . "jigoshop_attribute_taxonomies WHERE attribute_id = '$delete'"); + $att_name = $wpdb->get_var("SELECT attribute_name FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = '$delete'"); - if ($att_name && $wpdb->query("DELETE FROM " . $wpdb->prefix . "jigoshop_attribute_taxonomies WHERE attribute_id = '$delete'")) : + if ($att_name && $wpdb->query("DELETE FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = '$delete'")) : $taxonomy = 'product_attribute_'.strtolower(sanitize_title($att_name)); @@ -85,9 +82,9 @@ function jigoshop_attributes() { endif; if (isset($_GET['edit']) && $_GET['edit'] > 0) : - jigoshop_edit_attribute(); + woocommerce_edit_attribute(); else : - jigoshop_add_attribute(); + woocommerce_add_attribute(); endif; } @@ -96,40 +93,37 @@ function jigoshop_attributes() { * Edit Attribute admin panel * * Shows the interface for changing an attributes type between select, multiselect and text - * - * @since 1.0 - * @usedby jigoshop_attributes() */ -function jigoshop_edit_attribute() { +function woocommerce_edit_attribute() { global $wpdb; $edit = absint($_GET['edit']); - $att_type = $wpdb->get_var("SELECT attribute_type FROM " . $wpdb->prefix . "jigoshop_attribute_taxonomies WHERE attribute_id = '$edit'"); + $att_type = $wpdb->get_var("SELECT attribute_type FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = '$edit'"); ?> -
- | - | + | + | + | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attribute_name; ?> - + | attribute_type); ?> | ||||||||||||
+ | ||
- | + | |
- | + | |
- | + |
pending_count; ?> | -+ | pending_count; ?> | +|
on_hold_count; ?> | -+ | on_hold_count; ?> | +|
processing_count; ?> | -+ | processing_count; ?> | +|
completed_count; ?> | -+ | completed_count; ?> | +
JigoShop .
+WooCommerce .
+ | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- | + | + | |||||||||||
+ | |||||||||||||
+ | |||||||||||||
+ | |||||||||||||
+ |
+ | |||
---|---|---|---|
+ | |||
+ | |||
+ | |||
- | + | + | |
+ | |||
- | ' . __('Your server supports fsockopen.', 'jigoshop'). ''; else echo '' . __('Your server does not support fsockopen.', 'jigoshop'). ''; ?> | ++ | ' . __('Your server supports fsockopen.', 'woothemes'). ''; else echo '' . __('Your server does not support fsockopen.', 'woothemes'). ''; ?> |
- | order_subtotal); ?> | ++ | order_subtotal); ?> |
---|---|---|---|
- | order_shipping); ?> | ++ | order_shipping); ?> |
- | get_total_tax()); ?> | ++ | get_total_tax()); ?> |
- | order_discount); ?> | ++ | order_discount); ?> |
- | order_total); ?> | ++ | order_total); ?> |
'.__('Your settings have been saved.', 'woothemes').'
: | +|||||||||||||
: | ++ |
+ ||||||||||||
: | +
+
+ + |
+ ||||||||||||
: | +
+
+ + |
+ ||||||||||||
: | ++ | +||||||||||||
: | +
+
|
+ ||||||||||||
: | +
+
|
+ ||||||||||||
: | +
+
+ 0) foreach( $tax_rates as $rate ) : $i++;
+ echo '
+
+ % × '; + endforeach; + ?> + |
+ ||||||||||||
- | - |
: | -|||||||||||||
: | -- |
- ||||||||||||
: | -
-
- - |
- ||||||||||||
: | -
-
- - |
- ||||||||||||
: | -- | -||||||||||||
: | -
-
|
- ||||||||||||
: | -
-
|
- ||||||||||||
: | -
-
- 0) foreach( $tax_rates as $rate ) : $i++;
- echo '
-
- % × '; - endforeach; - ?> - |
-
- | - | - | - | - | - | post_status, 'publish'); ?> /> | ++ | + | + | + | + | + | post_status, 'publish'); ?> /> |
\ - \ - \ + \ + \ '; + echo '
\ -\ - | \ - | \ - | \ - | \ - | \ - | \ + | \ + | \ + | \ + | \ + | \ + | \ + | \ |
+ +
'; + + + // Summary + echo '+
'; + + // SKU + $field = array( 'id' => 'sku', 'label' => __('SKU', 'woothemes') ); + $SKU = get_post_meta($thepostid, 'SKU', true); + + if( get_option('woocommerce_enable_sku', true) !== 'no' ) : + echo '+ + ' . __('Leave blank to use product ID', 'woothemes') . '
'; + else: + echo ''; + endif; + + // Weight + $field = array( 'id' => 'weight', 'label' => __('Weight', 'woothemes') . ' ('.get_option('woocommerce_weight_unit').'):' ); + + if( get_option('woocommerce_enable_weight', true) !== 'no' ) : + echo '+ +
'; + else: + echo ''; + endif; + + // Featured + $field = array( 'id' => 'featured', 'label' => __('Featured?', 'woothemes') ); + echo ''; + + // Visibility + $field = array( 'id' => 'visibility', 'label' => __('Visibility', 'woothemes') ); + echo ''; + ?> ++ +
'; + + // Special Price + $field = array( 'id' => 'sale_price', 'label' => __('Sale Price', 'woothemes') . ' ('.get_woocommerce_currency_symbol().'):' ); + echo '+ +
'; + + // Special Price date range + $field = array( 'id' => 'sale_price_dates', 'label' => __('Sale Price Dates', 'woothemes') ); + + $sale_price_dates_from = get_post_meta($thepostid, 'sale_price_dates_from', true); + $sale_price_dates_to = get_post_meta($thepostid, 'sale_price_dates_to', true); + + echo '
+
+
+
+ ' . __('Date format', 'woothemes') . ': YYYY-MM-DD
+
+ + +
'; + + // Backorders? + $field = array( 'id' => 'backorders', 'label' => __('Allow Backorders?', 'woothemes') ); + echo ''; + + echo '+ | + | + | + | + | + |
---|---|---|---|---|---|
+ + + | ++ attribute_name; ?> + + + | ++ attribute_type=="select" || $tax->attribute_type=="multiselect") : ?> + + attribute_type=="text") : ?> + + + | +name="attribute_visibility[]" value="1" /> | +name="attribute_variation[]" value="1" /> | ++ |
+ + + | ++ + + | ++ | name="attribute_visibility[]" value="1" /> | +name="attribute_variation[]" value="1" /> | ++ |
'.$error.'
'; + endforeach; + echo 'get_value('createaccount')) echo 'checked="checked" '; - echo 'type="checkbox" name="createaccount" />
'; + echo 'type="checkbox" name="createaccount" /> '; endif; echo ''.__('Save time in the future and check the status of your order by creating an account.', 'jigoshop').'
'.__('Save time in the future and check the status of your order by creating an account.', 'woothemes').'
'; endif; @@ -110,15 +110,15 @@ class jigoshop_checkout { function checkout_form_shipping() { // Shipping Details - if (jigoshop_cart::needs_shipping() && !jigoshop_cart::ship_to_billing_address_only()) : + if (woocommerce_cart::needs_shipping() && !woocommerce_cart::ship_to_billing_address_only()) : echo 'get_value('shiptobilling'); if ($shiptobilling) echo 'checked="checked" '; - echo 'type="checkbox" name="shiptobilling" />
'; + echo 'type="checkbox" name="shiptobilling" /> '; - echo ''.$after; @@ -189,25 +189,25 @@ class jigoshop_checkout { '; $current_cc = $this->get_value($args['rel']); - if (!$current_cc) $current_cc = jigoshop_customer::get_country(); + if (!$current_cc) $current_cc = woocommerce_customer::get_country(); $current_r = $this->get_value($args['name']); - if (!$current_r) $current_r = jigoshop_customer::get_state(); + if (!$current_r) $current_r = woocommerce_customer::get_state(); - $states = jigoshop_countries::$states; + $states = woocommerce_countries::$states; if (isset( $states[$current_cc][$current_r] )) : // Dropdown - $field .= '