This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,416 additions
and
1,092 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ] ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>' ); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.