Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Sep 24, 2014
2 parents f9a316a + 767cfbd commit 9e969fc
Show file tree
Hide file tree
Showing 31 changed files with 1,416 additions and 1,092 deletions.
5 changes: 0 additions & 5 deletions .buildpath

This file was deleted.

16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Eclipse
/.buildpath
/.project
/.settings

# Grunt
/node_modules/

# Deploy
/deploy/

# WordPress SVN
/wp-svn/

# PHPUnit
/phpunit.xml
34 changes: 0 additions & 34 deletions .project

This file was deleted.

16 changes: 0 additions & 16 deletions .settings/.jsdtscope

This file was deleted.

2 changes: 0 additions & 2 deletions .settings/org.eclipse.core.resources.prefs

This file was deleted.

2 changes: 0 additions & 2 deletions .settings/org.eclipse.core.runtime.prefs

This file was deleted.

5 changes: 0 additions & 5 deletions .settings/org.eclipse.php.core.prefs

This file was deleted.

7 changes: 0 additions & 7 deletions .settings/org.eclipse.wst.common.project.facet.core.xml

This file was deleted.

1 change: 0 additions & 1 deletion .settings/org.eclipse.wst.jsdt.ui.superType.container

This file was deleted.

1 change: 0 additions & 1 deletion .settings/org.eclipse.wst.jsdt.ui.superType.name

This file was deleted.

67 changes: 67 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module.exports = function( grunt ) {
// Project configuration.
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),

// PHPLint
phplint: {
options: {
phpArgs: {
'-lf': null
}
},
all: [ '**/*.php' ]
},

// PHP Code Sniffer
phpcs: {
application: {
dir: [ './' ],
},
options: {
standard: 'phpcs.ruleset.xml',
extensions: 'php',
ignore: 'wp-svn,deploy,node_modules'
}
},

// Check WordPress version
checkwpversion: {
options: {
readme: 'readme.txt',
plugin: 'stock-synchronization.php',
},
check: {
version1: 'plugin',
version2: 'readme',
compare: '=='
},
check2: {
version1: 'plugin',
version2: '<%= pkg.version %>',
compare: '=='
}
},

// Make POT
makepot: {
target: {
options: {
cwd: '',
domainPath: 'languages',
type: 'wp-plugin',
exclude: [ 'deploy/.*', 'wp-svn/.*' ],
}
}
},
} );

grunt.loadNpmTasks( 'grunt-phplint' );
grunt.loadNpmTasks( 'grunt-phpcs' );
grunt.loadNpmTasks( 'grunt-checkwpversion' );
grunt.loadNpmTasks( 'grunt-wp-i18n' );

// Default task(s).
grunt.registerTask( 'default', [ 'phplint', 'phpcs', 'checkwpversion' ] );
grunt.registerTask( 'pot', [ 'makepot' ] );
};
65 changes: 57 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,67 @@
# WooCommerce Stock Synchronization
The WooCommerce Stock Synchronization Plugin allows you to synchronize the stock values of the same products across multiple WooCommerce websites.

Please show support for this plugin if you plan on using it, by buying it from CodeCanyon
[http://codecanyon.net/item/woocommerce-stock-synchonization/4827997](http://codecanyon.net/item/woocommerce-stock-synchonization/4827997)
The WooCommerce Stock Synchronization Plugin allows you to synchronize the
stock values of the same products across multiple WooCommerce websites.

Please show support for this plugin if you plan on using it, by buying it
from HappyWP:
[http://www.happywp.com/plugins/woocommerce-stock-synchronization/](www.happywp.com/plugins/woocommerce-stock-synchronization/)


## Requirements

* WooCommerce version 2.1.12 or greater
* WordPress version 3.8 or greater


## How does the plugin work?

The plugin will do HTTP POST requests to the websites you want to syncrhonize.

```
http://www.example.com/?wc_stock_sync=1&source=http://www.example.org/&password=secret
```

### Parameters

#### wc_stock_sync

Type: `boolean`
Default: `1`

#### wc_stock_sync

Type: `source`
Default: `siteurl( '/' )`

#### wc_stock_sync

Type: `password`


### Post Data

Type: `JSON`
Example:

```json
{
"SKU1": 1,
"SKU2": 2,
"SKU3": 4
}
```


## Documentation and Usage Instructions
[Pronamic Documentation](http://pronamic.nl/documentation/wp-woocommerce-stock-synchronization/)

[http://www.happywp.com/manuals/woocommerce-stock-synchronization/](http://www.happywp.com/manuals/woocommerce-stock-synchronization/)


## Credits
[Pronamic](http://pronamic.nl) [@pronamic](http://twitter.com/pronamic)

[Remco Tolsma](http://remcotolsma.nl) [@remcotolsma](http://twitter.com/remcotolsma)
[Pronamic](http://www.pronamic.nl/) [@pronamic](http://twitter.com/pronamic)

[Leon Rowland](http://leon.rowland.nl) [@leonrowland](http://twitter.com/leonrowland)
[Remco Tolsma](http://www.remcotolsma.nl/) [@remcotolsma](http://twitter.com/remcotolsma)

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/pronamic/wp-woocommerce-stock-synchronization/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

43 changes: 43 additions & 0 deletions admin/page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

$tabs = array(
'settings' => __( 'Settings', 'woocommerce_stock_sync' ),
'websites' => __( 'Websites', 'woocommerce_stock_sync' ),
'stock' => __( 'Stock', 'woocommerce_stock_sync' ),
'log' => __( 'Log', 'woocommerce_stock_sync' ),
);

$current_tab = filter_input( INPUT_GET, 'tab', FILTER_SANITIZE_STRING );
$current_tab = empty( $current_tab ) ? key( $tabs ) : $current_tab;

$page_url = add_query_arg( 'page', 'woocommerce_stock_sync', admin_url( 'admin.php' ) );

printf( '<div class="wrap">' );

if ( empty( $tabs ) ) {
printf( '<h2>%s</h2>', esc_html( get_admin_page_title() ) );
} else {
printf( '<h2 class="nav-tab-wrapper">' );

foreach ( $tabs as $tab => $title ) {
$classes = array( 'nav-tab' );
if ( $current_tab == $tab ) {
$classes[] = 'nav-tab-active';
}

$url = add_query_arg( 'tab', $tab, $page_url );

printf(
'<a class="nav-tab %s" href="%s">%s</a>',
esc_attr( implode( ' ', $classes ) ),
esc_attr( $url ),
$title
);
}

printf( '</h2>' );
}

include 'tab-' . $current_tab . '.php';

printf( '</div>' );
61 changes: 0 additions & 61 deletions admin/settings.php

This file was deleted.

Loading

0 comments on commit 9e969fc

Please sign in to comment.