WooCommerce Stock Manager - Version 1.2.8

Version Description

Download this release

Release Info

Developer Musilda
Plugin Icon 128x128 WooCommerce Stock Manager
Version 1.2.8
Comparing to
See all releases

Version 1.2.8

Files changed (40) hide show
  1. woocommerce-stock-manager/LICENSE.txt +339 -0
  2. woocommerce-stock-manager/README.txt +279 -0
  3. woocommerce-stock-manager/admin/assets/css/admin.css +605 -0
  4. woocommerce-stock-manager/admin/assets/css/index.php +1 -0
  5. woocommerce-stock-manager/admin/assets/js/admin.js +264 -0
  6. woocommerce-stock-manager/admin/assets/js/index.php +1 -0
  7. woocommerce-stock-manager/admin/class-stock-manager-admin.php +326 -0
  8. woocommerce-stock-manager/admin/includes/config.php +34 -0
  9. woocommerce-stock-manager/admin/includes/index.php +2 -0
  10. woocommerce-stock-manager/admin/includes/wcm-class-save.php +212 -0
  11. woocommerce-stock-manager/admin/includes/wcm-class-stock.php +472 -0
  12. woocommerce-stock-manager/admin/includes/wcm-class-table.php +806 -0
  13. woocommerce-stock-manager/admin/views/admin.php +160 -0
  14. woocommerce-stock-manager/admin/views/components/filter.php +147 -0
  15. woocommerce-stock-manager/admin/views/import-export.php +277 -0
  16. woocommerce-stock-manager/admin/views/index.php +1 -0
  17. woocommerce-stock-manager/admin/views/setting.php +56 -0
  18. woocommerce-stock-manager/admin/views/upload/stock-manager-export.csv +52 -0
  19. woocommerce-stock-manager/assets/banner-772x250.png +0 -0
  20. woocommerce-stock-manager/assets/icon-128x128.png +0 -0
  21. woocommerce-stock-manager/assets/icon-256x256.png +0 -0
  22. woocommerce-stock-manager/assets/screenshot-1.png +0 -0
  23. woocommerce-stock-manager/assets/screenshot-2.png +0 -0
  24. woocommerce-stock-manager/assets/screenshot-3.png +0 -0
  25. woocommerce-stock-manager/assets/screenshot-4.png +0 -0
  26. woocommerce-stock-manager/index.php +1 -0
  27. woocommerce-stock-manager/languages/index.php +1 -0
  28. woocommerce-stock-manager/languages/woocommerce-stock-manager-cs_CZ.mo +0 -0
  29. woocommerce-stock-manager/languages/woocommerce-stock-manager-cs_CZ.po +397 -0
  30. woocommerce-stock-manager/languages/woocommerce-stock-manager-es_ES.mo +0 -0
  31. woocommerce-stock-manager/languages/woocommerce-stock-manager-es_ES.po +405 -0
  32. woocommerce-stock-manager/languages/woocommerce-stock-manager-fa_IR.mo +0 -0
  33. woocommerce-stock-manager/languages/woocommerce-stock-manager-fa_IR.po +409 -0
  34. woocommerce-stock-manager/languages/woocommerce-stock-manager-fr_FR.mo +0 -0
  35. woocommerce-stock-manager/languages/woocommerce-stock-manager-fr_FR.po +400 -0
  36. woocommerce-stock-manager/languages/woocommerce-stock-manager-sk_SK.mo +0 -0
  37. woocommerce-stock-manager/languages/woocommerce-stock-manager-sk_SK.po +402 -0
  38. woocommerce-stock-manager/public/class-stock-manager.php +242 -0
  39. woocommerce-stock-manager/uninstall.php +16 -0
  40. woocommerce-stock-manager/woocommerce-stock-manager.php +380 -0
woocommerce-stock-manager/LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
woocommerce-stock-manager/README.txt ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WooCommerce Stock Manager ===
2
+ Contributors: Musilda
3
+ Donate link:
4
+ Tags: WooCommerce, stock manager
5
+ Requires at least: 4.0
6
+ Tested up to: 5.0.2
7
+ Stable tag: 1.0.1
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ == Description ==
12
+
13
+ WooCommerce Stock Manager allows you manage stock for products and their variables from one screen.
14
+
15
+ Plugin is compatible with WooCommerce 3.0+ and is tested on 3.3.1 version.
16
+ For older version WooCommerce use plugin 1.1.4
17
+
18
+ GDPR ready - plugin don't collect personal data
19
+
20
+ A few notes about the plugin:
21
+
22
+ * You can set "Manage stock" for each product and variation
23
+ * You can set "Stock status" for each product and variation
24
+ * You can set "Backorders" for each product and variation
25
+ * You can set "Stock" for each product and variation
26
+ * You can set "Price" for each product and variation
27
+ * You can set "Sale price" for each product and variation
28
+ * You can set "Tax status" for each product and variation
29
+ * You can set "Tax class" for each product and variation
30
+ * You can set "Shipping class" for each product and variation
31
+ * You can set "Sku" for each product and variation
32
+ * You can set "Product name" for each product and variable product
33
+ * You can display product thumbnail
34
+
35
+
36
+ Stock field is green, when stock is more than 5 pieces.
37
+ Stock field is yellow, when stock is low than 5 pieces.
38
+ Stock field is red, when stock is 0 pieces.
39
+
40
+ You can filter products by type, category, stock manage or stock status.
41
+ You can sort products by name or sku.
42
+ Searching products by name or sku.
43
+ Filter displaying columns.
44
+
45
+ For better usabillity is possible hide some table cells.
46
+
47
+ Variants for variable product is posible edit after click on "Show variables" button.
48
+ Each product or variation, can be save separatelly, or you can save all displayed data.
49
+
50
+ Import/Export
51
+
52
+ With plugin is possible export all stock data from your eshop, edit them and import back with csv file.
53
+
54
+ Export file structure:
55
+
56
+ SKU - product unique identificator, required.
57
+ Manage stock - values: "yes", "notify", "no". If is empty "no" will be save.
58
+ Stock status - values: "instock", "outofstock". If is empty "outofstock" will be save.
59
+ Backorders - values: "yes", "notify", "no". If is empty "no" will be save.
60
+ Stock - quantity value.
61
+ Product type - type of product.
62
+ Parent SKU - if product is variant, parent product SKU is displayed for better filtering csv file.
63
+
64
+ == Installation ==
65
+
66
+ = Using The WordPress Dashboard =
67
+
68
+ 1. Navigate to the 'Add New' in the plugins dashboard
69
+ 2. Search for 'WooCommerce Stock Manager'
70
+ 3. Click 'Install Now'
71
+ 4. Activate the plugin on the Plugin dashboard
72
+
73
+ = Uploading in WordPress Dashboard =
74
+
75
+ 1. Navigate to the 'Add New' in the plugins dashboard
76
+ 2. Navigate to the 'Upload' area
77
+ 3. Select `woocommerce-stock-manager.zip` from your computer
78
+ 4. Click 'Install Now'
79
+ 5. Activate the plugin in the Plugin dashboard
80
+
81
+ = Using FTP =
82
+
83
+ 1. Download `woocommerce-stock-manager.zip`
84
+ 2. Extract the `woocommerce-stock-manager` directory to your computer
85
+ 3. Upload the `woocommerce-stock-manager` directory to the `/wp-content/plugins/` directory
86
+ 4. Activate the plugin in the Plugin dashboard
87
+
88
+
89
+ == Frequently Asked Questions ==
90
+
91
+ Q: Quantity change not working.
92
+ A: Be sure, that you have active stock manage.
93
+
94
+ == Screenshots ==
95
+
96
+ 1. Edit stock product data
97
+ 2. Edit stock variations data
98
+ 4. Show product variations
99
+
100
+ == Changelog ==
101
+
102
+ = 1.2.8 =
103
+ * Rename language file to woocommerce-stock-manager for compatibility with WordPress translate system
104
+ * Removed max width for table
105
+ * Fixed button position Save all on big screen
106
+
107
+ = 1.2.7 =
108
+ * Changed loading text domain
109
+ * Added new feature for stock editing. When manage stock is changed, backorder and stock inputs are disabled.
110
+ Stock status is changed automatically, based on stock value and backorder value, when manage stock is "yes"
111
+ This new feature is used for allowing only correct stock "scenario" - for example: you cannot change stock quantity, when manage stock is "no".
112
+
113
+ = 1.2.6 =
114
+ * Fixed default values for disaplay setting
115
+ * Fixed variations ordering
116
+
117
+ = 1.2.5 =
118
+ * Import/export feature is back
119
+ * Fixed sell price saving
120
+
121
+ = 1.2.4 =
122
+ * Fixed SKU sorting issue
123
+ * Fixed search limit issue
124
+
125
+ = 1.2.3 =
126
+ * Fixed wrong file update
127
+
128
+ = 1.2.2 =
129
+ * New filter for limit products in product table woocommerce_stock_manager_limit
130
+ * Import/export feature was removed from plugin
131
+ * New setting page for plugin
132
+ * Products limit setting
133
+ * Enable/disable qty input for variable product - if disabled, input showing all product variants stock qty
134
+ * Qty input step setting - for e-shops not using items, but meters or inches
135
+
136
+ = 1.2.1 =
137
+ * Fixed wrong saving stock quantity, when trying set zero value
138
+ * Added input for tax status
139
+ * Added input for tax class
140
+ * Added input for shipping class
141
+
142
+ = 1.2.0 =
143
+ * Fixed wrond saving stock quantity
144
+
145
+ = 1.1.9 =
146
+ * Fixed please enter a valid value issue
147
+ * Changed update meta to $product->set_ method for stock status, backorders, manage stock and sku
148
+
149
+ = 1.1.8 =
150
+ * Fixed issue with sale price
151
+ * Disable product qty input for variable product
152
+ * Variable roduct qty is calculated from all variants
153
+ * Removed price and sale price for variable product - they dont exist in WooCommerce
154
+
155
+ = 1.1.7 =
156
+ * Fixed issue with not saving Manage stock
157
+ * Fixed issue with searching SKU for variable products
158
+ * Fixed sales price error
159
+
160
+ = 1.1.6 =
161
+ * New filter stock_manager_manage for edit user capabitily to display manager - in class-stock-manager-admin.php file
162
+
163
+ = 1.1.5 =
164
+ * WooCommerce 3.0+ compatibility
165
+ * Sku edit is now via onclick function
166
+ * Fix Sku display issue
167
+ * French translations
168
+
169
+ = 1.1.4 =
170
+ * Fixed Save all button issue
171
+
172
+ = 1.1.3 =
173
+ * Typo admin fix
174
+
175
+ = 1.1.2 =
176
+ * Added input for sku change
177
+ * Use $product->set_stock for set qty value
178
+ * Added searching products by product name
179
+ * Wildcard for searching by sku
180
+ * Product name edit directly in table - green pen icon
181
+ * Added sale price
182
+ * Availability switch off/on table cells - price, sale price, weight, manage stock, stock status, backorders, stock
183
+ * New setting for cells displaying
184
+ * Fixed save all price error
185
+
186
+ = 1.1.1 =
187
+ * Fixed Search by SKU issue
188
+ * Improve filter for multiple values
189
+ * Added Order by filter
190
+ * Added Persian translation
191
+
192
+ = 1.1.0 =
193
+ * Removed "f" typo on admin page
194
+ * Fixed not saving issue
195
+ * Added product id paramater into hooks
196
+ * Optimized pagination method
197
+ * Fixed on sae price issue
198
+
199
+ = 1.0.9 =
200
+ * Fixed wrong generate AJAX nonce
201
+ * User manage WooCommerce capability control in stock_manager_save_one_product_stock_data
202
+
203
+ = 1.0.8 =
204
+ * Fixed security vulnerabily in AJAX call
205
+
206
+ = 1.0.7 =
207
+ * Fixed price saving
208
+ * New hook stock_manager_table_th in table head before Save text
209
+ * New hook stock_manager_table_simple_td in table line before Save button - simple product
210
+ * New hook stock_manager_table_variation_td in table line before Save button - product variation
211
+ * Edit product weight
212
+ * Added product name into export file
213
+
214
+ = 1.0.6 =
215
+ * Fixed issue with export class
216
+
217
+ = 1.0.5 =
218
+ * Search product by sku
219
+ * Edit product regular price
220
+ * Link to product edit page
221
+
222
+ = 1.0.4 =
223
+ * Fix error on attribut label displaying
224
+
225
+ = 1.0.3 =
226
+ * Added toggle display for variations
227
+ * Variation have their attributes as "variation name"
228
+ * Added availability work with plugin setting, for shop managers
229
+ * Fix displaing zero, when stock is low then 0
230
+
231
+ = 1.0.2 =
232
+ Fix wrong table displaing in administraion in FF and IE
233
+ Added Spanish translate - thanks to Miguel Acosta
234
+ Added Slovakia translate - thanks to Tomas Kusenda
235
+
236
+ = 1.0.1 =
237
+ Fix product filter issue
238
+
239
+ = 1.0.0 =
240
+ Startup version
241
+
242
+
243
+ == Upgrade Notice ==
244
+
245
+ = 1.0.7 =
246
+ * Fixed price saving
247
+ * New hook stock_manager_table_th in table head before Save text
248
+ * New hook stock_manager_table_simple_td in table line before Save button - simple product
249
+ * New hook stock_manager_table_variation_td in table line before Save button - product variation
250
+ * Edit product weight
251
+ * Added product name into export file
252
+
253
+ = 1.0.6 =
254
+ * Fixed issue with export class
255
+
256
+ = 1.0.5 =
257
+ * Search product by sku
258
+ * Edit product regular price
259
+ * Link to product edit page
260
+
261
+ = 1.0.4 =
262
+ * Fix error on attribut label displaying
263
+
264
+ = 1.0.3 =
265
+ * Added toggle display for variations
266
+ * Variation have their attributes as "variation name"
267
+ * Added availability work with plugin setting, for shop managers
268
+ * Fix displaing zero, when stock is low then 0
269
+
270
+ = 1.0.2 =
271
+ Fix wrong table displaing in administraion in FF and IE
272
+ Added Spanish translate - thanks to Miguel Acosta
273
+ Added Slovakia translate - thanks to Tomas Kusenda
274
+
275
+ = 1.0.1 =
276
+ Fix product filter issue
277
+
278
+ = 1.0.0 =
279
+ Startup version
woocommerce-stock-manager/admin/assets/css/admin.css ADDED
@@ -0,0 +1,605 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Main admin style */
2
+
3
+ /* Cols */
4
+ .t-col-12,.t-col-9,.t-col-6,.t-col-4{
5
+ float:left;
6
+ -webkit-box-sizing: border-box;
7
+ -moz-box-sizing: border-box;
8
+ box-sizing: border-box;
9
+ }
10
+ .t-col-12{
11
+ width:98%;
12
+ margin:0 1% 0 1%;
13
+ }
14
+ .t-col-9{
15
+ width:73%;
16
+ margin:0 1% 0 1%;
17
+ }
18
+ .t-col-6{
19
+ width:48%;
20
+ margin:0 1% 0 1%;
21
+ }
22
+ .t-col-4{
23
+ width:31.333%;
24
+ margin:0 1% 0 1%;
25
+ }
26
+
27
+ /* Boxes */
28
+ .toret_box,
29
+ .toret-box .box-header,
30
+ .toret-box .box-body,
31
+ .toret-box .box-footer{
32
+ -webkit-box-sizing: border-box;
33
+ -moz-box-sizing: border-box;
34
+ box-sizing: border-box;
35
+ }
36
+
37
+
38
+ .toret-box {
39
+ position: relative;
40
+ background: #ffffff;
41
+ border-top: 2px solid #c1c1c1;
42
+ margin-bottom: 20px;
43
+ -webkit-border-radius: 3px;
44
+ -moz-border-radius: 3px;
45
+ border-radius: 3px;
46
+ width: 100%;
47
+ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
48
+ }
49
+
50
+ .toret-box.box-primary {
51
+ border-top-color: #3c8dbc;
52
+ }
53
+ .toret-box.box-info {
54
+ border-top-color: #00c0ef;
55
+ }
56
+ .toret-box.box-danger {
57
+ border-top-color: #f56954;
58
+ }
59
+ .toret-box.box-warning {
60
+ border-top-color: #f39c12;
61
+ }
62
+ .toret-box.box-success {
63
+ border-top-color: #00a65a;
64
+ }
65
+ .toret-box .box-header {
66
+ float:left;
67
+ width:100%;
68
+ display:block;
69
+ }
70
+ .toret-box .box-body {
71
+ padding:10px;
72
+ }
73
+ .toret-box .box-footer {
74
+ }
75
+
76
+ .toret-box .box-header > .fa, .toret-box .box-header > .glyphicon, .toret-box .box-header > .ion, .toret-box .box-header .box-title {
77
+ display: inline-block;
78
+ padding: 10px 0px 10px 10px;
79
+ margin: 0;
80
+ font-size: 20px;
81
+ font-weight: 400;
82
+ float: left;
83
+ cursor: default;
84
+ }
85
+
86
+ /* Box forms */
87
+
88
+ .toret-box label {
89
+ width:40%;
90
+ margin-right:1%;
91
+ float:left;
92
+ }
93
+ .toret-box input[type=text],
94
+ .toret-box input[type=email],
95
+ .toret-box input[type=password],
96
+ .toret-box textarea {
97
+ width:50%;
98
+ }
99
+ .toret-box input[type=text].input-big,
100
+ .toret-box input[type=email].input-big,
101
+ .toret-box input[type=password].input-big,
102
+ .toret-box textarea {
103
+ width:100%;
104
+ }
105
+
106
+ .input-big{width:100%;}
107
+
108
+ /* Admin table */
109
+ .table-bordered{
110
+ width:100%;
111
+ border-collapse:collapse;
112
+ margin-bottom:15px;
113
+ }
114
+ .table-bordered tr{position:relative;}
115
+ .table-bordered tr th{
116
+ color:#000000;
117
+ background-color:#ddd;
118
+ padding:6px;
119
+ border:solid 1px #ddd;
120
+ }
121
+ .table-bordered tr td{
122
+ padding:6px;
123
+ border:solid 1px #ddd;
124
+ background-color:#ffffff;
125
+ }
126
+
127
+ .table-bordered tr td.td_center{ text-align:center; }
128
+ .table-bordered tr td.td_small{ width:100px; }
129
+
130
+ .lineloader{
131
+ float:left;
132
+ display:none;
133
+ position:absolute;
134
+ left:0;
135
+ top:0;
136
+ width:100%;
137
+ height:100%;
138
+ background-color:rgba(255,255,255,0.8);
139
+ -webkit-box-sizing: border-box;
140
+ -moz-box-sizing: border-box;
141
+ box-sizing: border-box;
142
+ z-index:10000;
143
+ }
144
+ .table-bordered tr.variation-line td{background-color:#cbe1ec;
145
+ border: solid 1px #ffffff;
146
+ }
147
+ .table-bordered tr.variation-line {
148
+ display:none;
149
+ }
150
+ .table-bordered tr.variation-line.show-variations {
151
+ display:table-row;
152
+ }
153
+ .table-bordered tr td.outofstock{background-color:#f80000; }
154
+ .table-bordered tr td.lowstock{background-color:#ffcd35; }
155
+ .table-bordered tr td.instock{background-color:#43b610; }
156
+
157
+ /* Buttons */
158
+
159
+ .wrap .add-new-button{
160
+ margin:20px 0 20px 0;
161
+ }
162
+
163
+ /*
164
+ Component: Buttons
165
+ -------------------------
166
+ */
167
+
168
+ .btn {
169
+ display: inline-block;
170
+ padding: 6px 12px;
171
+ margin-bottom: 0;
172
+ font-size: 14px;
173
+ font-weight: 500;
174
+ line-height: 1.428571429;
175
+ text-align: center;
176
+ text-decoration: none;
177
+ white-space: nowrap;
178
+ vertical-align: middle;
179
+ cursor: pointer;
180
+ background-image: none;
181
+ border: 1px solid transparent;
182
+ -webkit-user-select: none;
183
+ -moz-user-select: none;
184
+ -ms-user-select: none;
185
+ -o-user-select: none;
186
+ user-select: none;
187
+ -webkit-border-radius: 3px;
188
+ -moz-border-radius: 3px;
189
+ border-radius: 3px;
190
+ border: 1px solid transparent;
191
+ -webkit-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.09);
192
+ -moz-box-shadow: inset 0px -2px 0px 0px rgba(0, 0, 0, 0.09);
193
+ box-shadow: inset 0px -1px 0px 0px rgba(0, 0, 0, 0.09);
194
+ }
195
+ .btn:hover, .btn:focus {
196
+ color: #333;
197
+ text-decoration: none;
198
+ }
199
+
200
+
201
+ .btn.btn-default {
202
+ background-color: #fafafa;
203
+ color: #666;
204
+ border-color: #ddd;
205
+ border-bottom-color: #ddd;
206
+ }
207
+ .btn.btn-default:hover,
208
+ .btn.btn-default:active,
209
+ .btn.btn-default.hover {
210
+ background-color: #f4f4f4!important;
211
+ }
212
+ .btn.btn-default.btn-flat {
213
+ border-bottom-color: #d9dadc;
214
+ }
215
+ .btn.btn-primary {
216
+ color:#ffffff;
217
+ background-color: #3c8dbc;
218
+ border-color: #367fa9;
219
+ }
220
+ .btn.btn-primary:hover,
221
+ .btn.btn-primary:active,
222
+ .btn.btn-primary.hover {
223
+ color:#ffffff;
224
+ background-color: #367fa9;
225
+ }
226
+ .btn.btn-success {
227
+ color:#ffffff;
228
+ background-color: #00a65a;
229
+ border-color: #008d4c;
230
+ }
231
+ .btn.btn-success:hover,
232
+ .btn.btn-success:active,
233
+ .btn.btn-success.hover {
234
+ color:#ffffff;
235
+ background-color: #008d4c;
236
+ }
237
+ .btn.btn-info {
238
+ color:#ffffff;
239
+ background-color: #00c0ef;
240
+ border-color: #00acd6;
241
+ }
242
+ .btn.btn-info:hover,
243
+ .btn.btn-info:active,
244
+ .btn.btn-info.hover {
245
+ color:#ffffff;
246
+ background-color: #00acd6;
247
+ }
248
+ .btn.btn-danger {
249
+ color:#ffffff;
250
+ background-color: #f56954;
251
+ border-color: #f4543c;
252
+ }
253
+ .btn.btn-danger:hover,
254
+ .btn.btn-danger:active,
255
+ .btn.btn-danger.hover {
256
+ color:#ffffff;
257
+ background-color: #f4543c;
258
+ }
259
+ .btn.btn-warning {
260
+ color:#ffffff;
261
+ background-color: #f39c12;
262
+ border-color: #e08e0b;
263
+ }
264
+ .btn.btn-warning:hover,
265
+ .btn.btn-warning:active,
266
+ .btn.btn-warning.hover {
267
+ color:#ffffff;
268
+ background-color: #e08e0b;
269
+ }
270
+ .btn.btn-flat {
271
+ -webkit-border-radius: 0;
272
+ -moz-border-radius: 0;
273
+ border-radius: 0;
274
+ -webkit-box-shadow: none;
275
+ -moz-box-shadow: none;
276
+ box-shadow: none;
277
+ border-width: 1px;
278
+ }
279
+ .btn:active {
280
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
281
+ -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
282
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
283
+ }
284
+ .btn:focus {
285
+ outline: none;
286
+ }
287
+ .btn.btn-file {
288
+ position: relative;
289
+ width: 120px;
290
+ height: 35px;
291
+ overflow: hidden;
292
+ }
293
+ .btn.btn-file > input[type='file'] {
294
+ display: block !important;
295
+ width: 100% !important;
296
+ height: 35px !important;
297
+ opacity: 0 !important;
298
+ position: absolute;
299
+ top: -10px;
300
+ cursor: pointer;
301
+ }
302
+ .btn.btn-app {
303
+ position: relative;
304
+ padding: 15px 5px;
305
+ margin: 0 0 10px 10px;
306
+ min-width: 80px;
307
+ height: 60px;
308
+ -webkit-box-shadow: none;
309
+ -moz-box-shadow: none;
310
+ box-shadow: none;
311
+ -webkit-border-radius: 0;
312
+ -moz-border-radius: 0;
313
+ border-radius: 0;
314
+ text-align: center;
315
+ color: #666;
316
+ border: 1px solid #ddd;
317
+ background-color: #fafafa;
318
+ font-size: 12px;
319
+ }
320
+ .btn.btn-app > .fa,
321
+ .btn.btn-app > .glyphicon,
322
+ .btn.btn-app > .ion {
323
+ font-size: 20px;
324
+ display: block;
325
+ }
326
+ .btn.btn-app:hover {
327
+ background: #f4f4f4;
328
+ color: #444;
329
+ border-color: #aaa;
330
+ }
331
+ .btn.btn-app:active,
332
+ .btn.btn-app:focus {
333
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
334
+ -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
335
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
336
+ }
337
+ .btn.btn-app > .badge {
338
+ position: absolute;
339
+ top: -3px;
340
+ right: -10px;
341
+ font-size: 10px;
342
+ font-weight: 400;
343
+ }
344
+ .btn.btn-social-old {
345
+ -webkit-box-shadow: none;
346
+ -moz-box-shadow: none;
347
+ box-shadow: none;
348
+ opacity: 0.9;
349
+ padding: 0;
350
+ }
351
+ .btn.btn-social-old > .fa {
352
+ padding: 10px 0;
353
+ width: 40px;
354
+ }
355
+ .btn.btn-social-old > .fa + span {
356
+ border-left: 1px solid rgba(255, 255, 255, 0.3);
357
+ }
358
+ .btn.btn-social-old span {
359
+ padding: 10px;
360
+ }
361
+ .btn.btn-social-old:hover {
362
+ opacity: 1;
363
+ }
364
+ .btn.btn-circle {
365
+ width: 30px;
366
+ height: 30px;
367
+ line-height: 30px;
368
+ padding: 0;
369
+ -webkit-border-radius: 50%;
370
+ -moz-border-radius: 50%;
371
+ border-radius: 50%;
372
+ }
373
+
374
+ .btn.btn-sm {
375
+ padding: 3px 10px;
376
+ font-size: 12px;
377
+ line-height: 1;
378
+ border-radius: 3px;
379
+ }
380
+
381
+ .btn-micro{
382
+ padding: 2px 5px;
383
+ font-size: 12px;
384
+ line-height: 1.5;
385
+ border-radius: 3px;
386
+ }
387
+
388
+
389
+ /*
390
+ Component: Delimiters
391
+ -------------------------
392
+ */
393
+
394
+ .delimiter{float:left;
395
+ width:100%;
396
+ margin:14px 0 14px 0;
397
+ clear:both;
398
+ }
399
+
400
+ .delimiter-red{
401
+ border:solid 3px #f56954;
402
+ }
403
+
404
+ /**
405
+ * Pagination
406
+ *
407
+ */
408
+ .stock-manager-pagination{display:block;
409
+ width:100%;
410
+ text-align:center;
411
+ margin-top:10px;
412
+ }
413
+ .stock-manager-pagination span{
414
+ margin:0 5px;
415
+ }
416
+ .stock-manager-pagination a{
417
+ margin:0 5px;
418
+ }
419
+
420
+
421
+ .stock-filter{float:left;
422
+ display:block;
423
+ width:100%;
424
+ margin-bottom:10px;
425
+ }
426
+ .stock-filter form{float:left;
427
+ margin-right:10px;
428
+ }
429
+ .stock-filter form select{height:32px;}
430
+
431
+
432
+ /**
433
+ * Search by sku
434
+ *
435
+ */
436
+ .filter-by-sku{
437
+ float:left;
438
+ width:100%;
439
+ margin:10px 0;
440
+ padding:10px 0;
441
+ border-top:solid 1px #ccc;
442
+ border-bottom:solid 1px #ccc;
443
+ }
444
+ .filter-by-sku .sku-seach-field{
445
+ float: left;
446
+ max-width: 150px;
447
+ padding: 6px;
448
+ margin-right:10px;
449
+ }
450
+ /**
451
+ * Search by title
452
+ *
453
+ */
454
+ .filter-by-title{
455
+ float:left;
456
+ width:100%;
457
+ margin:10px 0;
458
+ padding:10px 0;
459
+ border-top:solid 1px #ccc;
460
+ border-bottom:solid 1px #ccc;
461
+ }
462
+ .filter-by-title .title-seach-field{
463
+ float: left;
464
+ padding: 6px;
465
+ margin-right:10px;
466
+ }
467
+
468
+ /**
469
+ * Filter display
470
+ *
471
+ */
472
+ .filter-display{
473
+ float:left;
474
+ width:100%;
475
+ margin:10px 0;
476
+ padding:10px 0;
477
+ border-top:solid 1px #ccc;
478
+ border-bottom:solid 1px #ccc;
479
+ }
480
+
481
+ /**
482
+ * Manager navigation
483
+ *
484
+ */
485
+ .stock-manager-navigation{float:left;
486
+ width:100%;
487
+ list-style:none;
488
+ border-bottom:solid 1px #ccc;
489
+ }
490
+ .stock-manager-navigation li{float:left;
491
+ margin:0;
492
+ }
493
+ .stock-manager-navigation li span{float:left;
494
+ padding:6px 14px;
495
+ color:#cccccc;
496
+ text-decoration:none;
497
+ font-size:16px;
498
+ cursor:pointer;
499
+ }
500
+ .stock-manager-navigation li span.activ{
501
+ background:#cccccc;
502
+ border-left:solid 1px #ccc;
503
+ border-right:solid 1px #ccc;
504
+ border-top:solid 1px #ccc;
505
+ }
506
+ .stock-manager-navigation li span.activ,
507
+ .stock-manager-navigation li span:hover{
508
+ color:#000000;
509
+ }
510
+
511
+ .filter-block{display:none;}
512
+ .filter-block.active-filter{display:block;}
513
+
514
+
515
+ .line-price{ width:100px; }
516
+
517
+
518
+ .table-bordered tr td.table_name_box{
519
+ position:relative;
520
+ overflow: visible;
521
+ padding-right:30px;
522
+ }
523
+ .table_name_box .dashicons{
524
+ display:none;
525
+ position:absolute;
526
+ right:2px;
527
+ top:2px;
528
+ cursor:pointer;
529
+ color:#43b610;
530
+ }
531
+ .table_name_box:hover .dashicons{
532
+ display:block;
533
+ }
534
+ .table_name_box .item-post-title-wrap{
535
+ display:none;
536
+ position: absolute;
537
+ left: 6px;
538
+ top: 6px;
539
+ width: 350px;
540
+ z-index: 1000;
541
+ box-sizing: border-box;
542
+ padding: 10px;
543
+ background: #dddddd;
544
+ }
545
+
546
+ .table_name_box .item-post-title{
547
+ padding:8px;
548
+ }
549
+
550
+ .table_name_box .item-post-title-button{
551
+ margin-top:10px;
552
+ }
553
+ .table_name_box .item-post-title-button-close{
554
+ margin-top:10px;
555
+ margin-left:10px;
556
+ }
557
+
558
+
559
+
560
+ .item_sku_box{
561
+ position:relative;
562
+ }
563
+ .item_sku_box .dashicons{
564
+ display:none;
565
+ position:absolute;
566
+ right:2px;
567
+ top:2px;
568
+ cursor:pointer;
569
+ color:#43b610;
570
+ }
571
+ .item_sku_box:hover .dashicons{
572
+ display:block;
573
+ }
574
+ .item_sku_box .item-sku-wrap{
575
+ display:none;
576
+ position: absolute;
577
+ left: 6px;
578
+ top: 6px;
579
+ width: 350px;
580
+ z-index: 1000;
581
+ box-sizing: border-box;
582
+ padding: 10px;
583
+ background: #dddddd;
584
+ }
585
+
586
+ .item_sku_box .item-sku{
587
+ padding:8px;
588
+ }
589
+
590
+ .item_sku_box .item-sku-button{
591
+ margin-top:10px;
592
+ }
593
+ .item_sku_box .item-sku-button-close{
594
+ margin-top:10px;
595
+ margin-left:10px;
596
+ }
597
+
598
+
599
+ .item_thumbnail_box{
600
+ text-align:center;
601
+ }
602
+ .item_thumbnail_box img{
603
+ width:40px;
604
+ height:auto;
605
+ }
woocommerce-stock-manager/admin/assets/css/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
woocommerce-stock-manager/admin/assets/js/admin.js ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ( $ ) {
2
+ "use strict";
3
+
4
+ $(function () {
5
+
6
+ /**
7
+ * Fix for stupids
8
+ *
9
+ */
10
+ jQuery( '.manage_stock_select' ).on( 'change' , function(){
11
+
12
+ var id = jQuery( this ).data( 'item' );
13
+ var manage = jQuery( this ).val();
14
+
15
+ if( manage == 'no' ){
16
+
17
+ //jQuery( '.stock_status_' + id ).val( 'outofstock' );
18
+ jQuery( '.stock_status_' + id ).prop( 'disabled', false );
19
+ jQuery( '.backorders_' + id ).val( 'no' );
20
+ jQuery( '.backorders_' + id ).prop( 'disabled', 'disabled' );
21
+ jQuery( '.stock_' + id ).val( '0' );
22
+ jQuery( '.stock_' + id ).prop( 'disabled', 'disabled' );
23
+
24
+ }else{
25
+
26
+ jQuery( '.stock_status_' + id ).prop( 'disabled', 'disabled' );
27
+ jQuery( '.backorders_' + id ).prop( 'disabled', false );
28
+ jQuery( '.stock_' + id ).prop( 'disabled', false );
29
+
30
+ var data = {
31
+ 'action' : 'wsm_get_product_data',
32
+ 'productid' : id
33
+ };
34
+
35
+ jQuery.post( ajaxurl, data, function( response ) {
36
+
37
+ var result = jQuery.parseJSON( response );
38
+
39
+ //console.log( result );
40
+
41
+ if( result.stock_status ){
42
+ jQuery( '.stock_status_' + result.productid ).val( result.stock_status );
43
+ }
44
+ if( result.backorders ){
45
+ jQuery( '.backorders_' + result.productid ).val( result.backorders );
46
+ }
47
+ if( result.stock ){
48
+ jQuery( '.stock_' + result.productid ).val( result.stock );
49
+ }
50
+
51
+ });
52
+
53
+ }
54
+
55
+ });
56
+
57
+ /**
58
+ * Fix for stupids 2
59
+ *
60
+ */
61
+ jQuery( '.backorders_select' ).on( 'change' , function(){
62
+
63
+ var id = jQuery( this ).data( 'item' );
64
+ var backorders = jQuery( this ).val();
65
+
66
+ if( backorders == 'no' ){
67
+
68
+ var number = jQuery( '.stock_' + id ).val();
69
+
70
+ if( number ){
71
+ if( number > 0 ){
72
+ jQuery( '.stock_status_' + id ).val( 'instock' );
73
+ }else{
74
+ jQuery( '.stock_status_' + id ).val( 'outofstock' );
75
+ }
76
+ }else{
77
+ jQuery( '.stock_status_' + id ).val( 'outofstock' );
78
+ }
79
+
80
+ }else{
81
+
82
+ jQuery( '.stock_status_' + id ).val( 'onbackorder' );
83
+
84
+ }
85
+
86
+ });
87
+
88
+ /**
89
+ * Fix for stupids 3
90
+ *
91
+ */
92
+ jQuery( '.stock_number' ).on( 'change' , function(){
93
+
94
+ var id = jQuery( this ).data( 'item' );
95
+ var stock = jQuery( this ).val();
96
+ //console.log( stock );
97
+
98
+ if( stock ){
99
+ if( stock > 0 ){
100
+ jQuery( '.stock_status_' + id ).val( 'instock' );
101
+ }else{
102
+ var backorder = jQuery( '.backorders_' + id ).val();
103
+ if( backorder == 'no' ){
104
+ jQuery( '.stock_status_' + id ).val( 'outofstock' );
105
+ }else{
106
+ jQuery( '.stock_status_' + id ).val( 'onbackorder' );
107
+ }
108
+ }
109
+ }else{
110
+ jQuery( '.stock_status_' + id ).val( 'outofstock' );
111
+ }
112
+
113
+ });
114
+
115
+ /**
116
+ * Save single product line in stock table
117
+ *
118
+ */
119
+ jQuery('.save-product').on('click', function(){
120
+ jQuery('.lineloader').css('display','block');
121
+ var product = jQuery(this).data('product');
122
+
123
+
124
+ var sku = jQuery('.sku_' + product).val();
125
+ var manage_stock = jQuery('.manage_stock_' + product).val();
126
+ var stock_status = jQuery('.stock_status_' + product).val();
127
+ var backorders = jQuery('.backorders_' + product).val();
128
+ var stock = jQuery('.stock_' + product).val();
129
+ var regular_price = jQuery('.regular_price_' + product).val();
130
+ var sales_price = jQuery('.sales_price_' + product).val();
131
+ var weight = jQuery('.weight_' + product).val();
132
+ var tax_status = jQuery('.tax_status' + product).val();
133
+ var tax_class = jQuery('.tax_class' + product).val();
134
+ var shipping_class = jQuery('.shipping_class' + product).val();
135
+ var secure = jQuery('.wsm-ajax-nonce_' + product).val();
136
+
137
+ var data = {
138
+ action : 'save_one_product',
139
+ product : product,
140
+ sku : sku,
141
+ manage_stock : manage_stock,
142
+ stock_status : stock_status,
143
+ backorders : backorders,
144
+ stock : stock,
145
+ regular_price : regular_price,
146
+ sales_price : sales_price,
147
+ weight : weight,
148
+ tax_status : tax_status,
149
+ tax_class : tax_class,
150
+ shipping_class : shipping_class,
151
+ secure : secure
152
+ };
153
+
154
+
155
+ jQuery.post(ajaxurl, data, function(response){
156
+
157
+ jQuery('.lineloader').css('display','none');
158
+
159
+ });
160
+
161
+ });
162
+
163
+
164
+ /**
165
+ * Show variations of selected product
166
+ *
167
+ */
168
+ jQuery('.show-variable').on('click', function(){
169
+ var variable = jQuery(this).data('variable');
170
+ jQuery('.variation-item-' + variable).toggleClass('show-variations');
171
+
172
+ });
173
+
174
+
175
+ /**
176
+ * Navigation
177
+ *
178
+ */
179
+ jQuery('.stock-manager-navigation li span').on('click', function(){
180
+ jQuery('.stock-manager-navigation li span').removeClass('activ');
181
+ jQuery(this).addClass('activ');
182
+ });
183
+ jQuery('.stock-manager-navigation li span.navigation-filter-default').on('click', function(){
184
+ jQuery('.filter-block').removeClass('active-filter');
185
+ jQuery('.stock-filter').addClass('active-filter');
186
+ });
187
+ jQuery('.stock-manager-navigation li span.navigation-filter-by-sku').on('click', function(){
188
+ jQuery('.filter-block').removeClass('active-filter');
189
+ jQuery('.filter-by-sku').addClass('active-filter');
190
+ });
191
+ jQuery('.stock-manager-navigation li span.navigation-filter-by-title').on('click', function(){
192
+ jQuery('.filter-block').removeClass('active-filter');
193
+ jQuery('.filter-by-title').addClass('active-filter');
194
+ });
195
+ jQuery('.stock-manager-navigation li span.navigation-filter-display').on('click', function(){
196
+ jQuery('.filter-block').removeClass('active-filter');
197
+ jQuery('.filter-display').addClass('active-filter');
198
+ });
199
+
200
+
201
+ //Open box for product title saving
202
+ jQuery('.table_name_box .dashicons').on('click', function(){
203
+ var item = jQuery(this).data('item');
204
+ jQuery('.item-post-title-wrap-'+item).css('display','block');
205
+ });
206
+ //Close box for product title saving
207
+ jQuery('.item-post-title-button-close').on('click', function(){
208
+ jQuery(this).parent().css('display', 'none');
209
+ });
210
+ //Save product title
211
+ jQuery('.item-post-title-button').on('click', function(ajax_object){
212
+
213
+ var item = jQuery(this).data('item');
214
+ var title = jQuery('.item-post-title-'+item).val();
215
+ var data = {
216
+ action : 'wsm_save_title_product',
217
+ item : item,
218
+ title : title,
219
+ secure : ajax_object.ajax_nonce
220
+ };
221
+ jQuery('.item-post-title-'+item).val(title);
222
+ jQuery('.item-post-link-'+item).text(title);
223
+
224
+ jQuery.post(ajaxurl, data, function(response, item, title){
225
+ jQuery('.item-post-title-wrap-'+response).css('display', 'none');
226
+ });
227
+
228
+ });
229
+
230
+
231
+
232
+ //Open box for sku saving
233
+ jQuery('.item_sku_box .dashicons').on('click', function(){
234
+ var item = jQuery(this).data('item');
235
+ jQuery('.item-sku-wrap-'+item).css('display','block');
236
+ });
237
+ //Close box for sku saving
238
+ jQuery('.item-sku-button-close').on('click', function(){
239
+ jQuery(this).parent().css('display', 'none');
240
+ });
241
+ //Save sku
242
+ jQuery('.item-sku-button').on('click', function(ajax_object){
243
+
244
+ var item = jQuery(this).data('item');
245
+ var sku = jQuery('.sku_'+item).val();
246
+ var data = {
247
+ action : 'wsm_save_sku',
248
+ item : item,
249
+ sku : sku,
250
+ secure : ajax_object.ajax_nonce
251
+ };
252
+ jQuery('.sku_-'+item).val(sku);
253
+ jQuery('.item-sku-text-'+item).text(sku);
254
+
255
+ jQuery.post(ajaxurl, data, function(response, item, sku){
256
+ jQuery('.item-sku-wrap-'+response).css('display', 'none');
257
+ });
258
+
259
+ });
260
+
261
+
262
+ });
263
+
264
+ }(jQuery));
woocommerce-stock-manager/admin/assets/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
woocommerce-stock-manager/admin/class-stock-manager-admin.php ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WooCommerce Stock Manager
4
+ * @author Vladislav Musílek
5
+ * @license GPL-2.0+
6
+ * @link http:/toret.cz
7
+ * @copyright 2015 Toret.cz
8
+ */
9
+
10
+ class Stock_Manager_Admin {
11
+
12
+ /**
13
+ * Instance of this class.
14
+ *
15
+ * @since 1.0.0
16
+ *
17
+ * @var object
18
+ */
19
+ protected static $instance = null;
20
+
21
+ /**
22
+ * Slug of the plugin screen.
23
+ *
24
+ * @since 1.0.0
25
+ *
26
+ * @var string
27
+ */
28
+ protected $plugin_screen_hook_suffix = null;
29
+
30
+ /**
31
+ * Initialize the plugin by loading admin scripts & styles and adding a
32
+ * settings page and menu.
33
+ *
34
+ * @since 1.0.0
35
+ */
36
+ private function __construct() {
37
+
38
+ $plugin = Stock_Manager::get_instance();
39
+ $this->plugin_slug = $plugin->get_plugin_slug();
40
+
41
+ // Load admin style sheet and JavaScript.
42
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
43
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
44
+
45
+ // Add the options page and menu item.
46
+ add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
47
+
48
+ add_action( 'admin_init', array( $this, 'output_buffer' ) );
49
+
50
+ include_once( 'includes/wcm-class-stock.php' );
51
+ include_once( 'includes/wcm-class-table.php' );
52
+
53
+
54
+ //$this->includes();
55
+
56
+ add_action( 'admin_init', array( $this, 'generate_csv_file' ) );
57
+
58
+
59
+
60
+ }
61
+
62
+ /**
63
+ * Return an instance of this class.
64
+ *
65
+ * @since 1.0.0
66
+ *
67
+ * @return object A single instance of this class.
68
+ */
69
+ public static function get_instance() {
70
+
71
+ // If the single instance hasn't been set, set it now.
72
+ if ( null == self::$instance ) {
73
+ self::$instance = new self;
74
+ }
75
+
76
+ return self::$instance;
77
+ }
78
+
79
+ /**
80
+ * Include required core files used in admin.
81
+ *
82
+ * @since 1.0.0
83
+ */
84
+ private function includes() {
85
+ //if( isset( $_GET['page'] ) && ( $_GET['page'] == 'stock-manager' || $_GET['page'] == 'stock-manager-import-export' ) ){
86
+
87
+ //}
88
+
89
+ }
90
+
91
+ /**
92
+ * Get stock class
93
+ * @return WCM_Stock
94
+ *
95
+ * @since 1.0.0
96
+ */
97
+ public function stock() {
98
+ return WCM_Stock::get_instance();
99
+
100
+
101
+ }
102
+
103
+ /**
104
+ * Register and enqueue admin-specific CSS.
105
+ * @since 1.0.0
106
+ *
107
+ * @return null Return early if no settings page is registered.
108
+ */
109
+ public function enqueue_admin_styles() {
110
+ if( isset( $_GET['page'] ) && ( $_GET['page'] == 'stock-manager' || $_GET['page'] == 'stock-manager-import-export' ) ){
111
+ wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array(), Stock_Manager::VERSION );
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Register and enqueue admin-specific JavaScript.
117
+ * @since 1.0.0
118
+ *
119
+ * @return null Return early if no settings page is registered.
120
+ */
121
+ public function enqueue_admin_scripts() {
122
+ if( isset( $_GET['page'] ) && ( $_GET['page'] == 'stock-manager' || $_GET['page'] == 'stock-manager-import-export' ) ){
123
+
124
+ $params = array(
125
+ 'ajax_nonce' => wp_create_nonce('wsm_update'),
126
+ );
127
+ wp_localize_script( $this->plugin_slug . '-admin-script', 'ajax_object', $params );
128
+ wp_enqueue_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery' ), Stock_Manager::VERSION );
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Register the administration menu for this plugin into the WordPress Dashboard menu.
134
+ *
135
+ * @since 1.0.0
136
+ */
137
+ public function add_plugin_admin_menu() {
138
+
139
+ $value = 'manage_woocommerce';
140
+
141
+ $manage = apply_filters( 'stock_manager_manage', $value );
142
+
143
+ add_menu_page(
144
+ __( 'WooCommerce Stock Manager', $this->plugin_slug ),
145
+ __( 'WooCommerce Stock Manager', $this->plugin_slug ),
146
+ $manage,
147
+ 'stock-manager',
148
+ array( $this, 'display_plugin_admin_page' ),
149
+ 'dashicons-book-alt'
150
+ );
151
+
152
+ add_submenu_page(
153
+ 'stock-manager',
154
+ __( 'Import/Export', $this->plugin_slug ),
155
+ __( 'Import/Export', $this->plugin_slug ),
156
+ $manage,
157
+ 'stock-manager-import-export',
158
+ array( $this, 'display_import_export_page' )
159
+ );
160
+
161
+ add_submenu_page(
162
+ 'stock-manager',
163
+ __( 'Setting', $this->plugin_slug ),
164
+ __( 'Setting', $this->plugin_slug ),
165
+ $manage,
166
+ 'stock-manager-setting',
167
+ array( $this, 'display_setting_page' )
168
+ );
169
+
170
+ }
171
+
172
+ /**
173
+ * Render the settings page for this plugin.
174
+ *
175
+ * @since 1.0.0
176
+ */
177
+ public function display_plugin_admin_page() {
178
+ include_once( 'views/admin.php' );
179
+ }
180
+ /**
181
+ * Render the impoer export page for this plugin.
182
+ *
183
+ * @since 1.0.0
184
+ */
185
+
186
+ public function display_import_export_page() {
187
+ include_once( 'views/import-export.php' );
188
+ }
189
+
190
+ /**
191
+ * Render the setting page for this plugin.
192
+ *
193
+ * @since 1.2.2
194
+ */
195
+ public function display_setting_page() {
196
+ include_once( 'views/setting.php' );
197
+ }
198
+
199
+ /**
200
+ * Add settings action link to the plugins page.
201
+ *
202
+ * @since 1.0.0
203
+ */
204
+ public function add_action_links( $links ) {
205
+
206
+ return array_merge(
207
+ array(
208
+ 'settings' => '<a href="' . admin_url( 'admin.php?page=stock-manager' ) . '">' . __( 'Settings', $this->plugin_slug ) . '</a>'
209
+ ),
210
+ $links
211
+ );
212
+
213
+ }
214
+
215
+ /**
216
+ * Create csv array and download cvs file
217
+ *
218
+ * @since 1.0.0
219
+ */
220
+ public function stock_convert_to_csv($input_array, $output_file_name, $delimiter){
221
+
222
+ $temp_memory = fopen('php://memory', 'w');
223
+
224
+ foreach ($input_array as $line) {
225
+ fputcsv($temp_memory, $line, $delimiter);
226
+ }
227
+ fseek($temp_memory, 0);
228
+
229
+ header('Content-Type: application/csv');
230
+ header('Content-Disposition: attachement; filename="' . $output_file_name . '";');
231
+
232
+ fpassthru($temp_memory);
233
+ exit();
234
+ }
235
+
236
+
237
+ /**
238
+ * Generate csv data
239
+ *
240
+ * @since 1.0.0
241
+ */
242
+ public function generate_csv_file(){
243
+
244
+ if(isset($_GET['action']) && $_GET['action'] == 'export'){
245
+
246
+ $stock = $this->stock();
247
+
248
+ $array_to_csv = array();
249
+ //First line
250
+ $array_to_csv[] = array('id','sku','Product name','Manage stock','Stock status','Backorders','Stock','Type','Parent ID');
251
+
252
+ $products = $stock->get_products_for_export();
253
+
254
+ foreach( $products as $item ){
255
+ $product_meta = get_post_meta($item->ID);
256
+ $item_product = wc_get_product($item->ID);
257
+ $product_type = $item_product->get_type();
258
+ $id = $item->ID;
259
+ if(!empty($product_meta['_sku'][0])){ $sku = $product_meta['_sku'][0]; }else{ $sku = ''; }
260
+ $product_name = $item->post_title;
261
+ if(!empty($product_meta['_manage_stock'][0])){ $manage_stock = $product_meta['_manage_stock'][0]; }else{ $manage_stock = ''; }
262
+ if(!empty($product_meta['_stock_status'][0])){ $stock_status = $product_meta['_stock_status'][0]; }else{ $stock_status = ''; }
263
+ if(!empty($product_meta['_backorders'][0])){ $backorders = $product_meta['_backorders'][0]; }else{ $backorders = ''; }
264
+ if(!empty($product_meta['_stock'][0])){ $stock = $product_meta['_stock'][0]; }else{ $stock = '0'; }
265
+ if($product_type == 'variable'){ $product_type = 'variable'; }else{ $product_type = 'simple'; }
266
+
267
+ $array_to_csv[] = array($id,$sku,$product_name,$manage_stock,$stock_status,$backorders,$stock,$product_type,'');
268
+
269
+ if($product_type == 'variable'){
270
+ $args = array(
271
+ 'post_parent' => $item->ID,
272
+ 'post_type' => 'product_variation',
273
+ 'numberposts' => -1,
274
+ 'post_status' => 'publish'
275
+ );
276
+ $variations_array = get_children( $args );
277
+ foreach($variations_array as $vars){
278
+
279
+ $var_meta = get_post_meta($vars->ID);
280
+ $item_product = wc_get_product($vars->ID);
281
+
282
+ $id = $vars->ID;
283
+ if(!empty($var_meta['_sku'][0])){ $sku = $var_meta['_sku'][0]; }else{ $sku = ''; }
284
+ $product_name = '';
285
+ foreach($item_product->variation_data as $k => $v){
286
+ $tag = get_term_by('slug', $v, str_replace('attribute_','',$k));
287
+ if($tag == false ){
288
+ $product_name .= $v.' ';
289
+ }else{
290
+ if(is_array($tag)){
291
+ $product_name .= $tag['name'].' ';
292
+ }else{
293
+ $product_name .= $tag->name.' ';
294
+ }
295
+ }
296
+ }
297
+
298
+ if(!empty($var_meta['_manage_stock'][0])){ $manage_stock = $var_meta['_manage_stock'][0]; }else{ $manage_stock = ''; }
299
+ if(!empty($var_meta['_stock_status'][0])){ $stock_status = $var_meta['_stock_status'][0]; }else{ $stock_status = ''; }
300
+ if(!empty($var_meta['_backorders'][0])){ $backorders = $var_meta['_backorders'][0]; }else{ $backorders = ''; }
301
+ if(!empty($var_meta['_stock'][0])){ $stock = $var_meta['_stock'][0]; }else{ $stock = '0'; }
302
+ $product_type = 'product-variant';
303
+ $parent_id = $item->ID;
304
+
305
+ $array_to_csv[] = array($id,$sku,$product_name,$manage_stock,$stock_status,$backorders,$stock,$product_type,$parent_id);
306
+
307
+ }
308
+ }
309
+ }
310
+
311
+
312
+ $this->stock_convert_to_csv($array_to_csv, 'stock-manager-export.csv', ';');
313
+
314
+ }
315
+ }
316
+
317
+ /**
318
+ * Headers allready sent fix
319
+ *
320
+ */
321
+ public function output_buffer() {
322
+ ob_start();
323
+ }
324
+
325
+
326
+ }//End class
woocommerce-stock-manager/admin/includes/config.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = array(
4
+ 'sku' => array(
5
+ 'type' => 'optional',
6
+ 'name' => __( 'SKU', 'woocommerce-stock-manager' ),
7
+ 'calback' => 'sku_box'
8
+ ),
9
+ 'product_id' => array(
10
+ 'type' => 'optional',
11
+ 'name' => __( 'ID', 'woocommerce-stock-manager' ),
12
+ 'calback' => 'id_box'
13
+ ),
14
+ 'sku' => array(
15
+ 'type' => 'optional',
16
+ 'name' => __( 'SKU', 'woocommerce-stock-manager' ),
17
+ 'calback' => 'sku_box'
18
+ ),
19
+ 'sku' => array(
20
+ 'type' => 'optional',
21
+ 'name' => __( 'SKU', 'woocommerce-stock-manager' ),
22
+ 'calback' => 'sku_box'
23
+ ),
24
+ 'sku' => array(
25
+ 'type' => 'optional',
26
+ 'name' => __( 'SKU', 'woocommerce-stock-manager' ),
27
+ 'calback' => 'sku_box'
28
+ ),
29
+ 'sku' => array(
30
+ 'type' => 'optional',
31
+ 'name' => __( 'SKU', 'woocommerce-stock-manager' ),
32
+ 'calback' => 'sku_box'
33
+ ),
34
+ );
woocommerce-stock-manager/admin/includes/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+
woocommerce-stock-manager/admin/includes/wcm-class-save.php ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WooCommerce Stock Manager
4
+ * @author Vladislav Musílek
5
+ * @license GPL-2.0+
6
+ * @link http:/toret.cz
7
+ * @copyright 2018 Toret.cz
8
+ */
9
+
10
+ class WCM_Save {
11
+
12
+ /**
13
+ * Save data for one product
14
+ *
15
+ * @since 1.2.2
16
+ */
17
+ public static function save_one( $data, $product_id ){
18
+
19
+ $values = self::prepare_one_data( $data );
20
+
21
+ if( !empty( $values ) ){
22
+
23
+ self::save_data( $values, $product_id );
24
+
25
+ }
26
+
27
+ }
28
+
29
+ /**
30
+ * Save data for one item (usedn in foreach, for save all button)
31
+ *
32
+ * @since 1.2.2
33
+ */
34
+ public static function save_one_item( $data, $product_id ){
35
+
36
+ $values = self::prepare_data( $data, $product_id );
37
+
38
+ if( !empty( $values ) ){
39
+
40
+ self::save_data( $values, $product_id );
41
+
42
+ }
43
+
44
+ }
45
+
46
+ /**
47
+ * Prepare data
48
+ *
49
+ * @since 1.2.2
50
+ */
51
+ public static function prepare_data( $data, $item ){
52
+
53
+ $values = array();
54
+ $defaults = self::get_default();
55
+
56
+ foreach( $defaults as $default ){
57
+
58
+ if( isset( $data[$default][$item] ) ) {
59
+
60
+ $values[$default] = sanitize_text_field( $data[$default][$item] );
61
+
62
+ }
63
+
64
+ }
65
+
66
+ return $values;
67
+
68
+ }
69
+
70
+ /**
71
+ * Prepare one data
72
+ *
73
+ * @since 1.2.2
74
+ */
75
+ public static function prepare_one_data( $data ){
76
+
77
+ $values = array();
78
+
79
+ $defaults = self::get_default();
80
+
81
+ foreach( $defaults as $default ){
82
+
83
+ if( isset( $data[$default] ) ) {
84
+
85
+ $values[$default] = sanitize_text_field( $data[$default] );
86
+
87
+ }
88
+
89
+ }
90
+
91
+ return $values;
92
+
93
+
94
+ }
95
+
96
+ /**
97
+ * Get default
98
+ *
99
+ * @since 1.2.2
100
+ */
101
+ public static function get_default(){
102
+
103
+ $values = array(
104
+ 'sku',
105
+ 'manage_stock',
106
+ 'backorders',
107
+ 'stock_status',
108
+ 'stock',
109
+ 'tax_status',
110
+ 'tax_class',
111
+ 'shipping_class',
112
+ 'weight',
113
+ 'regular_price',
114
+ 'sales_price',
115
+ );
116
+
117
+ return $values;
118
+
119
+ }
120
+
121
+ /**
122
+ * Save data
123
+ *
124
+ * @since 1.2.2
125
+ */
126
+ public static function save_data( $data, $product_id ){
127
+
128
+ $display_option = get_option( 'wsm_display_option' );
129
+
130
+ $_product = wc_get_product( $product_id );
131
+
132
+ if( isset( $data['sku'] ) ) {
133
+ $_product->set_sku( $data['sku'] );
134
+ }
135
+ if(!empty( $display_option['manage_stock'] ) && $display_option['manage_stock'] == 'display' ){
136
+ if( isset( $data['manage_stock'] ) ) {
137
+ $_product->set_manage_stock( $data['manage_stock'] );
138
+ }
139
+ }
140
+ if(!empty( $display_option['backorders'] ) && $display_option['backorders'] == 'display' ){
141
+ if( isset( $data['backorders'] ) ) {
142
+ $_product->set_backorders( $data['backorders'] );
143
+ }
144
+ }
145
+ if(!empty( $display_option['stock_status'] ) && $display_option['stock_status'] == 'display' ){
146
+ if( isset( $data['stock_status'] ) ) {
147
+ $_product->set_stock_status( $data['stock_status'] );
148
+ }
149
+ }
150
+ if(!empty( $display_option['stock'] ) && $display_option['stock'] == 'display' ){
151
+ if( isset( $data['stock'] ) ) {
152
+ $_product->set_stock_quantity( $data['stock'] );
153
+ }
154
+ }
155
+
156
+ if(!empty( $display_option['tax_status'] ) && $display_option['tax_status'] == 'display' ){
157
+ if( isset( $data['tax_status'] ) ) {
158
+ $_product->set_tax_status( $data['tax_status'] );
159
+ }
160
+ }
161
+ if(!empty( $display_option['tax_class'] ) && $display_option['tax_class'] == 'display' ){
162
+ if( isset( $data['tax_class'] ) ) {
163
+ $_product->set_tax_class( $data['tax_class'] );
164
+ }
165
+ }
166
+ if(!empty( $display_option['shipping_class'] ) && $display_option['shipping_class'] == 'display' ){
167
+ if( isset( $data['shipping_class'] ) ) {
168
+ $_product->set_shipping_class_id( $data['shipping_class'] );
169
+ }
170
+ }
171
+ if(!empty( $display_option['weight'] ) && $display_option['weight'] == 'display' ){
172
+ if( isset( $data['weight'] ) ){
173
+ $_product->set_weight( $data['weight'] );
174
+ }else{
175
+ $_product->set_weight( '' );
176
+ }
177
+ }
178
+
179
+ /* if( !empty( $data['regular_price'] ) ){
180
+ $price = sanitize_text_field($data['regular_price']);
181
+ if( !empty( $data['sales_price'] ) ){
182
+ $sale_price = sanitize_text_field($data['sales_price']);
183
+ wsm_save_price( $product_id, $price, $sale_price );
184
+ }else{
185
+ wsm_save_price( $product_id, $price );
186
+ }
187
+ }
188
+ */
189
+ if(!empty( $display_option['price'] ) && $display_option['price'] == 'display' ){
190
+ if( !empty( $data['regular_price'] ) ){
191
+ $_product->set_price( $data['regular_price'] );
192
+ $_product->set_regular_price( $data['regular_price'] );
193
+ }else{
194
+ $_product->set_price( '' );
195
+ $_product->set_regular_price( '' );
196
+ }
197
+ }
198
+ if(!empty( $display_option['sales_price'] ) && $display_option['sales_price'] == 'display' ){
199
+ if( !empty( $data['sales_price'] ) ){
200
+ $_product->set_sale_price( $data['sales_price'] );
201
+ }else{
202
+ $_product->set_sale_price( '' );
203
+ }
204
+ }
205
+ $_product->save();
206
+
207
+ wc_delete_product_transients( $product_id );
208
+
209
+ }
210
+
211
+
212
+ }//End class
woocommerce-stock-manager/admin/includes/wcm-class-stock.php ADDED
@@ -0,0 +1,472 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WooCommerce Stock Manager
4
+ * @author Vladislav Musílek
5
+ * @license GPL-2.0+
6
+ * @link http:/toret.cz
7
+ * @copyright 2015 Toret.cz
8
+ */
9
+
10
+ class WCM_Stock {
11
+
12
+ /**
13
+ * Instance of this class.
14
+ *
15
+ * @since 1.0.0
16
+ *
17
+ * @var object
18
+ */
19
+ protected static $instance = null;
20
+
21
+ /**
22
+ * Constructor for the stock class.
23
+ *
24
+ * @since 1.0.0
25
+ */
26
+ public $limit = 100;
27
+
28
+
29
+ /**
30
+ * Constructor for the stock class.
31
+ *
32
+ * @since 1.0.0
33
+ */
34
+ private function __construct() {
35
+
36
+ $limit = get_option( 'woocommerce_stock_limit' );
37
+ if( !empty( $limit ) ){
38
+ $this->limit = $limit;
39
+ }
40
+
41
+ }
42
+
43
+ /**
44
+ * Return an instance of this class.
45
+ *
46
+ * @since 1.0.0
47
+ *
48
+ * @return object A single instance of this class.
49
+ */
50
+ public static function get_instance() {
51
+
52
+
53
+
54
+ // If the single instance hasn't been set, set it now.
55
+ if ( null == self::$instance ) {
56
+ self::$instance = new self;
57
+ }
58
+
59
+ return self::$instance;
60
+ }
61
+
62
+
63
+ /**
64
+ * Return products
65
+ *
66
+ *
67
+ * @since 1.0.0
68
+ */
69
+ public function get_products($data = array()){
70
+
71
+ if( isset( $_GET['sku'] ) ){
72
+ return $this->get_product_by_sku( $_GET['sku'] );
73
+ }
74
+
75
+ if( isset( $_GET['product-title'] ) ){
76
+ return $this->get_product_by_product_title( $_GET['product-title'] );
77
+ }
78
+
79
+ $args = array();
80
+ $args['post_type'] = 'product';
81
+
82
+ //Inicialize tax_query array
83
+ if( !empty( $_GET['product-type'] ) || !empty( $_GET['product-category'] ) ){
84
+ $args['tax_query'] = array();
85
+
86
+
87
+ if(isset($_GET['product-type'])){
88
+ if($_GET['product-type'] == 'variable'){
89
+
90
+ $args['tax_query'][] = array(
91
+ 'taxonomy' => 'product_type',
92
+ 'terms' => 'variable',
93
+ 'field' => 'slug'
94
+
95
+ );
96
+
97
+ }else{
98
+
99
+ $args['tax_query'] = array(
100
+ 'taxonomy' => 'product_type',
101
+ 'terms' => 'simple',
102
+ 'field' => 'slug'
103
+ );
104
+ }
105
+
106
+ }
107
+
108
+
109
+
110
+ /**
111
+ * Product category filter
112
+ */
113
+ if( isset( $_GET['product-category'] ) ){
114
+ if( $_GET['product-category'] != 'all' ){
115
+
116
+ $category = $_GET['product-category'];
117
+
118
+ $args['tax_query'][] = array(
119
+ 'taxonomy' => 'product_cat',
120
+ 'terms' => $category,
121
+ 'field' => 'term_id'
122
+ );
123
+ }
124
+ }
125
+
126
+ }
127
+
128
+ //Inicialize meta_query array
129
+ if( !empty( $_GET['stock-status'] ) || !empty( $_GET['manage-stock'] ) ){
130
+ $args['meta_query'] = array();
131
+
132
+
133
+ if(!empty($_GET['stock-status'])){
134
+ $status = $_GET['stock-status'];
135
+
136
+ $args['meta_query'][] = array(
137
+ 'key' => '_stock_status',
138
+ 'value' => $status,
139
+ 'compare' => '=',
140
+ );
141
+
142
+ }
143
+
144
+ if(!empty($_GET['manage-stock'])){
145
+ $manage = $_GET['manage-stock'];
146
+
147
+ $args['meta_query'][] = array(
148
+ 'key' => '_manage_stock',
149
+ 'value' => $manage,
150
+ 'compare' => '=',
151
+ );
152
+
153
+ }
154
+ }
155
+
156
+ if(isset($_GET['order-by'])){
157
+ $order_by = $_GET['order-by'];
158
+
159
+ if( $order_by == 'name-asc' ){
160
+
161
+ $args['orderby'] = 'title';
162
+ $args['order'] = 'ASC';
163
+
164
+ }
165
+ elseif( $order_by == 'name-desc' ){
166
+
167
+ $args['orderby'] = 'title';
168
+ $args['order'] = 'DESC';
169
+
170
+ }
171
+ elseif( $order_by == 'sku-asc' ){
172
+
173
+ $args['meta_key'] = '_sku';
174
+ $args['orderby'] = 'meta_value';
175
+ $args['order'] = 'ASC';
176
+
177
+ }
178
+ elseif( $order_by == 'sku-desc' ){
179
+
180
+ $args['meta_key'] = '_sku';
181
+ $args['orderby'] = 'meta_value';
182
+ $args['order'] = 'DESC';
183
+
184
+ }
185
+
186
+
187
+ }
188
+
189
+
190
+ $args['posts_per_page'] = $this->limit;
191
+
192
+
193
+ if(!empty($_GET['offset'])){
194
+ $offset = $_GET['offset'] - 1;
195
+ $offset = $offset * $this->limit;
196
+ $args['offset'] = $offset;
197
+
198
+ }
199
+
200
+
201
+ $the_query = new WP_Query( $args );
202
+
203
+ return $the_query;
204
+ }
205
+
206
+ /**
207
+ * Return all products
208
+ *
209
+ *
210
+ * @since 1.0.0
211
+ */
212
+ public function get_all_products(){
213
+
214
+
215
+
216
+
217
+ $args = array();
218
+
219
+ if(isset($_GET['product-type'])){
220
+ if($_GET['product-type'] == 'variable'){
221
+ $args['post_type'] = 'product';
222
+
223
+ $args['tax_query'] = array(
224
+ array(
225
+ 'taxonomy' => 'product_type',
226
+ 'terms' => 'variable',
227
+ 'field' => 'slug'
228
+ )
229
+ );
230
+
231
+ }else{
232
+ $args['post_type'] = 'product';
233
+ $args['tax_query'] = array(
234
+ array(
235
+ 'taxonomy' => 'product_type',
236
+ 'terms' => 'simple',
237
+ 'field' => 'slug'
238
+ )
239
+ );
240
+ }
241
+ }else{
242
+ $args['post_type'] = 'product';
243
+ }
244
+
245
+
246
+ /**
247
+ * Product category filter
248
+ */
249
+ if(isset($_GET['product-category'])){
250
+ if($_GET['product-category'] != 'all'){
251
+
252
+ $category = $_GET['product-category'];
253
+
254
+ $args['tax_query'] = array(
255
+ array(
256
+ 'taxonomy' => 'product_cat',
257
+ 'terms' => $category,
258
+ 'field' => 'term_id'
259
+ )
260
+ );
261
+ }
262
+ }
263
+
264
+ if(isset($_GET['stock-status'])){
265
+ $status = $_GET['stock-status'];
266
+
267
+ $args['meta_key'] = '_stock_status';
268
+ $args['meta_value'] = $status;
269
+ }
270
+
271
+ if(isset($_GET['manage-stock'])){
272
+ $manage = $_GET['manage-stock'];
273
+
274
+ $args['meta_key'] = '_manage_stock';
275
+ $args['meta_value'] = $manage;
276
+ }
277
+
278
+
279
+
280
+
281
+
282
+ $args['posts_per_page'] = -1;
283
+
284
+
285
+ $the_query = new WP_Query( $args );
286
+
287
+ return $the_query->posts;
288
+ }
289
+
290
+ /**
291
+ * Return all products
292
+ *
293
+ *
294
+ * @since 1.0.0
295
+ */
296
+ public function get_products_for_export(){
297
+
298
+ $args = array();
299
+ $args['post_type'] = 'product';
300
+ $args['posts_per_page'] = -1;
301
+
302
+ $the_query = new WP_Query( $args );
303
+
304
+ return $the_query->posts;
305
+ }
306
+
307
+ /**
308
+ * Return pagination
309
+ *
310
+ */
311
+ public function pagination( $query ){
312
+
313
+ if( isset( $_GET['sku'] ) ){ return false; }
314
+
315
+ $all = $query->found_posts;
316
+
317
+ $pages = ceil($all / $this->limit);
318
+ if( !empty( $_GET['offset'] ) ){
319
+ $current = $_GET['offset'];
320
+ }else{
321
+ $current = 1;
322
+ }
323
+
324
+ $html = '';
325
+ $html .= '<div class="stock-manager-pagination">';
326
+ $query_string = $_SERVER['QUERY_STRING'];
327
+ if($pages != 1){
328
+
329
+ for ($i=1; $i <= $pages; $i++){
330
+ if($current == $i){
331
+ $html .= '<span class="btn btn-default">'.$i.'</span>';
332
+ }else{
333
+ $html .= '<a class="btn btn-primary" href="'.admin_url().'admin.php?'.$query_string.'&offset='.$i.'">'.$i.'</a>';
334
+ }
335
+ }
336
+
337
+ }
338
+
339
+ $html .= '</div>';
340
+
341
+ return $html;
342
+ }
343
+
344
+ /**
345
+ * Save all meta data
346
+ *
347
+ */
348
+ public function save_all( $data ){
349
+
350
+ foreach( $data['product_id'] as $key => $item ){
351
+
352
+ $product_id = sanitize_text_field( $item );
353
+
354
+ WCM_Save::save_one_item( $_POST, $product_id );
355
+
356
+ }
357
+ }
358
+
359
+ /**
360
+ * Save all meta data
361
+ *
362
+ */
363
+ public function save_filter_display($data){
364
+
365
+ $option = array();
366
+
367
+ if( !empty( $data['thumbnail'] ) ){ $option['thumbnail'] = 'display'; }else{ $option['thumbnail'] = 'no'; }
368
+ if( !empty( $data['price'] ) ){ $option['price'] = 'display'; }else{ $option['price'] = 'no'; }
369
+ if( !empty( $data['sales_price'] ) ){ $option['sales_price'] = 'display'; }else{ $option['sales_price'] = 'no'; }
370
+ if( !empty( $data['weight'] ) ){ $option['weight'] = 'display'; }else{ $option['weight'] = 'no'; }
371
+ if( !empty( $data['manage_stock'] ) ){ $option['manage_stock'] = 'display'; }else{ $option['manage_stock'] = 'no'; }
372
+ if( !empty( $data['stock_status'] ) ){ $option['stock_status'] = 'display'; }else{ $option['stock_status'] = 'no'; }
373
+ if( !empty( $data['backorders'] ) ){ $option['backorders'] = 'display'; }else{ $option['backorders'] = 'no'; }
374
+ if( !empty( $data['stock'] ) ){ $option['stock'] = 'display'; }else{ $option['stock'] = 'no'; }
375
+ if( !empty( $data['tax_status'] ) ){ $option['tax_status'] = 'display'; }else{ $option['tax_status'] = 'no'; }
376
+ if( !empty( $data['tax_class'] ) ){ $option['tax_class'] = 'display'; }else{ $option['tax_class'] = 'no'; }
377
+ if( !empty( $data['shipping_class'] ) ){ $option['shipping_class'] = 'display'; }else{ $option['shipping_class'] = 'no'; }
378
+
379
+
380
+ if( !empty( $option ) ){
381
+ update_option( 'wsm_display_option', $option );
382
+ }
383
+
384
+
385
+ }
386
+
387
+ /**
388
+ *
389
+ * Get prduct categories
390
+ *
391
+ */
392
+ public function products_categories($selected = null){
393
+ $out = '';
394
+
395
+
396
+
397
+
398
+ $terms = get_terms(
399
+ 'product_cat',
400
+ array(
401
+ 'hide_empty' => 0,
402
+ 'orderby' => 'ASC'
403
+ )
404
+ );
405
+ if(count($terms) > 0)
406
+ {
407
+ foreach ($terms as $term)
408
+ {
409
+ if(!empty($selected) && $selected == $term->term_id){ $sel = 'selected="selected"'; }else{ $sel = ''; }
410
+ $out .= '<option value="'.$term->term_id.'" '.$sel.'>'.$term->name.'</option>';
411
+ }
412
+ return $out;
413
+ }
414
+ return;
415
+ }
416
+
417
+ /**
418
+ * Get products by sku
419
+ *
420
+ */
421
+ private function get_product_by_sku( $sku ){
422
+ $args = array();
423
+ $args['post_type'] = array( 'product', 'product_variation' );
424
+ $args['meta_query'] = array(
425
+ array(
426
+ 'key' => '_sku',
427
+ 'value' => $sku,
428
+ 'compare' => 'LIKE'
429
+ )
430
+ );
431
+ $args['posts_per_page'] = $this->limit;
432
+
433
+ $the_query = new WP_Query( $args );
434
+
435
+ return $the_query;
436
+
437
+ }
438
+
439
+ /**
440
+ * Get products by sku
441
+ *
442
+ */
443
+ private function get_product_by_product_title( $title ){
444
+
445
+ add_filter( 'posts_search', 'wsm_search_by_title_only', 500, 2 );
446
+
447
+ $args = array();
448
+ $args['post_type'] = 'product';
449
+ $args['s'] = $title;
450
+ $args['post_status'] = 'publish';
451
+ $args['orderby'] = 'title';
452
+ $args['order'] = 'ASC';
453
+ $args['posts_per_page'] = $this->limit;
454
+
455
+ if( !empty( $_GET['offset'] ) ){
456
+ $offset = $_GET['offset'] - 1;
457
+ $offset = $offset * $this->limit;
458
+ $args['offset'] = $offset;
459
+
460
+ }
461
+
462
+ $the_query = new WP_Query( $args );
463
+
464
+ remove_filter( 'posts_search', 'wsm_search_by_title_only' );
465
+
466
+ return $the_query;
467
+
468
+ }
469
+
470
+
471
+
472
+ }//End class
woocommerce-stock-manager/admin/includes/wcm-class-table.php ADDED
@@ -0,0 +1,806 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WooCommerce Stock Manager
4
+ * @author Vladislav Musílek
5
+ * @license GPL-2.0+
6
+ * @link http:/toret.cz
7
+ * @copyright 2018 Toret.cz
8
+ */
9
+
10
+ class WCM_Table {
11
+
12
+ /**
13
+ * Instance of this class.
14
+ *
15
+ * @since 1.0.5
16
+ *
17
+ * @var object
18
+ */
19
+ protected static $instance = null;
20
+
21
+
22
+ /**
23
+ * Constructor for the stock class.
24
+ *
25
+ * @since 1.0.5
26
+ */
27
+ private function __construct() {
28
+
29
+
30
+
31
+ }
32
+
33
+ /**
34
+ * Return an instance of this class.
35
+ *
36
+ * @since 1.0.5
37
+ *
38
+ * @return object A single instance of this class.
39
+ */
40
+ public static function get_instance() {
41
+
42
+ // If the single instance hasn't been set, set it now.
43
+ if ( null == self::$instance ) {
44
+ self::$instance = new self;
45
+ }
46
+
47
+ return self::$instance;
48
+ }
49
+
50
+
51
+ /**
52
+ * Row filter
53
+ *
54
+ * @since 1.0.5
55
+ */
56
+ public static function row_filter($product_meta, $id){
57
+
58
+
59
+ }
60
+
61
+ /**
62
+ * Display option
63
+ *
64
+ * @since 1.1.2
65
+ */
66
+ public static function display_option(){
67
+ $display_option = get_option( 'wsm_display_option' );
68
+
69
+ if( empty( $display_option ) ){
70
+ $display_option = array(
71
+ 'price' => 'display',
72
+ 'sales_price' => 'no',
73
+ 'weight' => 'display',
74
+ 'manage_stock' => 'display',
75
+ 'stock_status' => 'display',
76
+ 'backorders' => 'display',
77
+ 'stock' => 'display',
78
+ );
79
+ }
80
+ return $display_option;
81
+ }
82
+
83
+ /**
84
+ * Table header
85
+ *
86
+ * @since 1.1.2
87
+ */
88
+ public static function table_header_line(){
89
+
90
+ $display_option = self::display_option();
91
+
92
+ echo '<th></th>';
93
+
94
+ if(!empty( $display_option['thumbnail'] ) && $display_option['thumbnail'] == 'display' ){
95
+ self::table_head_thumbnail();
96
+ }
97
+ self::table_head_sku();
98
+ self::table_head_id();
99
+ self::table_head_name();
100
+ self::table_head_product_type();
101
+ self::table_head_parent_id();
102
+
103
+ if(!empty( $display_option['tax_status'] ) && $display_option['tax_status'] == 'display' ){
104
+ echo '<th>'.__('Tax status','woocommerce-stock-manager').'</th>';
105
+ }
106
+ if(!empty( $display_option['tax_class'] ) && $display_option['tax_class'] == 'display' ){
107
+ echo '<th>'.__('Tax class','woocommerce-stock-manager').'</th>';
108
+ }
109
+ if(!empty( $display_option['shipping_class'] ) && $display_option['shipping_class'] == 'display' ){
110
+ echo '<th>'.__('Shipping class','woocommerce-stock-manager').'</th>';
111
+ }
112
+ if(!empty( $display_option['price'] ) && $display_option['price'] == 'display' ){
113
+ self::table_head_price();
114
+ }
115
+ if(!empty( $display_option['sales_price'] ) && $display_option['sales_price'] == 'display' ){
116
+ self::table_head_sales_price();
117
+ }
118
+ if(!empty( $display_option['weight'] ) && $display_option['weight'] == 'display' ){
119
+ self::table_head_weight();
120
+ }
121
+ if(!empty( $display_option['manage_stock'] ) && $display_option['manage_stock'] == 'display' ){
122
+ self::table_head_manage_stock();
123
+ }
124
+ if(!empty( $display_option['stock_status'] ) && $display_option['stock_status'] == 'display' ){
125
+ self::table_head_stock_status();
126
+ }
127
+ if(!empty( $display_option['backorders'] ) && $display_option['backorders'] == 'display' ){
128
+ self::table_head_backorders();
129
+ }
130
+
131
+ if(!empty( $display_option['stock'] ) && $display_option['stock'] == 'display' ){
132
+ self::table_head_stock();
133
+ }
134
+ do_action( 'stock_manager_table_th' );
135
+ self::table_head_save();
136
+
137
+ }
138
+
139
+ /**
140
+ * Table simple line
141
+ *
142
+ * @since 1.1.2
143
+ */
144
+ public static function table_simple_line( $product_meta, $item, $product_type, $product ){
145
+
146
+ $display_option = self::display_option();
147
+
148
+ if(!empty( $display_option['tax_status'] ) && $display_option['tax_status'] == 'display' ){
149
+ self::tax_status_box( $product_meta, $item, $product_type );
150
+ }
151
+ if(!empty( $display_option['tax_class'] ) && $display_option['tax_class'] == 'display' ){
152
+ self::tax_class_box( $product_meta, $item, $product_type );
153
+ }
154
+ if(!empty( $display_option['shipping_class'] ) && $display_option['shipping_class'] == 'display' ){
155
+ self::shipping_class_box( $product_meta, $item, $product_type );
156
+ }
157
+ if(!empty( $display_option['price'] ) && $display_option['price'] == 'display' ){
158
+ self::price_box( $product_meta, $item, $product_type );
159
+ }
160
+ if(!empty( $display_option['sales_price'] ) && $display_option['sales_price'] == 'display' ){
161
+ self::sales_price_box( $product_meta, $item, $product_type );
162
+ }
163
+ if(!empty( $display_option['weight'] ) && $display_option['weight'] == 'display' ){
164
+ self::weight_box($product_meta, $item);
165
+ }
166
+ if(!empty( $display_option['manage_stock'] ) && $display_option['manage_stock'] == 'display' ){
167
+ self::manage_stock_box($product_meta, $item);
168
+ }
169
+ if(!empty( $display_option['stock_status'] ) && $display_option['stock_status'] == 'display' ){
170
+ self::stock_status_box($product_meta, $item);
171
+ }
172
+ if(!empty( $display_option['backorders'] ) && $display_option['backorders'] == 'display' ){
173
+ self::backorders_box($product_meta, $item);
174
+ }
175
+ if(!empty( $display_option['stock'] ) && $display_option['stock'] == 'display' ){
176
+ self::qty_box( $product_meta, $item, $product );
177
+ }
178
+
179
+
180
+ }
181
+
182
+ /**
183
+ * Table variation line
184
+ *
185
+ * @since 1.1.2
186
+ */
187
+ public static function table_variation_line( $product_meta, $item, $product ){
188
+
189
+ $display_option = self::display_option();
190
+
191
+ $product_type = 'variation';
192
+
193
+ if(!empty( $display_option['tax_status'] ) && $display_option['tax_status'] == 'display' ){
194
+ self::tax_status_box( $product_meta, $item, $product_type );
195
+ }
196
+ if(!empty( $display_option['tax_class'] ) && $display_option['tax_class'] == 'display' ){
197
+ self::tax_class_box( $product_meta, $item, $product_type );
198
+ }
199
+ if(!empty( $display_option['shipping_class'] ) && $display_option['shipping_class'] == 'display' ){
200
+ self::shipping_class_box( $product_meta, $item, $product_type );
201
+ }
202
+ if(!empty( $display_option['price'] ) && $display_option['price'] == 'display' ){
203
+ self::price_box($product_meta, $item);
204
+ }
205
+ if(!empty( $display_option['sales_price'] ) && $display_option['sales_price'] == 'display' ){
206
+ self::sales_price_box($product_meta, $item);
207
+ }
208
+ if(!empty( $display_option['weight'] ) && $display_option['weight'] == 'display' ){
209
+ self::weight_box($product_meta, $item);
210
+ }
211
+ if(!empty( $display_option['manage_stock'] ) && $display_option['manage_stock'] == 'display' ){
212
+ self::manage_stock_box($product_meta, $item);
213
+ }
214
+ if(!empty( $display_option['stock_status'] ) && $display_option['stock_status'] == 'display' ){
215
+ self::stock_status_box($product_meta, $item);
216
+ }
217
+ if(!empty( $display_option['backorders'] ) && $display_option['backorders'] == 'display' ){
218
+ self::backorders_box($product_meta, $item);
219
+ }
220
+ if(!empty( $display_option['stock'] ) && $display_option['stock'] == 'display' ){
221
+ self::qty_box($product_meta, $item, $product);
222
+ }
223
+
224
+
225
+ }
226
+
227
+ /**
228
+ * Table head Thumbnail
229
+ *
230
+ * @since 1.1.9
231
+ */
232
+ public static function table_head_thumbnail(){
233
+ ?>
234
+ <th><?php _e('Thumbnail','woocommerce-stock-manager'); ?></th>
235
+ <?php
236
+ }
237
+ /**
238
+ * Table head Sku
239
+ *
240
+ * @since 1.1.2
241
+ */
242
+ public static function table_head_sku(){
243
+ ?>
244
+ <th style="width:100px;"><?php _e('SKU','woocommerce-stock-manager'); ?></th>
245
+ <?php
246
+ }
247
+ /**
248
+ * Table head ID
249
+ *
250
+ * @since 1.1.2
251
+ */
252
+ public static function table_head_id(){
253
+ ?>
254
+ <th><?php _e('ID','woocommerce-stock-manager'); ?></th>
255
+ <?php
256
+ }
257
+ /**
258
+ * Table head Name
259
+ *
260
+ * @since 1.1.2
261
+ */
262
+ public static function table_head_name(){
263
+ ?>
264
+ <th><?php _e('Name','woocommerce-stock-manager'); ?></th>
265
+ <?php
266
+ }
267
+ /**
268
+ * Table head Product type
269
+ *
270
+ * @since 1.1.2
271
+ */
272
+ public static function table_head_product_type(){
273
+ ?>
274
+ <th><?php _e('Product type','woocommerce-stock-manager'); ?></th>
275
+ <?php
276
+ }
277
+ /**
278
+ * Table head Parent ID
279
+ *
280
+ * @since 1.1.2
281
+ */
282
+ public static function table_head_parent_id(){
283
+ ?>
284
+ <th><?php _e('Parent ID','woocommerce-stock-manager'); ?></th>
285
+ <?php
286
+ }
287
+ /**
288
+ * Table head Price
289
+ *
290
+ * @since 1.1.2
291
+ */
292
+ public static function table_head_price(){
293
+ ?>
294
+ <th><?php _e('Price','woocommerce-stock-manager'); ?></th>
295
+ <?php
296
+ }
297
+ /**
298
+ * Table head Price
299
+ *
300
+ * @since 1.1.2
301
+ */
302
+ public static function table_head_sales_price(){
303
+ ?>
304
+ <th><?php _e('Sale price','woocommerce-stock-manager'); ?></th>
305
+ <?php
306
+ }
307
+ /**
308
+ * Table head Weight
309
+ *
310
+ * @since 1.1.2
311
+ */
312
+ public static function table_head_weight(){
313
+ ?>
314
+ <th><?php _e('Weight','woocommerce-stock-manager'); ?></th>
315
+ <?php
316
+ }
317
+ /**
318
+ * Table head Manage stock
319
+ *
320
+ * @since 1.1.2
321
+ */
322
+ public static function table_head_manage_stock(){
323
+ ?>
324
+ <th><?php _e('Manage stock','woocommerce-stock-manager'); ?></th>
325
+ <?php
326
+ }
327
+ /**
328
+ * Table head Stock status
329
+ *
330
+ * @since 1.1.2
331
+ */
332
+ public static function table_head_stock_status(){
333
+ ?>
334
+ <th style="width:80px;"><?php _e('Stock status','woocommerce-stock-manager'); ?></th>
335
+ <?php
336
+ }
337
+ /**
338
+ * Table head Backorders
339
+ *
340
+ * @since 1.1.2
341
+ */
342
+ public static function table_head_backorders(){
343
+ ?>
344
+ <th><?php _e('Backorders','woocommerce-stock-manager'); ?></th>
345
+ <?php
346
+ }
347
+ /**
348
+ * Table head Stock
349
+ *
350
+ * @since 1.1.2
351
+ */
352
+ public static function table_head_stock(){
353
+ ?>
354
+ <th style="width:50px;"><?php _e('Stock','woocommerce-stock-manager'); ?></th>
355
+ <?php
356
+ }
357
+ /**
358
+ * Table head Save
359
+ *
360
+ * @since 1.1.2
361
+ */
362
+ public static function table_head_save(){
363
+ ?>
364
+ <th style="width:100px;"><?php _e('Save','woocommerce-stock-manager'); ?></th>
365
+ <?php
366
+ }
367
+
368
+
369
+
370
+
371
+ /**
372
+ * Hidden box
373
+ *
374
+ * @since 1.1.2
375
+ */
376
+ public static function hidden_box( $item ){
377
+ ?>
378
+ <input type="hidden" name="product_id[<?php echo $item; ?>]" value="<?php echo $item; ?>" />
379
+ <?php
380
+ }
381
+
382
+ /**
383
+ * Thumbnail box
384
+ *
385
+ * @since 1.1.9
386
+ */
387
+ public static function thumbnail_box( $item ) {
388
+ $display_option = self::display_option();
389
+ if(!empty( $display_option['thumbnail'] ) && $display_option['thumbnail'] == 'display' ){
390
+ $_product = wc_get_product( $item );
391
+ $thumbnail = $_product->get_image( 'shop_thumbnail' );
392
+ ?>
393
+ <td class="item_thumbnail_box">
394
+ <?php echo $thumbnail; ?>
395
+ </td>
396
+ <?php
397
+ }
398
+ }
399
+
400
+ /**
401
+ * SKU box
402
+ *
403
+ * @since 1.1.2
404
+ */
405
+ public static function sku_box($product_meta, $item){
406
+ ?>
407
+ <td class="item_sku_box">
408
+ <span class="item-sku-text-<?php echo $item; ?>"><?php if(!empty($product_meta['_sku'][0])){ echo $product_meta['_sku'][0]; } ?></span>
409
+ <span class="dashicons dashicons-edit" data-item="<?php echo $item; ?>"></span>
410
+ <div class="item-sku-wrap item-sku-wrap-<?php echo $item; ?>">
411
+ <input type="text" name="sku[<?php echo $item; ?>]" style="width:100%;" class="item-sku sku_<?php echo $item; ?>" value="<?php if(!empty($product_meta['_sku'][0])){ echo $product_meta['_sku'][0]; } ?>" />
412
+ <span class="btn btn-info item-sku-button" data-item="<?php echo $item; ?>"><?php _e('Save', 'woocommerce-stock-manager'); ?></span>
413
+ <span class="btn btn-danger item-sku-button-close"><?php _e('Close', 'woocommerce-stock-manager'); ?></span>
414
+ </div>
415
+ </td>
416
+ <?php
417
+ }
418
+
419
+ /**
420
+ * ID box
421
+ *
422
+ * @since 1.1.2
423
+ */
424
+ public static function id_box( $item ){
425
+ ?>
426
+ <td class="td_center"><?php echo $item; ?></td>
427
+ <?php
428
+ }
429
+
430
+ /**
431
+ * Name box
432
+ *
433
+ * @since 1.1.2
434
+ */
435
+ public static function name_box( $item ){
436
+ ?>
437
+ <td class="table_name_box">
438
+ <a href="<?php echo admin_url().'post.php?post='.$item.'&action=edit'; ?>" target="_blank" class="item-post-link-<?php echo $item; ?>">
439
+ <?php echo get_the_title( $item ); ?>
440
+ </a>
441
+ <span class="dashicons dashicons-edit" data-item="<?php echo $item; ?>"></span>
442
+ <div class="item-post-title-wrap item-post-title-wrap-<?php echo $item; ?>">
443
+ <input type="text" name="item-post-title" class="item-post-title item-post-title-<?php echo $item; ?>" value="<?php echo get_the_title( $item ); ?>" />
444
+ <span class="btn btn-info item-post-title-button" data-item="<?php echo $item; ?>"><?php _e('Save', 'woocommerce-stock-manager'); ?></span>
445
+ <span class="btn btn-danger item-post-title-button-close"><?php _e('Close', 'woocommerce-stock-manager'); ?></span>
446
+ </div>
447
+ </td>
448
+ <?php
449
+ }
450
+
451
+ /**
452
+ * Show variables box
453
+ *
454
+ * @since 1.1.2
455
+ */
456
+ public static function show_variables_box( $item, $product_type ){
457
+ ?>
458
+ <td class="td_center">
459
+ <?php if($product_type == 'variable'){
460
+ echo '<span class="btn btn-info btn-sm show-variable" data-variable="'.$item.'">'.__('Show variables','woocommerce-stock-manager').'</span>';
461
+ }else{
462
+ echo $product_type;
463
+ } ?>
464
+ </td>
465
+ <?php
466
+ }
467
+
468
+ /**
469
+ * Tax status box
470
+ *
471
+ * @since 1.1.2
472
+ */
473
+ public static function tax_status_box( $product_meta, $id, $product_type = null ){
474
+
475
+ $product = wc_get_product( $id );
476
+
477
+ if( $product_type == 'simple' || $product_type == 'variable' ){
478
+ $value = $product->get_tax_status( 'edit' );
479
+ $values = array(
480
+ 'taxable' => __( 'Taxable', 'woocommerce-woocommerce' ),
481
+ 'shipping' => __( 'Shipping only', 'woocommerce-woocommerce' ),
482
+ 'none' => _x( 'None', 'Tax status', 'woocommerce-woocommerce' ),
483
+ );
484
+ ?>
485
+ <td>
486
+ <select class="tax_status<?php echo $id; ?>" name="tax_status[<?php echo $id; ?>]">
487
+ <?php
488
+ foreach( $values as $key => $item ){
489
+ ?>
490
+ <option value="<?php echo $key; ?>" <?php if( $value == $key ){ echo 'selected="selected"'; } ?>><?php echo $item; ?></option>
491
+ <?php
492
+ }
493
+ ?>
494
+ </select>
495
+ </td>
496
+ <?php
497
+ }else{
498
+ ?><td></td><?php
499
+ }
500
+ }
501
+
502
+ /**
503
+ * Tax calss box
504
+ *
505
+ * @since 1.1.2
506
+ */
507
+ public static function tax_class_box( $product_meta, $id, $product_type = null ){
508
+
509
+ $product = wc_get_product( $id );
510
+
511
+ $value = $product->get_tax_class( 'edit' );
512
+ $values = wc_get_product_tax_class_options();
513
+ ?>
514
+ <td>
515
+ <select class="tax_class<?php echo $id; ?>" name="tax_class[<?php echo $id; ?>]">
516
+ <?php
517
+ foreach( $values as $key => $item ){
518
+ ?>
519
+ <option value="<?php echo $key; ?>" <?php if( $value == $key ){ echo 'selected="selected"'; } ?>><?php echo $item; ?></option>
520
+ <?php
521
+ }
522
+ ?>
523
+ </select>
524
+ </td>
525
+ <?php
526
+ }
527
+
528
+ /**
529
+ * Shipping class box
530
+ *
531
+ * @since 1.1.2
532
+ */
533
+ public static function shipping_class_box( $product_meta, $id, $product_type = null ){
534
+
535
+ $product = wc_get_product( $id );
536
+
537
+ if( $product_type == 'variation' ){
538
+ $label = _e( 'Same as parent', 'woocommerce-stock-manager' );
539
+ }else{
540
+ $label = _e( 'No shipping class', 'woocommerce-stock-manager' );
541
+ }
542
+
543
+ $args = array(
544
+ 'taxonomy' => 'product_shipping_class',
545
+ 'hide_empty' => 0,
546
+ 'show_option_none' => __( $label, 'woocommerce' ),
547
+ 'name' => 'shipping_class['.$id.']',
548
+ 'id' => 'shipping_class',
549
+ 'selected' => $product->get_shipping_class_id( 'edit' ),
550
+ 'class' => 'select short shipping_class'.$id,
551
+ );
552
+ ?>
553
+ <td>
554
+ <?php
555
+ wp_dropdown_categories( $args );
556
+ ?>
557
+ </td>
558
+ <?php
559
+ }
560
+ /*
561
+
562
+ if(!empty( $display_option['tax_class'] ) && $display_option['tax_class'] == 'display' ){
563
+ self::tax_class_box( $product_meta, $item->ID, $product_type );
564
+ }
565
+ if(!empty( $display_option['shipping_class'] ) && $display_option['shipping_class'] == 'display' ){
566
+ self::shipping_class_box( $product_meta, $item->ID, $product_type );
567
+ }
568
+ */
569
+ /**
570
+ * Price box
571
+ *
572
+ * @since 1.1.2
573
+ */
574
+ public static function price_box( $product_meta, $id, $product_type = null ){
575
+
576
+ if( $product_type != null && $product_type == 'variable' ){
577
+ ?>
578
+ <td></td>
579
+ <?php
580
+ }else{
581
+
582
+ ?>
583
+ <td>
584
+ <input class="line-price regular_price_<?php echo $id; ?>" name="regular_price[<?php echo $id; ?>]" type="number" min="<?php echo wsm_get_step(); ?>" step="<?php echo wsm_get_step(); ?>" <?php if(!empty($product_meta['_regular_price'][0])){ echo 'value="'.$product_meta['_regular_price'][0].'"'; } ?> />
585
+ </td>
586
+ <?php
587
+ }
588
+ }
589
+
590
+ /**
591
+ * Sales Price box
592
+ *
593
+ * @since 1.1.2
594
+ */
595
+ public static function sales_price_box( $product_meta, $id, $product_type = null ){
596
+ if( $product_type != null && $product_type == 'variable' ){
597
+ ?>
598
+ <td></td>
599
+ <?php
600
+ }else{
601
+
602
+ ?>
603
+ <td>
604
+ <input class="line-price sales_price_<?php echo $id; ?>" name="sales_price[<?php echo $id; ?>]" type="number" min="<?php echo wsm_get_step(); ?>" step="<?php echo wsm_get_step(); ?>" <?php if(!empty($product_meta['_sale_price'][0])){ echo 'value="'.$product_meta['_sale_price'][0].'"'; } ?> />
605
+ </td>
606
+ <?php
607
+ }
608
+ }
609
+
610
+ /**
611
+ * Weight box
612
+ *
613
+ * @since 1.1.2
614
+ */
615
+ public static function weight_box($product_meta, $id){
616
+ ?>
617
+ <td>
618
+ <input class="line-price weight_<?php echo $id; ?> wc_input_decimal" name="weight[<?php echo $id; ?>]" <?php if(!empty($product_meta['_weight'][0])){ echo 'value="'.$product_meta['_weight'][0].'"'; } ?> />
619
+ </td>
620
+ <?php
621
+ }
622
+
623
+ /**
624
+ * Manage stock box
625
+ *
626
+ * @since 1.1.2
627
+ */
628
+ public static function manage_stock_box($product_meta, $item){
629
+ ?>
630
+ <td>
631
+ <select name="manage_stock[<?php echo $item; ?>]" class="manage_stock_<?php echo $item; ?> manage_stock_select" data-item="<?php echo $item; ?>">
632
+ <option value="yes" <?php if(!empty($product_meta['_manage_stock'][0]) && $product_meta['_manage_stock'][0] == 'yes'){ echo 'selected="selected"'; } ?>><?php _e('Yes','woocommerce-stock-manager'); ?></option>
633
+ <option value="no" <?php if(!empty($product_meta['_manage_stock'][0]) && $product_meta['_manage_stock'][0] == 'no'){ echo 'selected="selected"'; } ?>><?php _e('No','woocommerce-stock-manager'); ?></option>
634
+ </select>
635
+ </td>
636
+ <?php
637
+ }
638
+ /**
639
+ * Stock status box
640
+ *
641
+ * @since 1.1.2
642
+ */
643
+ public static function stock_status_box($product_meta, $item){
644
+ ?>
645
+ <td>
646
+ <select name="stock_status[<?php echo $item; ?>]" class="stock_status_<?php echo $item; ?> stock_status_select" data-item="<?php echo $item; ?>" <?php if(!empty($product_meta['_manage_stock'][0]) && $product_meta['_manage_stock'][0] == 'yes'){ echo 'disabled'; } ?>>
647
+ <option value="instock" <?php if(!empty($product_meta['_stock_status'][0]) && $product_meta['_stock_status'][0] == 'instock'){ echo 'selected="selected"'; } ?>><?php _e('In stock','woocommerce-stock-manager'); ?></option>
648
+ <option value="outofstock" <?php if(!empty($product_meta['_stock_status'][0]) && $product_meta['_stock_status'][0] == 'outofstock'){ echo 'selected="selected"'; } ?>><?php _e('Out of stock','woocommerce-stock-manager'); ?></option>
649
+ <option value="onbackorder" <?php if(!empty($product_meta['_stock_status'][0]) && $product_meta['_stock_status'][0] == 'onbackorder'){ echo 'selected="selected"'; } ?>><?php _e('On backorder','woocommerce-stock-manager'); ?></option>
650
+ </select>
651
+ </td>
652
+ <?php
653
+ }
654
+ /**
655
+ * Backorders box
656
+ *
657
+ * @since 1.1.2
658
+ */
659
+ public static function backorders_box($product_meta, $item){
660
+ ?>
661
+ <td>
662
+ <select name="backorders[<?php echo $item; ?>]" class="backorders_<?php echo $item; ?> backorders_select" data-item="<?php echo $item; ?>" <?php if(!empty($product_meta['_manage_stock'][0]) && $product_meta['_manage_stock'][0] == 'no'){ echo 'disabled'; } ?>>
663
+ <option value="no" <?php if(!empty($product_meta['_backorders'][0]) && $product_meta['_backorders'][0] == 'no'){ echo 'selected="selected"'; } ?>><?php _e('No','woocommerce-stock-manager'); ?></option>
664
+ <option value="notify" <?php if(!empty($product_meta['_backorders'][0]) && $product_meta['_backorders'][0] == 'notify'){ echo 'selected="selected"'; } ?>><?php _e('Notify','woocommerce-stock-manager'); ?></option>
665
+ <option value="yes" <?php if(!empty($product_meta['_backorders'][0]) && $product_meta['_backorders'][0] == 'yes'){ echo 'selected="selected"'; } ?>><?php _e('Yes','woocommerce-stock-manager'); ?></option>
666
+ </select>
667
+ </td>
668
+ <?php
669
+ }
670
+
671
+ /**
672
+ * Qty box
673
+ *
674
+ * @since 1.1.2
675
+ */
676
+ public static function qty_box($product_meta, $item, $product){
677
+
678
+ $step = get_option( 'woocommerce_stock_qty_step' );
679
+ if( empty( $step ) ){ $step = '1'; }
680
+
681
+ $class = '';
682
+ if( !empty( $product ) ){
683
+ $stock_number = $product->get_stock_quantity();
684
+ $class = self::get_stock_qty_class( $stock_number );
685
+ }else{
686
+ $class = '';
687
+ $stock_number = '0';
688
+ }
689
+ if( empty( $stock_number ) ){ $stock_number = 0; }
690
+ $_product = wc_get_product( $item );
691
+ $product_type = $_product->get_type();
692
+ if( $product_type == 'variable' ){
693
+
694
+ $variable_stock = get_option( 'woocommerce_stock_variable_stock' );
695
+ if( !empty( $variable_stock ) && $variable_stock == 'ok' ){
696
+ ?>
697
+ <td class="td_center <?php echo $class; ?>" style="width:70px;">
698
+ <input type="number" name="stock[<?php echo $item; ?>]" step="<?php echo $step; ?>" value="<?php echo $stock_number; ?>" class="stock_<?php echo $item; ?> stock_number" data-item="<?php echo $item; ?>" style="width:70px;" <?php if(!empty($product_meta['_manage_stock'][0]) && $product_meta['_manage_stock'][0] == 'no'){ echo 'disabled'; } ?> />
699
+ </td>
700
+ <?php
701
+ }else{
702
+ //Show count all variations stock.
703
+ $stock_number = self::get_all_variations_stock( $item );
704
+ $class = self::get_stock_qty_class( $stock_number );
705
+ ?>
706
+ <td class="td_center <?php echo $class; ?>" style="width:70px;">
707
+ <input type="number" name="stock[<?php echo $item; ?>]" step="<?php echo $step; ?>" value="<?php echo $stock_number; ?>" class="stock_<?php echo $item; ?> stock_number" data-item="<?php echo $item; ?>" style="width:70px;background:#ffffff;" disabled="disabled" />
708
+ </td>
709
+ <?php
710
+ }
711
+ }else{
712
+ ?>
713
+ <td class="td_center <?php echo $class; ?>" style="width:70px;">
714
+ <input type="number" name="stock[<?php echo $item; ?>]" step="<?php echo $step; ?>" value="<?php echo $stock_number; ?>" class="stock_<?php echo $item; ?> stock_number" data-item="<?php echo $item; ?>" style="width:70px;" <?php if(!empty($product_meta['_manage_stock'][0]) && $product_meta['_manage_stock'][0] == 'no'){ echo 'disabled'; } ?> />
715
+ </td>
716
+ <?php
717
+ }
718
+ }
719
+
720
+ /**
721
+ * Line nonce box
722
+ *
723
+ * @since 1.1.2
724
+ */
725
+ public static function line_nonce_box($item){
726
+ ?>
727
+ <input type="hidden" name="wsm-ajax-nonce-<?php echo $item; ?>" class="wsm-ajax-nonce_<?php echo $item; ?>" value="<?php echo wp_create_nonce( 'wsm-ajax-nonce-'.$item ); ?>" />
728
+ </td>
729
+ <?php
730
+ }
731
+ /**
732
+ * Line save box
733
+ *
734
+ * @since 1.1.2
735
+ */
736
+ public static function line_save_box( $item ){
737
+ ?>
738
+ <td class="td_center">
739
+ <span class="btn btn-primary btn-sm save-product" data-product="<?php echo $item; ?>"><?php _e('Save','woocommerce-stock-manager'); ?></span>
740
+ </td>
741
+ <?php
742
+ }
743
+
744
+
745
+ /**
746
+ * Line save box
747
+ *
748
+ * @since 1.1.8
749
+ */
750
+ public static function get_all_variations_stock( $item ){
751
+
752
+ $args = array(
753
+ 'posts_per_page' => -1,
754
+ 'post_type' => 'product_variation',
755
+ 'post_parent' => $item
756
+ );
757
+ $variations = get_posts( $args );
758
+
759
+ if( !empty( $variations ) ){
760
+ $stock = 0;
761
+ foreach( $variations as $variation ){
762
+
763
+ $product_meta = get_post_meta( $variation->ID );
764
+
765
+ if( !empty( $product_meta['_stock'][0] ) ){
766
+
767
+ $stock = $stock + $product_meta['_stock'][0];
768
+
769
+ }
770
+
771
+ }
772
+ return $stock;
773
+ }else{
774
+ return false;
775
+ }
776
+
777
+ }
778
+
779
+
780
+ /**
781
+ * Line save box
782
+ *
783
+ * @since 1.1.8
784
+ */
785
+ public static function get_stock_qty_class( $stock ){
786
+
787
+ $class = 'outofstock';
788
+
789
+ if( $stock < 1 ){
790
+ $class = 'outofstock';
791
+ }else{
792
+ if( $stock < 5 ){
793
+ $class = 'lowstock';
794
+ }else{
795
+ $class = 'instock';
796
+ }
797
+ }
798
+
799
+ $class = apply_filters( 'woocommerce_stock_manager_qty_class', $class, $stock );
800
+
801
+ return $class;
802
+
803
+ }
804
+
805
+
806
+ }//End class
woocommerce-stock-manager/admin/views/admin.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WooCommerce Stock Manager
4
+ * @author Vladislav Musílek
5
+ * @license GPL-2.0+
6
+ * @link http:/toret.cz
7
+ * @copyright 2015 Toret.cz
8
+ */
9
+
10
+ $stock = $this->stock();
11
+
12
+ /**
13
+ * Save all data
14
+ *
15
+ */
16
+ if( isset( $_POST['product_id'] ) ){
17
+ $stock->save_all( $_POST );
18
+ //add redirect
19
+
20
+ }
21
+
22
+ /**
23
+ * Save display option
24
+ *
25
+ */
26
+ if( isset( $_POST['page-filter-display'] ) ){
27
+ $stock->save_filter_display( $_POST );
28
+ }
29
+
30
+
31
+ ?>
32
+
33
+
34
+ <div class="wrap">
35
+
36
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
37
+
38
+
39
+
40
+
41
+ <div class="t-col-12">
42
+ <div class="toret-box box-info">
43
+ <div class="box-header">
44
+ <h3 class="box-title"><?php _e('Stock manager','woocommerce-stock-manager'); ?></h3>
45
+ </div>
46
+ <div class="box-body">
47
+
48
+ <?php include('components/filter.php'); ?>
49
+
50
+ <div class="clear"></div>
51
+ <form method="post" action="" style="position:relative;">
52
+ <div class="lineloader"></div>
53
+ <table class="table-bordered">
54
+ <tr>
55
+ <?php WCM_Table::table_header_line(); ?>
56
+ </tr>
57
+ <?php $products = $stock->get_products( $_GET );
58
+
59
+ if( !empty( $products->posts ) ){
60
+ foreach( $products->posts as $item ){
61
+ $product_meta = get_post_meta($item->ID);
62
+ $item_product = wc_get_product($item->ID);
63
+ $product_type = $item_product->get_type();
64
+ ?>
65
+ <tr>
66
+ <?php if($product_type == 'variable'){
67
+ echo '<td></td>';
68
+ }else{
69
+ ?>
70
+ <td class="td_center"><input type="checkbox" name="cd[<?php echo $item->ID; ?>]" /></td>
71
+ <?php } ?>
72
+ <?php WCM_Table::hidden_box( $item->ID ); ?>
73
+ <?php WCM_Table::thumbnail_box( $item->ID ); ?>
74
+ <?php WCM_Table::sku_box( $product_meta, $item->ID ); ?>
75
+ <?php WCM_Table::id_box( $item->ID ); ?>
76
+ <?php WCM_Table::name_box( $item->ID ); ?>
77
+ <td class="td_center">
78
+ <?php if($product_type == 'variable'){
79
+ echo '<span class="btn btn-info btn-sm show-variable" data-variable="'.$item->ID.'">'.__('Show variables','woocommerce-stock-manager').'</span>';
80
+ }else{
81
+ echo $product_type;
82
+ } ?>
83
+ </td>
84
+ <td></td>
85
+ <?php WCM_Table::table_simple_line( $product_meta, $item->ID, $product_type, $item_product ); ?>
86
+ <?php do_action( 'stock_manager_table_simple_td', $item->ID ); ?>
87
+ <?php WCM_Table::line_nonce_box( $item->ID ); ?>
88
+ <?php WCM_Table::line_save_box( $item->ID ); ?>
89
+ </tr>
90
+
91
+ <?php
92
+ if($product_type == 'variable'){
93
+ $args = array(
94
+ 'post_parent' => $item->ID,
95
+ 'post_type' => 'product_variation',
96
+ 'numberposts' => -1,
97
+ 'post_status' => 'publish',
98
+ 'order_by' => 'menu_order'
99
+ );
100
+
101
+ //var_dump( $item_product->get_children() );
102
+
103
+ $variations_array = $item_product->get_children();
104
+ foreach($variations_array as $vars){
105
+
106
+ $product_meta = get_post_meta($vars);
107
+ $item_product = wc_get_product($vars);
108
+ $product_type = 'product variation' ;
109
+
110
+ ?>
111
+ <tr class="variation-line variation-item-<?php echo $item->ID; ?>">
112
+ <td class="td_center"><input type="checkbox" name="cd[<?php echo $vars; ?>]" /></td>
113
+ <?php WCM_Table::hidden_box( $vars ); ?>
114
+ <?php WCM_Table::thumbnail_box( $vars ); ?>
115
+ <?php WCM_Table::sku_box( $product_meta, $vars ); ?>
116
+ <?php WCM_Table::id_box( $vars ); ?>
117
+
118
+ <td><?php
119
+ foreach($item_product->get_variation_attributes() as $k => $v){
120
+ $tag = get_term_by('slug', $v, str_replace('attribute_','',$k));
121
+ if($tag == false ){
122
+ echo $v.' ';
123
+ }else{
124
+ if(is_array($tag)){
125
+ echo $tag['name'].' ';
126
+ }else{
127
+ echo $tag->name.' ';
128
+ }
129
+ }
130
+ }
131
+ ?></td>
132
+ <td><?php echo $product_type; ?></td>
133
+ <td><?php echo $item->ID; ?></td>
134
+ <?php WCM_Table::table_variation_line( $product_meta, $vars, $item_product ); ?>
135
+ <?php do_action( 'stock_manager_table_variation_td', $vars ); ?>
136
+ <?php WCM_Table::line_nonce_box($vars); ?>
137
+ <?php WCM_Table::line_save_box($vars); ?>
138
+ </tr>
139
+ <?php
140
+ }
141
+ }
142
+ ?>
143
+
144
+ <?php }
145
+
146
+ }
147
+ ?>
148
+
149
+ </table>
150
+ <div class="clear"></div>
151
+ <input type="submit" name="save-all" class="btn btn-danger" value="<?php _e('Save all','woocommerce-stock-manager') ?>" />
152
+ </form>
153
+ <div class="clear"></div>
154
+
155
+ <?php echo $stock->pagination( $products ); ?>
156
+ </div>
157
+ </div>
158
+
159
+
160
+ </div>
woocommerce-stock-manager/admin/views/components/filter.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <ul class="stock-manager-navigation">
3
+ <li><span class="navigation-filter-default activ"><?php _e('Filter','woocommerce-stock-manager'); ?></span></li>
4
+ <li><span class="navigation-filter-by-sku"><?php _e('Search by sku','woocommerce-stock-manager'); ?></span></li>
5
+ <li><span class="navigation-filter-by-title"><?php _e('Search by product name','woocommerce-stock-manager'); ?></span></li>
6
+ <li><span class="navigation-filter-display"><?php _e('Display setting','woocommerce-stock-manager'); ?></span></li>
7
+ </ul>
8
+
9
+ <div class="clear"></div>
10
+
11
+ <div class="stock-filter filter-block active-filter">
12
+ <form method="get" action="">
13
+
14
+ <select name="order-by">
15
+ <option value=""><?php _e('Order by','stock-manager'); ?></option>
16
+ <option value="name-asc" <?php if( isset( $_GET['order-by'] ) && $_GET['order-by'] == 'name-asc' ){ echo 'selected="selected"'; } ?>><?php _e('Product name ASC','woocommerce-stock-manager'); ?></option>
17
+ <option value="name-desc" <?php if( isset( $_GET['order-by'] ) && $_GET['order-by'] == 'name-desc' ){ echo 'selected="selected"'; } ?>><?php _e('Product name DESC','woocommerce-stock-manager'); ?></option>
18
+ <option value="sku-asc" <?php if( isset( $_GET['order-by'] ) && $_GET['order-by'] == 'sku-asc' ){ echo 'selected="selected"'; } ?>><?php _e('SKU ASC','woocommerce-stock-manager'); ?></option>
19
+ <option value="sku-desc" <?php if( isset( $_GET['order-by'] ) && $_GET['order-by'] == 'sku-desc' ){ echo 'selected="selected"'; } ?>><?php _e('SKU DESC','woocommerce-stock-manager'); ?></option>
20
+ </select>
21
+
22
+ <select name="product-type">
23
+ <option value="simple" <?php if(isset($_GET['product-type']) && $_GET['product-type'] == 'simple'){ echo 'selected="selected"'; } ?> ><?php _e('Simple products','woocommerce-stock-manager'); ?></option>
24
+ <option value="variable" <?php if(isset($_GET['product-type']) && $_GET['product-type'] == 'variable'){ echo 'selected="selected"'; } ?>><?php _e('Products with variation','woocommerce-stock-manager'); ?></option>
25
+ </select>
26
+
27
+ <select name="product-category">
28
+ <option value="all"><?php _e('All categories','woocommerce-stock-manager'); ?></option>
29
+ <?php
30
+ if(isset($_GET['product-category']) && $_GET['product-category'] != 'all' ){
31
+ echo $stock->products_categories($_GET['product-category']);
32
+ }else{
33
+ echo $stock->products_categories();
34
+ }
35
+
36
+ ?>
37
+ </select>
38
+
39
+ <select name="manage-stock">
40
+ <option value=""><?php _e('Manage stock','woocommerce-stock-manager'); ?></option>
41
+ <option value="no" <?php if( isset( $_GET['manage-stock'] ) && $_GET['manage-stock'] == 'no' ){ echo 'selected="selected"'; } ?>><?php _e('No manage stock','woocommerce-stock-manager'); ?></option>
42
+ <option value="yes" <?php if( isset( $_GET['manage-stock'] ) && $_GET['manage-stock'] == 'yes' ){ echo 'selected="selected"'; } ?>><?php _e('Yes manage stock','woocommerce-stock-manager'); ?></option>
43
+ </select>
44
+
45
+ <select name="stock-status">
46
+ <option value=""><?php _e('Stock status','stock-manager'); ?></option>
47
+ <option value="instock" <?php if( isset( $_GET['stock-status'] ) && $_GET['stock-status'] == 'instock' ){ echo 'selected="selected"'; } ?>><?php _e('In stock','woocommerce-stock-manager'); ?></option>
48
+ <option value="outofstock" <?php if( isset( $_GET['stock-status'] ) && $_GET['stock-status'] == 'outofstock' ){ echo 'selected="selected"'; } ?>><?php _e('Out of stock','woocommerce-stock-manager'); ?></option>
49
+ </select>
50
+
51
+ <input type="hidden" name="page" value="stock-manager" />
52
+ <input type="submit" name="show-stock-status" value="<?php _e('Show','woocommerce-stock-manager'); ?>" class="btn btn-info" />
53
+ </form>
54
+ <a href="<?php echo admin_url().'admin.php?page=stock-manager'; ?>" class="btn btn-danger"><?php _e('Clear filter','woocommerce-stock-manager'); ?></a>
55
+ </div>
56
+
57
+ <div class="clear"></div>
58
+
59
+ <div class="filter-by-sku filter-block">
60
+ <form method="get" action="">
61
+ <input type="text" name="sku" class="sku-seach-field" />
62
+ <input type="hidden" name="page" value="stock-manager" />
63
+ <input type="submit" name="show-sku-item" value="<?php _e('Search by sku','woocommerce-stock-manager'); ?>" class="btn btn-info" />
64
+ </form>
65
+ </div>
66
+
67
+ <div class="clear"></div>
68
+
69
+ <div class="filter-by-title filter-block">
70
+ <form method="get" action="">
71
+ <input type="text" name="product-title" class="title-seach-field" />
72
+ <input type="hidden" name="page" value="stock-manager" />
73
+ <input type="submit" name="show-sku-item" value="<?php _e('Search by product name','woocommerce-stock-manager'); ?>" class="btn btn-info" />
74
+ </form>
75
+ </div>
76
+
77
+ <div class="clear"></div>
78
+
79
+
80
+ <div class="filter-display filter-block">
81
+ <form method="post" action="">
82
+ <?php
83
+ $display_option = get_option( 'wsm_display_option' );
84
+ if( empty( $display_option ) ){
85
+ $display_option = array(
86
+ 'thumbnail' => 'no',
87
+ 'price' => 'display',
88
+ 'sales_price' => 'no',
89
+ 'weight' => 'display',
90
+ 'manage_stock' => 'display',
91
+ 'stock_status' => 'display',
92
+ 'backorders' => 'display',
93
+ 'stock' => 'display',
94
+ 'tax_status' => 'no',
95
+ 'tax_class' => 'no',
96
+ 'shipping_class'=> 'no'
97
+ );
98
+ update_option( 'wsm_display_option', $display_option );
99
+ }
100
+ ?>
101
+ <h2><?php _e('Hide or display cells','stock-manager'); ?></h2>
102
+ <table class="table-bordered">
103
+ <tr>
104
+ <td><?php _e('Thumbnail','woocommerce-stock-manager'); ?></td>
105
+ <td><input type="checkbox" name="thumbnail" <?php if( !empty( $display_option['thumbnail'] ) && $display_option['thumbnail'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
106
+ <td><?php _e('Price','woocommerce-stock-manager'); ?></td>
107
+ <td><input type="checkbox" name="price" <?php if( !empty( $display_option['price'] ) && $display_option['price'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
108
+ <td><?php _e('Sales price','woocommerce-stock-manager'); ?></td>
109
+ <td><input type="checkbox" name="sales_price" <?php if( !empty( $display_option['sales_price'] ) && $display_option['sales_price'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
110
+ <td><?php _e('Weight','woocommerce-stock-manager'); ?></td>
111
+ <td><input type="checkbox" name="weight" <?php if( !empty( $display_option['weight'] ) && $display_option['weight'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
112
+ <td><?php _e('Manage stock','woocommerce-stock-manager'); ?></td>
113
+ <td><input type="checkbox" name="manage_stock" <?php if( !empty( $display_option['manage_stock'] ) && $display_option['manage_stock'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
114
+ <td><?php _e('Stock status','woocommerce-stock-manager'); ?></td>
115
+ <td><input type="checkbox" name="stock_status" <?php if( !empty( $display_option['stock_status'] ) && $display_option['stock_status'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
116
+ <td><?php _e('Backorders','woocommerce-stock-manager'); ?></td>
117
+ <td><input type="checkbox" name="backorders" <?php if( !empty( $display_option['backorders'] ) && $display_option['backorders'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
118
+ <td><?php _e('Stock','woocommerce-stock-manager'); ?></td>
119
+ <td><input type="checkbox" name="stock" <?php if( !empty( $display_option['stock'] ) && $display_option['stock'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
120
+ </tr>
121
+ <tr>
122
+ <td><?php _e('Tax status','woocommerce-stock-manager'); ?></td>
123
+ <td><input type="checkbox" name="tax_status" <?php if( !empty( $display_option['tax_status'] ) && $display_option['tax_status'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
124
+ <td><?php _e('Tax class','woocommerce-stock-manager'); ?></td>
125
+ <td><input type="checkbox" name="tax_class" <?php if( !empty( $display_option['tax_class'] ) && $display_option['tax_class'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
126
+ <td><?php _e('Shipping class','woocommerce-stock-manager'); ?></td>
127
+ <td><input type="checkbox" name="shipping_class" <?php if( !empty( $display_option['shipping_class'] ) && $display_option['shipping_class'] == 'display' ){ echo 'checked="checked"'; } ?> value="ok" /></td>
128
+ <td></td>
129
+ <td></td>
130
+ <td></td>
131
+ <td></td>
132
+ <td></td>
133
+ <td></td>
134
+ <td></td>
135
+ <td></td>
136
+ <td></td>
137
+ <td></td>
138
+ </tr>
139
+ </table>
140
+
141
+ <input type="hidden" name="page-filter-display" value="filter-display" />
142
+ <input type="submit" name="show-sku-item" value="<?php _e('Save setting','woocommerce-stock-manager'); ?>" class="btn btn-info" />
143
+ </form>
144
+ </div>
145
+
146
+ <div class="clear"></div>
147
+
woocommerce-stock-manager/admin/views/import-export.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WooCommerce Stock Manager
4
+ * @author Vladislav Musílek
5
+ * @license GPL-2.0+
6
+ * @link http:/toret.cz
7
+ * @copyright 2015 Toret.cz
8
+ */
9
+
10
+ $stock = $this->stock();
11
+
12
+ function stockautoUTF($s){
13
+ if (preg_match('#[\x80-\x{1FF}\x{2000}-\x{3FFF}]#u', $s))
14
+ return $s;
15
+
16
+ if (preg_match('#[\x7F-\x9F\xBC]#', $s))
17
+ return iconv('WINDOWS-1250', 'UTF-8', $s);
18
+
19
+ return iconv('ISO-8859-2', 'UTF-8', $s);
20
+ }
21
+
22
+
23
+ ?>
24
+ <script>
25
+
26
+ jQuery( document ).ready(function() {
27
+
28
+
29
+ function convertArrayOfObjectsToCSV(args) {
30
+ var result, ctr, keys, columnDelimiter, lineDelimiter, data;
31
+
32
+ data = args.datas || null;
33
+ if (data == null || !data.length) {
34
+ return null;
35
+ }
36
+
37
+ columnDelimiter = args.columnDelimiter || ';';
38
+ lineDelimiter = args.lineDelimiter || '\n';
39
+
40
+ keys = Object.keys(data[0]);
41
+
42
+ result = '';
43
+ result += keys.join(columnDelimiter);
44
+ result += lineDelimiter;
45
+
46
+ console.log(args);
47
+
48
+ data.forEach(function(item) {
49
+ ctr = 0;
50
+ keys.forEach(function(key) {
51
+ if (ctr > 0) result += columnDelimiter;
52
+
53
+ result += item[key];
54
+ ctr++;
55
+ });
56
+ result += lineDelimiter;
57
+ });
58
+
59
+ return result;
60
+ }
61
+
62
+ jQuery('.product-export').on( 'click', function(e){
63
+
64
+ e.preventDefault();
65
+ jQuery( '.export-output' ).empty();
66
+ jQuery( '#csv' ).append( 'Generating csv file' );
67
+ jQuery( '#csv' ).css( 'display','block' );
68
+
69
+ var offset = '0';
70
+ wsm_export_products( offset );
71
+
72
+ function wsm_export_products( offset ) {
73
+
74
+ var data = {
75
+ 'action' : 'wsm_get_products_or_export',
76
+ 'offset' : offset
77
+ };
78
+
79
+ jQuery.post(ajaxurl, data, function( response ) {
80
+
81
+ var result = jQuery.parseJSON( response );
82
+
83
+ if( result.status != 'finish' ){
84
+
85
+ var jsonObject = JSON.stringify(result.data);
86
+
87
+ jsonObject = jsonObject.slice( 1 );
88
+ jsonObject = jsonObject.slice(0, -1);
89
+
90
+ jQuery( '.export-output' ).append( jsonObject + ',' );
91
+
92
+ wsm_export_products( result.offset );
93
+
94
+
95
+ }else{
96
+
97
+ var string = jQuery( '.export-output' ).text();
98
+ string = string.slice(0, -1);
99
+
100
+ string = '{' + string + '}';
101
+
102
+ jQuery( '#csv' ).empty();
103
+ jQuery( '#csv' ).append( 'All done!' );
104
+
105
+ var data = {
106
+ 'action' : 'wsm_get_csv_file',
107
+ 'data' : string
108
+ };
109
+
110
+ jQuery.post(ajaxurl, data, function( response ) {
111
+
112
+ var data, filename, link;
113
+ var csv = convertArrayOfObjectsToCSV({
114
+ datas: JSON.parse( response )
115
+ });
116
+ if (csv == null) return;
117
+
118
+ filename = 'stock-manager-export.csv';
119
+
120
+ if (!csv.match(/^data:text\/csv/i)) {
121
+ csv = 'data:text/csv;charset=utf-8,' + csv;
122
+ }
123
+ data = encodeURI(csv);
124
+
125
+ link = document.createElement('a');
126
+ link.setAttribute('href', data);
127
+ link.setAttribute('download', filename);
128
+ link.click();
129
+
130
+ });
131
+
132
+ }
133
+
134
+
135
+ });
136
+ }
137
+ });
138
+ });
139
+ </script>
140
+ <div class="wrap">
141
+
142
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
143
+
144
+
145
+
146
+
147
+ <div class="t-col-6">
148
+ <div class="toret-box box-info">
149
+ <div class="box-header">
150
+ <h3 class="box-title"><?php _e('Import','woocommerce-stock-manager'); ?></h3>
151
+ </div>
152
+ <div class="box-body">
153
+ <h4><?php _e('You can upload csv file, with your stock data. ','woocommerce-stock-manager'); ?></h4>
154
+ <p><?php _e('CSV file must be in this format, or you can export file with exist data and edit them. ','woocommerce-stock-manager'); ?></p>
155
+ <p><?php _e('If you have a lot of products and export/import not working, increase memory limit.. ','woocommerce-stock-manager'); ?></p>
156
+ <h3><?php _e('File format. ','woocommerce-stock-manager'); ?></h3>
157
+ <table class="table-bordered">
158
+ <tr>
159
+ <td><?php _e('SKU','woocommerce-stock-manager'); ?></td>
160
+ <td><?php _e('Product name','woocommerce-stock-manager'); ?></td>
161
+ <td><?php _e('Manage stock','woocommerce-stock-manager'); ?></td>
162
+ <td><?php _e('Stock status','woocommerce-stock-manager'); ?></td>
163
+ <td><?php _e('Backorders','woocommerce-stock-manager'); ?></td>
164
+ <td><?php _e('Stock','woocommerce-stock-manager'); ?></td>
165
+ <td><?php _e('Product type','woocommerce-stock-manager'); ?></td>
166
+ <td><?php _e('Parent SKU','woocommerce-stock-manager'); ?></td>
167
+ </tr>
168
+ <tr>
169
+ <td><?php _e('111111','woocommerce-stock-manager'); ?></td>
170
+ <td><?php _e('T-shirt','woocommerce-stock-manager'); ?></td>
171
+ <td><?php _e('yes','woocommerce-stock-manager'); ?></td>
172
+ <td><?php _e('instock','woocommerce-stock-manager'); ?></td>
173
+ <td><?php _e('yes','woocommerce-stock-manager'); ?></td>
174
+ <td><?php _e('10','woocommerce-stock-manager'); ?></td>
175
+ <td><?php _e('simple','woocommerce-stock-manager'); ?></td>
176
+ <td></td>
177
+ </tr>
178
+ </table>
179
+
180
+ <ul>
181
+ <li><strong><?php _e('SKU','woocommerce-stock-manager'); ?></strong> <?php _e('product unique identificator, required. Neccessary for import and export.','woocommerce-stock-manager'); ?></li>
182
+ <li><strong><?php _e('Manage stock','woocommerce-stock-manager'); ?></strong> <?php _e('values: "yes", "notify", "no". If is empty "no" will be save.','woocommerce-stock-manager'); ?></li>
183
+ <li><strong><?php _e('Stock status','woocommerce-stock-manager'); ?></strong> <?php _e('values: "instock", "outofstock". If is empty "outofstock" will be save.','woocommerce-stock-manager'); ?></li>
184
+ <li><strong><?php _e('Backorders','woocommerce-stock-manager'); ?></strong> <?php _e('values: "yes", "notify", "no". If is empty "no" will be save.','woocommerce-stock-manager'); ?></li>
185
+ <li><strong><?php _e('Stock','woocommerce-stock-manager'); ?></strong> <?php _e('quantity value. If is empty, 0 will be save.','woocommerce-stock-manager'); ?></li>
186
+ </ul>
187
+
188
+
189
+ <form method="post" action="" class="setting-form" enctype="multipart/form-data">
190
+ <table class="table-bordered">
191
+ <tr>
192
+ <th><?php _e('Upload csv file', 'woocommerce-stock-manager'); ?></th>
193
+ <td>
194
+ <input type="file" name="uploadFile">
195
+ </td>
196
+ </tr>
197
+
198
+ </table>
199
+ <div class="clear"></div>
200
+ <input type="hidden" name="upload" value="ok" />
201
+ <input type="submit" class="btn btn-info" value="<?php _e('Upload', 'woocommerce-stock-manager'); ?>" />
202
+ </form>
203
+ <?php
204
+ if(isset($_POST['upload'])){
205
+
206
+ $target_dir = STOCKDIR.'admin/views/upload/';
207
+ $target_dir = $target_dir . basename( $_FILES["uploadFile"]["name"]);
208
+ $uploadOk = true;
209
+
210
+ if (move_uploaded_file($_FILES["uploadFile"]["tmp_name"], $target_dir)) {
211
+
212
+ echo __('The file '. basename( $_FILES['uploadFile']['name']). ' has been uploaded.','woocommerce-stock-manager');
213
+
214
+ $row = 1;
215
+ if (($handle = fopen($target_dir, "r")) !== FALSE) {
216
+
217
+ while (($data = fgetcsv($handle, 1000, ';')) !== FALSE) {
218
+ $num = count($data);
219
+
220
+ $product_id = stockautoUTF($data[0]);
221
+ $sku = stockautoUTF($data[1]);
222
+ $manage_stock = stockautoUTF($data[3]);
223
+ $stock_status = stockautoUTF($data[4]);
224
+ $backorders = stockautoUTF($data[5]);
225
+ $stock = stockautoUTF($data[6]);
226
+
227
+ if($row != 1){
228
+
229
+ if( !empty( $product_id ) ){
230
+
231
+ $values = array(
232
+ 'manage_stock' => $manage_stock,
233
+ 'backorders' => $stock_status,
234
+ 'stock_status' => $backorders,
235
+ 'stock' => $stock
236
+ );
237
+
238
+ WCM_Save::save_one_item( $data, $product_id );
239
+
240
+ echo '<p>'.__('Product with ID: '.$product_id.' was updated.','woocommerce-stock-manager').'</p>';
241
+
242
+ }
243
+ }
244
+ $row++;
245
+
246
+ }
247
+ fclose($handle);
248
+ }
249
+
250
+ }else{
251
+ echo '<p>'.__('Sorry, there was an error uploading your file.','woocommerce-stock-manager').'</p>';
252
+ }
253
+
254
+ }
255
+ ?>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+
261
+
262
+ <div class="t-col-6">
263
+ <div class="toret-box box-info">
264
+ <div class="box-header">
265
+ <h3 class="box-title"><?php _e('Export','woocommerce-stock-manager'); ?></h3>
266
+ </div>
267
+ <div class="box-body">
268
+ <h4><?php _e('You can download csv file, with your stock data. ','woocommerce-stock-manager'); ?></h4>
269
+ <p><a href="#" class="btn btn-danger product-export"><?php _e('Create export file','woocommerce-stock-manager'); ?></a></p>
270
+ <div class="export-output" style="display:none;"></div>
271
+ <div id="csv" style="display:none;"></div>
272
+ </div>
273
+ </div>
274
+ </div>
275
+
276
+
277
+ </div>
woocommerce-stock-manager/admin/views/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
woocommerce-stock-manager/admin/views/setting.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if( isset( $_POST['save'] ) ){
4
+ if( isset( $_POST['limit'] ) ){
5
+ update_option( 'woocommerce_stock_limit', sanitize_text_field( $_POST['limit'] ) );
6
+ }
7
+ if( isset( $_POST['variable'] ) ){
8
+ update_option( 'woocommerce_stock_variable_stock', sanitize_text_field( $_POST['variable'] ) );
9
+ }else{
10
+ delete_option( 'woocommerce_stock_variable_stock' );
11
+ }
12
+ if( isset( $_POST['step'] ) ){
13
+ update_option( 'woocommerce_stock_qty_step', sanitize_text_field( $_POST['step'] ) );
14
+ }
15
+ }
16
+
17
+ $limit = get_option( 'woocommerce_stock_limit' );
18
+ if( empty( $limit ) ){ $limit = 100; }
19
+ $variable = get_option( 'woocommerce_stock_variable_stock' );
20
+ if( empty( $variable ) ){ $variable = 'no'; }
21
+ $step = get_option( 'woocommerce_stock_qty_step' );
22
+ if( empty( $step ) ){ $step = '1'; }
23
+ ?>
24
+
25
+ <div class="wrap">
26
+
27
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
28
+
29
+ <div class="t-col-6">
30
+ <div class="toret-box box-info">
31
+ <div class="box-header">
32
+ <h3 class="box-title"><?php _e('Stock manager setting','woocommerce-stock-manager'); ?></h3>
33
+ </div>
34
+ <div class="box-body">
35
+ <div class="clear"></div>
36
+ <form method="post" action="" style="position:relative;">
37
+ <table class="table-bordered">
38
+ <tr>
39
+ <th><?php _e('Products limit','woocommerce-stock-manager'); ?></th>
40
+ <td><input type="number" name="limit" value="<?php echo $limit; ?>" start="1" step="1" /></td>
41
+ </tr>
42
+ <tr>
43
+ <th><?php _e('Allow stock for variable products','woocommerce-stock-manager'); ?></th>
44
+ <td><input type="checkbox" name="variable" value="ok" <?php if( $variable == 'ok' ){ echo 'checked="checked"'; } ?> /></td>
45
+ </tr>
46
+ <tr>
47
+ <th><?php _e('Qty input step','woocommerce-stock-manager'); ?></th>
48
+ <td><input type="text" name="step" value="<?php echo $step; ?>" /></td>
49
+ </tr>
50
+ </table>
51
+ <input type="submit" name="save" class="btn btn-danger" />
52
+ </form>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
woocommerce-stock-manager/admin/views/upload/stock-manager-export.csv ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ id;sku;Manage stock;Stock status;Backorders;Stock;Type;Parent ID
2
+ 99;100101;no;instock;no;0;simple;
3
+ 96;100201;yes;instock;yes;12;simple;
4
+ 93;100301;yes;instock;yes;10;variable;
5
+ 139;;yes;instock;yes;100;product-variant;93
6
+ 140;;yes;instock;no;30;product-variant;93
7
+ 141;;yes;instock;no;30;product-variant;93
8
+ 142;;yes;instock;no;0;product-variant;93
9
+ 143;;yes;instock;no;0;product-variant;93
10
+ 131;;yes;instock;no;0;product-variant;93
11
+ 132;;yes;instock;no;0;product-variant;93
12
+ 133;;yes;instock;no;0;product-variant;93
13
+ 134;;yes;instock;no;0;product-variant;93
14
+ 135;;yes;instock;no;0;product-variant;93
15
+ 136;;yes;instock;no;0;product-variant;93
16
+ 137;;yes;instock;no;0;product-variant;93
17
+ 138;;yes;instock;no;0;product-variant;93
18
+ 122;100304;yes;instock;no;0;product-variant;93
19
+ 123;100305;yes;instock;no;0;product-variant;93
20
+ 124;100306;yes;instock;no;0;product-variant;93
21
+ 125;100307;yes;instock;no;0;product-variant;93
22
+ 126;100308;yes;instock;no;0;product-variant;93
23
+ 127;100309;yes;instock;no;0;product-variant;93
24
+ 128;;yes;instock;no;0;product-variant;93
25
+ 129;;yes;instock;no;0;product-variant;93
26
+ 130;;yes;instock;no;0;product-variant;93
27
+ 120;100302;yes;instock;yes;10;product-variant;93
28
+ 121;100303;yes;instock;no;20;product-variant;93
29
+ 90;;no;instock;no;0;simple;
30
+ 87;;yes;instock;no;22;simple;
31
+ 83;;yes;instock;yes;13;simple;
32
+ 79;;no;outofstock;notify;4;simple;
33
+ 76;;yes;instock;no;25;simple;
34
+ 73;;yes;instock;no;33;simple;
35
+ 70;;no;instock;no;24;simple;
36
+ 67;;yes;instock;no;18;simple;
37
+ 60;;yes;instock;no;32;simple;
38
+ 56;;yes;instock;no;26;simple;
39
+ 53;;yes;instock;no;22;simple;
40
+ 50;;yes;instock;no;15;simple;
41
+ 47;;yes;instock;no;18;simple;
42
+ 40;;no;instock;no;0;variable;
43
+ 41;;;;;0;product-variant;40
44
+ 42;;;;;18;product-variant;40
45
+ 37;;yes;instock;no;28;simple;
46
+ 34;;yes;instock;no;29;simple;
47
+ 31;;yes;instock;no;19;simple;
48
+ 22;;no;instock;no;0;variable;
49
+ 24;;;;;0;product-variant;22
50
+ 23;;;;;0;product-variant;22
51
+ 19;;yes;instock;no;21;simple;
52
+ 15;;yes;instock;no;4;simple;
woocommerce-stock-manager/assets/banner-772x250.png ADDED
Binary file
woocommerce-stock-manager/assets/icon-128x128.png ADDED
Binary file
woocommerce-stock-manager/assets/icon-256x256.png ADDED
Binary file
woocommerce-stock-manager/assets/screenshot-1.png ADDED
Binary file
woocommerce-stock-manager/assets/screenshot-2.png ADDED
Binary file
woocommerce-stock-manager/assets/screenshot-3.png ADDED
Binary file
woocommerce-stock-manager/assets/screenshot-4.png ADDED
Binary file
woocommerce-stock-manager/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
woocommerce-stock-manager/languages/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
woocommerce-stock-manager/languages/woocommerce-stock-manager-cs_CZ.mo ADDED
Binary file
woocommerce-stock-manager/languages/woocommerce-stock-manager-cs_CZ.po ADDED
@@ -0,0 +1,397 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WooCommerce Stock Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2018-12-30 09:50+0100\n"
6
+ "PO-Revision-Date: 2018-12-30 09:55+0100\n"
7
+ "Last-Translator: Vladislav Musílek <musilekv@seznam.cz>\n"
8
+ "Language-Team: Toret <info@toret.cz>\n"
9
+ "Language: cs\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 2.2\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ #: ../admin/class-stock-manager-admin.php:144
20
+ #: ../admin/class-stock-manager-admin.php:145
21
+ msgid "WooCommerce Stock Manager"
22
+ msgstr "WooCommerce Stock Manager"
23
+
24
+ #: ../admin/class-stock-manager-admin.php:154
25
+ #: ../admin/class-stock-manager-admin.php:155
26
+ msgid "Import/Export"
27
+ msgstr "Import/Export"
28
+
29
+ #: ../admin/class-stock-manager-admin.php:163
30
+ #: ../admin/class-stock-manager-admin.php:164
31
+ msgid "Setting"
32
+ msgstr "Nastavení"
33
+
34
+ #: ../admin/class-stock-manager-admin.php:208
35
+ msgid "Settings"
36
+ msgstr "Nastavení"
37
+
38
+ #: ../admin/includes/config.php:6 ../admin/includes/config.php:16
39
+ #: ../admin/includes/config.php:21 ../admin/includes/config.php:26
40
+ #: ../admin/includes/config.php:31 ../admin/includes/wcm-class-table.php:244
41
+ #: ../admin/views/import-export.php:159 ../admin/views/import-export.php:181
42
+ msgid "SKU"
43
+ msgstr "SKU"
44
+
45
+ #: ../admin/includes/config.php:11 ../admin/includes/wcm-class-table.php:254
46
+ msgid "ID"
47
+ msgstr "ID"
48
+
49
+ #: ../admin/includes/wcm-class-table.php:104
50
+ #: ../admin/views/components/filter.php:122
51
+ msgid "Tax status"
52
+ msgstr ""
53
+
54
+ #: ../admin/includes/wcm-class-table.php:107
55
+ #: ../admin/views/components/filter.php:124
56
+ msgid "Tax class"
57
+ msgstr ""
58
+
59
+ #: ../admin/includes/wcm-class-table.php:110
60
+ #: ../admin/views/components/filter.php:126
61
+ msgid "Shipping class"
62
+ msgstr ""
63
+
64
+ #: ../admin/includes/wcm-class-table.php:234
65
+ #: ../admin/views/components/filter.php:104
66
+ msgid "Thumbnail"
67
+ msgstr ""
68
+
69
+ #: ../admin/includes/wcm-class-table.php:264
70
+ msgid "Name"
71
+ msgstr "Jméno"
72
+
73
+ #: ../admin/includes/wcm-class-table.php:274
74
+ #: ../admin/views/import-export.php:165
75
+ msgid "Product type"
76
+ msgstr "Typ produktu"
77
+
78
+ #: ../admin/includes/wcm-class-table.php:284
79
+ msgid "Parent ID"
80
+ msgstr "ID rodiče"
81
+
82
+ #: ../admin/includes/wcm-class-table.php:294
83
+ #: ../admin/views/components/filter.php:106
84
+ msgid "Price"
85
+ msgstr "Cena"
86
+
87
+ #: ../admin/includes/wcm-class-table.php:304
88
+ msgid "Sale price"
89
+ msgstr "Sleva"
90
+
91
+ #: ../admin/includes/wcm-class-table.php:314
92
+ #: ../admin/views/components/filter.php:110
93
+ msgid "Weight"
94
+ msgstr "Hmotnost"
95
+
96
+ #: ../admin/includes/wcm-class-table.php:324
97
+ #: ../admin/views/components/filter.php:40
98
+ #: ../admin/views/components/filter.php:112
99
+ #: ../admin/views/import-export.php:161 ../admin/views/import-export.php:182
100
+ msgid "Manage stock"
101
+ msgstr "Spravovat sklad"
102
+
103
+ #: ../admin/includes/wcm-class-table.php:334
104
+ #: ../admin/views/components/filter.php:46
105
+ #: ../admin/views/components/filter.php:114
106
+ #: ../admin/views/import-export.php:162 ../admin/views/import-export.php:183
107
+ msgid "Stock status"
108
+ msgstr "Stav skladu"
109
+
110
+ #: ../admin/includes/wcm-class-table.php:344
111
+ #: ../admin/views/components/filter.php:116
112
+ #: ../admin/views/import-export.php:163 ../admin/views/import-export.php:184
113
+ msgid "Backorders"
114
+ msgstr "Objednávání"
115
+
116
+ #: ../admin/includes/wcm-class-table.php:354
117
+ #: ../admin/views/components/filter.php:118
118
+ #: ../admin/views/import-export.php:164 ../admin/views/import-export.php:185
119
+ msgid "Stock"
120
+ msgstr "Skladem"
121
+
122
+ #: ../admin/includes/wcm-class-table.php:364
123
+ #: ../admin/includes/wcm-class-table.php:412
124
+ #: ../admin/includes/wcm-class-table.php:444
125
+ #: ../admin/includes/wcm-class-table.php:739
126
+ msgid "Save"
127
+ msgstr "Uložit"
128
+
129
+ #: ../admin/includes/wcm-class-table.php:413
130
+ #: ../admin/includes/wcm-class-table.php:445
131
+ msgid "Close"
132
+ msgstr "Zavřít"
133
+
134
+ #: ../admin/includes/wcm-class-table.php:460 ../admin/views/admin.php:79
135
+ msgid "Show variables"
136
+ msgstr "Zobrazit varianty"
137
+
138
+ #: ../admin/includes/wcm-class-table.php:480
139
+ msgid "Taxable"
140
+ msgstr ""
141
+
142
+ #: ../admin/includes/wcm-class-table.php:481
143
+ msgid "Shipping only"
144
+ msgstr ""
145
+
146
+ #: ../admin/includes/wcm-class-table.php:538
147
+ msgid "Same as parent"
148
+ msgstr ""
149
+
150
+ #: ../admin/includes/wcm-class-table.php:540
151
+ msgid "No shipping class"
152
+ msgstr ""
153
+
154
+ #: ../admin/includes/wcm-class-table.php:632
155
+ #: ../admin/includes/wcm-class-table.php:665
156
+ msgid "Yes"
157
+ msgstr "Ano"
158
+
159
+ #: ../admin/includes/wcm-class-table.php:633
160
+ #: ../admin/includes/wcm-class-table.php:663
161
+ msgid "No"
162
+ msgstr "Ne"
163
+
164
+ #: ../admin/includes/wcm-class-table.php:647
165
+ #: ../admin/views/components/filter.php:47
166
+ msgid "In stock"
167
+ msgstr "Skladem"
168
+
169
+ #: ../admin/includes/wcm-class-table.php:648
170
+ #: ../admin/views/components/filter.php:48
171
+ msgid "Out of stock"
172
+ msgstr "Není skladem"
173
+
174
+ #: ../admin/includes/wcm-class-table.php:649
175
+ msgid "On backorder"
176
+ msgstr "Na objednávku"
177
+
178
+ #: ../admin/includes/wcm-class-table.php:664
179
+ msgid "Notify"
180
+ msgstr "Upozornit"
181
+
182
+ #: ../admin/views/admin.php:44
183
+ msgid "Stock manager"
184
+ msgstr "Stock manager"
185
+
186
+ #: ../admin/views/admin.php:151
187
+ msgid "Save all"
188
+ msgstr "Uložit vše"
189
+
190
+ #: ../admin/views/components/filter.php:3
191
+ msgid "Filter"
192
+ msgstr "Filtr"
193
+
194
+ #: ../admin/views/components/filter.php:4
195
+ #: ../admin/views/components/filter.php:63
196
+ msgid "Search by sku"
197
+ msgstr "Hledat dle sku"
198
+
199
+ #: ../admin/views/components/filter.php:5
200
+ #: ../admin/views/components/filter.php:73
201
+ msgid "Search by product name"
202
+ msgstr "Hledat dle názvu produktu"
203
+
204
+ #: ../admin/views/components/filter.php:6
205
+ msgid "Display setting"
206
+ msgstr "Nastavení zobrazení"
207
+
208
+ #: ../admin/views/components/filter.php:15
209
+ msgid "Order by"
210
+ msgstr "Řadit dle"
211
+
212
+ #: ../admin/views/components/filter.php:16
213
+ msgid "Product name ASC"
214
+ msgstr "Název produktu A-Z"
215
+
216
+ #: ../admin/views/components/filter.php:17
217
+ msgid "Product name DESC"
218
+ msgstr "název produktu Z-A"
219
+
220
+ #: ../admin/views/components/filter.php:18
221
+ msgid "SKU ASC"
222
+ msgstr "SKU vzestupně"
223
+
224
+ #: ../admin/views/components/filter.php:19
225
+ msgid "SKU DESC"
226
+ msgstr "SKU sestupně"
227
+
228
+ #: ../admin/views/components/filter.php:23
229
+ msgid "Simple products"
230
+ msgstr "Jednoduché produkty"
231
+
232
+ #: ../admin/views/components/filter.php:24
233
+ msgid "Products with variation"
234
+ msgstr "Produkty s variantami"
235
+
236
+ #: ../admin/views/components/filter.php:28
237
+ msgid "All categories"
238
+ msgstr "Všechny kategorie"
239
+
240
+ #: ../admin/views/components/filter.php:41
241
+ msgid "No manage stock"
242
+ msgstr "Ne spravovat sklad"
243
+
244
+ #: ../admin/views/components/filter.php:42
245
+ msgid "Yes manage stock"
246
+ msgstr "Ano spravovat sklad"
247
+
248
+ #: ../admin/views/components/filter.php:52
249
+ msgid "Show"
250
+ msgstr "Zobrazit"
251
+
252
+ #: ../admin/views/components/filter.php:54
253
+ msgid "Clear filter"
254
+ msgstr "Vyčistit filter"
255
+
256
+ #: ../admin/views/components/filter.php:101
257
+ msgid "Hide or display cells"
258
+ msgstr "Skrýt, nebo zobrazit buňky"
259
+
260
+ #: ../admin/views/components/filter.php:108
261
+ msgid "Sales price"
262
+ msgstr "Sleva"
263
+
264
+ #: ../admin/views/components/filter.php:142
265
+ msgid "Save setting"
266
+ msgstr "Uložit nastavení"
267
+
268
+ #: ../admin/views/import-export.php:150
269
+ msgid "Import"
270
+ msgstr "Importovat"
271
+
272
+ #: ../admin/views/import-export.php:153
273
+ msgid "You can upload csv file, with your stock data. "
274
+ msgstr "Můžete nahrát váš csv soubor se skladovými daty."
275
+
276
+ #: ../admin/views/import-export.php:154
277
+ msgid ""
278
+ "CSV file must be in this format, or you can export file with exist data and "
279
+ "edit them. "
280
+ msgstr ""
281
+ "CSV soubor musí být v následujícím formátu, nebo si můžete vyexportovat již "
282
+ "existující data a upravit je."
283
+
284
+ #: ../admin/views/import-export.php:155
285
+ msgid ""
286
+ "If you have a lot of products and export/import not working, increase memory "
287
+ "limit.. "
288
+ msgstr ""
289
+
290
+ #: ../admin/views/import-export.php:156
291
+ msgid "File format. "
292
+ msgstr "Formát souboru."
293
+
294
+ #: ../admin/views/import-export.php:160
295
+ msgid "Product name"
296
+ msgstr "Název produktu"
297
+
298
+ #: ../admin/views/import-export.php:166
299
+ msgid "Parent SKU"
300
+ msgstr "SKU rodiče"
301
+
302
+ #: ../admin/views/import-export.php:169
303
+ msgid "111111"
304
+ msgstr "111111"
305
+
306
+ #: ../admin/views/import-export.php:170
307
+ msgid "T-shirt"
308
+ msgstr ""
309
+
310
+ #: ../admin/views/import-export.php:171 ../admin/views/import-export.php:173
311
+ msgid "yes"
312
+ msgstr "yes"
313
+
314
+ #: ../admin/views/import-export.php:172
315
+ msgid "instock"
316
+ msgstr "instock"
317
+
318
+ #: ../admin/views/import-export.php:174
319
+ msgid "10"
320
+ msgstr "10"
321
+
322
+ #: ../admin/views/import-export.php:175
323
+ msgid "simple"
324
+ msgstr "simple"
325
+
326
+ #: ../admin/views/import-export.php:181
327
+ msgid ""
328
+ "product unique identificator, required. Neccessary for import and export."
329
+ msgstr ""
330
+
331
+ #: ../admin/views/import-export.php:182 ../admin/views/import-export.php:184
332
+ msgid "values: \"yes\", \"notify\", \"no\". If is empty \"no\" will be save."
333
+ msgstr ""
334
+
335
+ #: ../admin/views/import-export.php:183
336
+ msgid ""
337
+ "values: \"instock\", \"outofstock\". If is empty \"outofstock\" will be save."
338
+ msgstr ""
339
+
340
+ #: ../admin/views/import-export.php:185
341
+ msgid "quantity value. If is empty, 0 will be save."
342
+ msgstr ""
343
+
344
+ #: ../admin/views/import-export.php:192
345
+ msgid "Upload csv file"
346
+ msgstr "Nahrát csv soubor"
347
+
348
+ #: ../admin/views/import-export.php:201
349
+ msgid "Upload"
350
+ msgstr "Nahrát"
351
+
352
+ #: ../admin/views/import-export.php:212
353
+ msgid "The file "
354
+ msgstr "Soubor"
355
+
356
+ #: ../admin/views/import-export.php:240
357
+ msgid "Product with ID: "
358
+ msgstr "Produkt s ID:"
359
+
360
+ #: ../admin/views/import-export.php:251
361
+ msgid "Sorry, there was an error uploading your file."
362
+ msgstr ""
363
+
364
+ #: ../admin/views/import-export.php:265
365
+ msgid "Export"
366
+ msgstr "Export"
367
+
368
+ #: ../admin/views/import-export.php:268
369
+ msgid "You can download csv file, with your stock data. "
370
+ msgstr "Můžete stáhnout csv soubor, s vašimi daty."
371
+
372
+ #: ../admin/views/import-export.php:269
373
+ msgid "Create export file"
374
+ msgstr "Vytvořit soubor exportu"
375
+
376
+ #: ../admin/views/setting.php:32
377
+ msgid "Stock manager setting"
378
+ msgstr "Stock manager nastavení"
379
+
380
+ #: ../admin/views/setting.php:39
381
+ msgid "Products limit"
382
+ msgstr ""
383
+
384
+ #: ../admin/views/setting.php:43
385
+ msgid "Allow stock for variable products"
386
+ msgstr ""
387
+
388
+ #: ../admin/views/setting.php:47
389
+ msgid "Qty input step"
390
+ msgstr ""
391
+
392
+ #: ../woocommerce-stock-manager.php:313
393
+ msgid "All done! Close."
394
+ msgstr ""
395
+
396
+ #~ msgid "Show wariables"
397
+ #~ msgstr "Zobrazit varianty"
woocommerce-stock-manager/languages/woocommerce-stock-manager-es_ES.mo ADDED
Binary file
woocommerce-stock-manager/languages/woocommerce-stock-manager-es_ES.po ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Stock-Manager Español\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2018-12-30 09:56+0100\n"
6
+ "PO-Revision-Date: 2018-12-30 09:56+0100\n"
7
+ "Last-Translator: Vladislav Musílek <musilekv@seznam.cz>\n"
8
+ "Language-Team: InditecGroup.com <info@inditecgroup.com>\n"
9
+ "Language: es_ES\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 2.2\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../admin/class-stock-manager-admin.php:144
21
+ #: ../admin/class-stock-manager-admin.php:145
22
+ msgid "WooCommerce Stock Manager"
23
+ msgstr "WooCommerce Stock Manager"
24
+
25
+ #: ../admin/class-stock-manager-admin.php:154
26
+ #: ../admin/class-stock-manager-admin.php:155
27
+ msgid "Import/Export"
28
+ msgstr "Importar/Exportar"
29
+
30
+ #: ../admin/class-stock-manager-admin.php:163
31
+ #: ../admin/class-stock-manager-admin.php:164
32
+ msgid "Setting"
33
+ msgstr ""
34
+
35
+ #: ../admin/class-stock-manager-admin.php:208
36
+ msgid "Settings"
37
+ msgstr "Configuraciones"
38
+
39
+ #: ../admin/includes/config.php:6 ../admin/includes/config.php:16
40
+ #: ../admin/includes/config.php:21 ../admin/includes/config.php:26
41
+ #: ../admin/includes/config.php:31 ../admin/includes/wcm-class-table.php:244
42
+ #: ../admin/views/import-export.php:159 ../admin/views/import-export.php:181
43
+ msgid "SKU"
44
+ msgstr "Nº Referencia"
45
+
46
+ #: ../admin/includes/config.php:11 ../admin/includes/wcm-class-table.php:254
47
+ msgid "ID"
48
+ msgstr "ID"
49
+
50
+ #: ../admin/includes/wcm-class-table.php:104
51
+ #: ../admin/views/components/filter.php:122
52
+ msgid "Tax status"
53
+ msgstr ""
54
+
55
+ #: ../admin/includes/wcm-class-table.php:107
56
+ #: ../admin/views/components/filter.php:124
57
+ msgid "Tax class"
58
+ msgstr ""
59
+
60
+ #: ../admin/includes/wcm-class-table.php:110
61
+ #: ../admin/views/components/filter.php:126
62
+ msgid "Shipping class"
63
+ msgstr ""
64
+
65
+ #: ../admin/includes/wcm-class-table.php:234
66
+ #: ../admin/views/components/filter.php:104
67
+ msgid "Thumbnail"
68
+ msgstr ""
69
+
70
+ #: ../admin/includes/wcm-class-table.php:264
71
+ msgid "Name"
72
+ msgstr "Nombre"
73
+
74
+ #: ../admin/includes/wcm-class-table.php:274
75
+ #: ../admin/views/import-export.php:165
76
+ msgid "Product type"
77
+ msgstr "Tipo de producto"
78
+
79
+ #: ../admin/includes/wcm-class-table.php:284
80
+ msgid "Parent ID"
81
+ msgstr "ID padre"
82
+
83
+ #: ../admin/includes/wcm-class-table.php:294
84
+ #: ../admin/views/components/filter.php:106
85
+ msgid "Price"
86
+ msgstr ""
87
+
88
+ #: ../admin/includes/wcm-class-table.php:304
89
+ msgid "Sale price"
90
+ msgstr ""
91
+
92
+ #: ../admin/includes/wcm-class-table.php:314
93
+ #: ../admin/views/components/filter.php:110
94
+ msgid "Weight"
95
+ msgstr ""
96
+
97
+ #: ../admin/includes/wcm-class-table.php:324
98
+ #: ../admin/views/components/filter.php:40
99
+ #: ../admin/views/components/filter.php:112
100
+ #: ../admin/views/import-export.php:161 ../admin/views/import-export.php:182
101
+ msgid "Manage stock"
102
+ msgstr "Gestionar stock"
103
+
104
+ #: ../admin/includes/wcm-class-table.php:334
105
+ #: ../admin/views/components/filter.php:46
106
+ #: ../admin/views/components/filter.php:114
107
+ #: ../admin/views/import-export.php:162 ../admin/views/import-export.php:183
108
+ msgid "Stock status"
109
+ msgstr "Estado del stock"
110
+
111
+ #: ../admin/includes/wcm-class-table.php:344
112
+ #: ../admin/views/components/filter.php:116
113
+ #: ../admin/views/import-export.php:163 ../admin/views/import-export.php:184
114
+ msgid "Backorders"
115
+ msgstr "Pedidos pendientes"
116
+
117
+ #: ../admin/includes/wcm-class-table.php:354
118
+ #: ../admin/views/components/filter.php:118
119
+ #: ../admin/views/import-export.php:164 ../admin/views/import-export.php:185
120
+ msgid "Stock"
121
+ msgstr "Stock"
122
+
123
+ #: ../admin/includes/wcm-class-table.php:364
124
+ #: ../admin/includes/wcm-class-table.php:412
125
+ #: ../admin/includes/wcm-class-table.php:444
126
+ #: ../admin/includes/wcm-class-table.php:739
127
+ msgid "Save"
128
+ msgstr "Guardar"
129
+
130
+ #: ../admin/includes/wcm-class-table.php:413
131
+ #: ../admin/includes/wcm-class-table.php:445
132
+ msgid "Close"
133
+ msgstr ""
134
+
135
+ #: ../admin/includes/wcm-class-table.php:460 ../admin/views/admin.php:79
136
+ msgid "Show variables"
137
+ msgstr ""
138
+
139
+ #: ../admin/includes/wcm-class-table.php:480
140
+ msgid "Taxable"
141
+ msgstr ""
142
+
143
+ #: ../admin/includes/wcm-class-table.php:481
144
+ msgid "Shipping only"
145
+ msgstr ""
146
+
147
+ #: ../admin/includes/wcm-class-table.php:538
148
+ msgid "Same as parent"
149
+ msgstr ""
150
+
151
+ #: ../admin/includes/wcm-class-table.php:540
152
+ msgid "No shipping class"
153
+ msgstr ""
154
+
155
+ #: ../admin/includes/wcm-class-table.php:632
156
+ #: ../admin/includes/wcm-class-table.php:665
157
+ msgid "Yes"
158
+ msgstr "Sí"
159
+
160
+ #: ../admin/includes/wcm-class-table.php:633
161
+ #: ../admin/includes/wcm-class-table.php:663
162
+ msgid "No"
163
+ msgstr "No"
164
+
165
+ #: ../admin/includes/wcm-class-table.php:647
166
+ #: ../admin/views/components/filter.php:47
167
+ msgid "In stock"
168
+ msgstr "En stock"
169
+
170
+ #: ../admin/includes/wcm-class-table.php:648
171
+ #: ../admin/views/components/filter.php:48
172
+ msgid "Out of stock"
173
+ msgstr "Agotado"
174
+
175
+ #: ../admin/includes/wcm-class-table.php:649
176
+ msgid "On backorder"
177
+ msgstr ""
178
+
179
+ #: ../admin/includes/wcm-class-table.php:664
180
+ msgid "Notify"
181
+ msgstr "Notificar"
182
+
183
+ #: ../admin/views/admin.php:44
184
+ msgid "Stock manager"
185
+ msgstr "Administrador de stock"
186
+
187
+ #: ../admin/views/admin.php:151
188
+ msgid "Save all"
189
+ msgstr "Guardar todo"
190
+
191
+ #: ../admin/views/components/filter.php:3
192
+ msgid "Filter"
193
+ msgstr ""
194
+
195
+ #: ../admin/views/components/filter.php:4
196
+ #: ../admin/views/components/filter.php:63
197
+ msgid "Search by sku"
198
+ msgstr ""
199
+
200
+ #: ../admin/views/components/filter.php:5
201
+ #: ../admin/views/components/filter.php:73
202
+ msgid "Search by product name"
203
+ msgstr ""
204
+
205
+ #: ../admin/views/components/filter.php:6
206
+ msgid "Display setting"
207
+ msgstr ""
208
+
209
+ #: ../admin/views/components/filter.php:15
210
+ msgid "Order by"
211
+ msgstr ""
212
+
213
+ #: ../admin/views/components/filter.php:16
214
+ msgid "Product name ASC"
215
+ msgstr ""
216
+
217
+ #: ../admin/views/components/filter.php:17
218
+ msgid "Product name DESC"
219
+ msgstr ""
220
+
221
+ #: ../admin/views/components/filter.php:18
222
+ msgid "SKU ASC"
223
+ msgstr ""
224
+
225
+ #: ../admin/views/components/filter.php:19
226
+ msgid "SKU DESC"
227
+ msgstr ""
228
+
229
+ #: ../admin/views/components/filter.php:23
230
+ msgid "Simple products"
231
+ msgstr "Productos simples"
232
+
233
+ #: ../admin/views/components/filter.php:24
234
+ msgid "Products with variation"
235
+ msgstr "Productos variables"
236
+
237
+ #: ../admin/views/components/filter.php:28
238
+ msgid "All categories"
239
+ msgstr "Todas las categorías"
240
+
241
+ #: ../admin/views/components/filter.php:41
242
+ msgid "No manage stock"
243
+ msgstr "No gestionar stock"
244
+
245
+ #: ../admin/views/components/filter.php:42
246
+ msgid "Yes manage stock"
247
+ msgstr "Sí gestionar stock"
248
+
249
+ #: ../admin/views/components/filter.php:52
250
+ msgid "Show"
251
+ msgstr "Mostrar"
252
+
253
+ #: ../admin/views/components/filter.php:54
254
+ msgid "Clear filter"
255
+ msgstr "Limpiar filtro"
256
+
257
+ #: ../admin/views/components/filter.php:101
258
+ msgid "Hide or display cells"
259
+ msgstr ""
260
+
261
+ #: ../admin/views/components/filter.php:108
262
+ msgid "Sales price"
263
+ msgstr ""
264
+
265
+ #: ../admin/views/components/filter.php:142
266
+ msgid "Save setting"
267
+ msgstr ""
268
+
269
+ #: ../admin/views/import-export.php:150
270
+ msgid "Import"
271
+ msgstr "Importar"
272
+
273
+ #: ../admin/views/import-export.php:153
274
+ msgid "You can upload csv file, with your stock data. "
275
+ msgstr "Usted puede subir un archivo csv, con su información de stock."
276
+
277
+ #: ../admin/views/import-export.php:154
278
+ msgid ""
279
+ "CSV file must be in this format, or you can export file with exist data and "
280
+ "edit them. "
281
+ msgstr ""
282
+ "El archivo CSV debe estar en este forma, o usted puede exportar el archivo "
283
+ "con la información existente y editarlo."
284
+
285
+ #: ../admin/views/import-export.php:155
286
+ msgid ""
287
+ "If you have a lot of products and export/import not working, increase memory "
288
+ "limit.. "
289
+ msgstr ""
290
+
291
+ #: ../admin/views/import-export.php:156
292
+ msgid "File format. "
293
+ msgstr "Formato del archivo."
294
+
295
+ #: ../admin/views/import-export.php:160
296
+ msgid "Product name"
297
+ msgstr ""
298
+
299
+ #: ../admin/views/import-export.php:166
300
+ msgid "Parent SKU"
301
+ msgstr "Nº Referencia padre"
302
+
303
+ #: ../admin/views/import-export.php:169
304
+ msgid "111111"
305
+ msgstr "111111"
306
+
307
+ #: ../admin/views/import-export.php:170
308
+ msgid "T-shirt"
309
+ msgstr ""
310
+
311
+ #: ../admin/views/import-export.php:171 ../admin/views/import-export.php:173
312
+ msgid "yes"
313
+ msgstr "Sí"
314
+
315
+ #: ../admin/views/import-export.php:172
316
+ msgid "instock"
317
+ msgstr "En stock"
318
+
319
+ #: ../admin/views/import-export.php:174
320
+ msgid "10"
321
+ msgstr "10"
322
+
323
+ #: ../admin/views/import-export.php:175
324
+ msgid "simple"
325
+ msgstr "simple"
326
+
327
+ #: ../admin/views/import-export.php:181
328
+ msgid ""
329
+ "product unique identificator, required. Neccessary for import and export."
330
+ msgstr ""
331
+ "producto de identificación único, requerido. Necesario para la importación y "
332
+ "exportación."
333
+
334
+ #: ../admin/views/import-export.php:182 ../admin/views/import-export.php:184
335
+ msgid "values: \"yes\", \"notify\", \"no\". If is empty \"no\" will be save."
336
+ msgstr ""
337
+ "Valores: \"sí\",\"notificar\",\"no\". Si está vacío \"no\" se guardará."
338
+
339
+ #: ../admin/views/import-export.php:183
340
+ msgid ""
341
+ "values: \"instock\", \"outofstock\". If is empty \"outofstock\" will be save."
342
+ msgstr ""
343
+ "Valores: \"En stock\",\"Agotado\". Si está vacío \"Agotado\" se guardará."
344
+
345
+ #: ../admin/views/import-export.php:185
346
+ msgid "quantity value. If is empty, 0 will be save."
347
+ msgstr "valor de cantidad. Si está vacío, se guardará 0."
348
+
349
+ #: ../admin/views/import-export.php:192
350
+ msgid "Upload csv file"
351
+ msgstr "Subir archivo csv"
352
+
353
+ #: ../admin/views/import-export.php:201
354
+ msgid "Upload"
355
+ msgstr "Subir"
356
+
357
+ #: ../admin/views/import-export.php:212
358
+ msgid "The file "
359
+ msgstr "El archivo"
360
+
361
+ #: ../admin/views/import-export.php:240
362
+ msgid "Product with ID: "
363
+ msgstr ""
364
+
365
+ #: ../admin/views/import-export.php:251
366
+ msgid "Sorry, there was an error uploading your file."
367
+ msgstr "Perdón, ocurrió un error subiendo el archivo."
368
+
369
+ #: ../admin/views/import-export.php:265
370
+ msgid "Export"
371
+ msgstr "Exportar"
372
+
373
+ #: ../admin/views/import-export.php:268
374
+ msgid "You can download csv file, with your stock data. "
375
+ msgstr "Usted puede descargar un archivo csv, con su información de stock."
376
+
377
+ #: ../admin/views/import-export.php:269
378
+ msgid "Create export file"
379
+ msgstr "Crear archivo de exportación"
380
+
381
+ #: ../admin/views/setting.php:32
382
+ msgid "Stock manager setting"
383
+ msgstr ""
384
+
385
+ #: ../admin/views/setting.php:39
386
+ msgid "Products limit"
387
+ msgstr ""
388
+
389
+ #: ../admin/views/setting.php:43
390
+ msgid "Allow stock for variable products"
391
+ msgstr ""
392
+
393
+ #: ../admin/views/setting.php:47
394
+ msgid "Qty input step"
395
+ msgstr ""
396
+
397
+ #: ../woocommerce-stock-manager.php:313
398
+ msgid "All done! Close."
399
+ msgstr ""
400
+
401
+ #~ msgid "Show wariables"
402
+ #~ msgstr "Mostrar variables"
403
+
404
+ #~ msgid "Product with SKU: "
405
+ #~ msgstr "Producto con Nº Referencia"
woocommerce-stock-manager/languages/woocommerce-stock-manager-fa_IR.mo ADDED
Binary file
woocommerce-stock-manager/languages/woocommerce-stock-manager-fa_IR.po ADDED
@@ -0,0 +1,409 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WooCommerce Stock Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2018-12-30 09:56+0100\n"
6
+ "PO-Revision-Date: 2018-12-30 09:57+0100\n"
7
+ "Last-Translator: Vladislav Musílek <musilekv@seznam.cz>\n"
8
+ "Language-Team: Saakhtani <info@saakhtani.ir>\n"
9
+ "Language: fa_IR\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 2.2\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../admin/class-stock-manager-admin.php:144
21
+ #: ../admin/class-stock-manager-admin.php:145
22
+ msgid "WooCommerce Stock Manager"
23
+ msgstr "مدیریت موجودی ووکامرس"
24
+
25
+ #: ../admin/class-stock-manager-admin.php:154
26
+ #: ../admin/class-stock-manager-admin.php:155
27
+ msgid "Import/Export"
28
+ msgstr "ورود و خروج"
29
+
30
+ #: ../admin/class-stock-manager-admin.php:163
31
+ #: ../admin/class-stock-manager-admin.php:164
32
+ msgid "Setting"
33
+ msgstr ""
34
+
35
+ #: ../admin/class-stock-manager-admin.php:208
36
+ msgid "Settings"
37
+ msgstr "تنظیمات"
38
+
39
+ #: ../admin/includes/config.php:6 ../admin/includes/config.php:16
40
+ #: ../admin/includes/config.php:21 ../admin/includes/config.php:26
41
+ #: ../admin/includes/config.php:31 ../admin/includes/wcm-class-table.php:244
42
+ #: ../admin/views/import-export.php:159 ../admin/views/import-export.php:181
43
+ msgid "SKU"
44
+ msgstr "SKU"
45
+
46
+ #: ../admin/includes/config.php:11 ../admin/includes/wcm-class-table.php:254
47
+ msgid "ID"
48
+ msgstr "ID"
49
+
50
+ #: ../admin/includes/wcm-class-table.php:104
51
+ #: ../admin/views/components/filter.php:122
52
+ msgid "Tax status"
53
+ msgstr ""
54
+
55
+ #: ../admin/includes/wcm-class-table.php:107
56
+ #: ../admin/views/components/filter.php:124
57
+ msgid "Tax class"
58
+ msgstr ""
59
+
60
+ #: ../admin/includes/wcm-class-table.php:110
61
+ #: ../admin/views/components/filter.php:126
62
+ msgid "Shipping class"
63
+ msgstr ""
64
+
65
+ #: ../admin/includes/wcm-class-table.php:234
66
+ #: ../admin/views/components/filter.php:104
67
+ msgid "Thumbnail"
68
+ msgstr ""
69
+
70
+ #: ../admin/includes/wcm-class-table.php:264
71
+ msgid "Name"
72
+ msgstr "نام"
73
+
74
+ #: ../admin/includes/wcm-class-table.php:274
75
+ #: ../admin/views/import-export.php:165
76
+ msgid "Product type"
77
+ msgstr "نوع کالا"
78
+
79
+ #: ../admin/includes/wcm-class-table.php:284
80
+ msgid "Parent ID"
81
+ msgstr "شناسه والد"
82
+
83
+ #: ../admin/includes/wcm-class-table.php:294
84
+ #: ../admin/views/components/filter.php:106
85
+ msgid "Price"
86
+ msgstr ""
87
+
88
+ #: ../admin/includes/wcm-class-table.php:304
89
+ msgid "Sale price"
90
+ msgstr ""
91
+
92
+ #: ../admin/includes/wcm-class-table.php:314
93
+ #: ../admin/views/components/filter.php:110
94
+ msgid "Weight"
95
+ msgstr ""
96
+
97
+ #: ../admin/includes/wcm-class-table.php:324
98
+ #: ../admin/views/components/filter.php:40
99
+ #: ../admin/views/components/filter.php:112
100
+ #: ../admin/views/import-export.php:161 ../admin/views/import-export.php:182
101
+ msgid "Manage stock"
102
+ msgstr "مدیریت موجودی"
103
+
104
+ #: ../admin/includes/wcm-class-table.php:334
105
+ #: ../admin/views/components/filter.php:46
106
+ #: ../admin/views/components/filter.php:114
107
+ #: ../admin/views/import-export.php:162 ../admin/views/import-export.php:183
108
+ msgid "Stock status"
109
+ msgstr "وضعیت موجودی"
110
+
111
+ #: ../admin/includes/wcm-class-table.php:344
112
+ #: ../admin/views/components/filter.php:116
113
+ #: ../admin/views/import-export.php:163 ../admin/views/import-export.php:184
114
+ msgid "Backorders"
115
+ msgstr "سفارش دوباره"
116
+
117
+ #: ../admin/includes/wcm-class-table.php:354
118
+ #: ../admin/views/components/filter.php:118
119
+ #: ../admin/views/import-export.php:164 ../admin/views/import-export.php:185
120
+ msgid "Stock"
121
+ msgstr "موجودی"
122
+
123
+ #: ../admin/includes/wcm-class-table.php:364
124
+ #: ../admin/includes/wcm-class-table.php:412
125
+ #: ../admin/includes/wcm-class-table.php:444
126
+ #: ../admin/includes/wcm-class-table.php:739
127
+ msgid "Save"
128
+ msgstr "ذخیره"
129
+
130
+ #: ../admin/includes/wcm-class-table.php:413
131
+ #: ../admin/includes/wcm-class-table.php:445
132
+ msgid "Close"
133
+ msgstr ""
134
+
135
+ #: ../admin/includes/wcm-class-table.php:460 ../admin/views/admin.php:79
136
+ msgid "Show variables"
137
+ msgstr ""
138
+
139
+ #: ../admin/includes/wcm-class-table.php:480
140
+ msgid "Taxable"
141
+ msgstr ""
142
+
143
+ #: ../admin/includes/wcm-class-table.php:481
144
+ msgid "Shipping only"
145
+ msgstr ""
146
+
147
+ #: ../admin/includes/wcm-class-table.php:538
148
+ msgid "Same as parent"
149
+ msgstr ""
150
+
151
+ #: ../admin/includes/wcm-class-table.php:540
152
+ msgid "No shipping class"
153
+ msgstr ""
154
+
155
+ #: ../admin/includes/wcm-class-table.php:632
156
+ #: ../admin/includes/wcm-class-table.php:665
157
+ msgid "Yes"
158
+ msgstr "بله"
159
+
160
+ #: ../admin/includes/wcm-class-table.php:633
161
+ #: ../admin/includes/wcm-class-table.php:663
162
+ msgid "No"
163
+ msgstr "خیر"
164
+
165
+ #: ../admin/includes/wcm-class-table.php:647
166
+ #: ../admin/views/components/filter.php:47
167
+ msgid "In stock"
168
+ msgstr "موجود"
169
+
170
+ #: ../admin/includes/wcm-class-table.php:648
171
+ #: ../admin/views/components/filter.php:48
172
+ msgid "Out of stock"
173
+ msgstr "نا موجود"
174
+
175
+ #: ../admin/includes/wcm-class-table.php:649
176
+ msgid "On backorder"
177
+ msgstr ""
178
+
179
+ #: ../admin/includes/wcm-class-table.php:664
180
+ msgid "Notify"
181
+ msgstr "آگاه کن"
182
+
183
+ #: ../admin/views/admin.php:44
184
+ msgid "Stock manager"
185
+ msgstr "مدیریت موجودی"
186
+
187
+ #: ../admin/views/admin.php:151
188
+ msgid "Save all"
189
+ msgstr "ذخیره همه موارد"
190
+
191
+ #: ../admin/views/components/filter.php:3
192
+ msgid "Filter"
193
+ msgstr ""
194
+
195
+ #: ../admin/views/components/filter.php:4
196
+ #: ../admin/views/components/filter.php:63
197
+ msgid "Search by sku"
198
+ msgstr ""
199
+
200
+ #: ../admin/views/components/filter.php:5
201
+ #: ../admin/views/components/filter.php:73
202
+ msgid "Search by product name"
203
+ msgstr ""
204
+
205
+ #: ../admin/views/components/filter.php:6
206
+ msgid "Display setting"
207
+ msgstr ""
208
+
209
+ #: ../admin/views/components/filter.php:15
210
+ msgid "Order by"
211
+ msgstr ""
212
+
213
+ #: ../admin/views/components/filter.php:16
214
+ msgid "Product name ASC"
215
+ msgstr ""
216
+
217
+ #: ../admin/views/components/filter.php:17
218
+ msgid "Product name DESC"
219
+ msgstr ""
220
+
221
+ #: ../admin/views/components/filter.php:18
222
+ msgid "SKU ASC"
223
+ msgstr ""
224
+
225
+ #: ../admin/views/components/filter.php:19
226
+ msgid "SKU DESC"
227
+ msgstr ""
228
+
229
+ #: ../admin/views/components/filter.php:23
230
+ msgid "Simple products"
231
+ msgstr "محصولات ساده"
232
+
233
+ #: ../admin/views/components/filter.php:24
234
+ msgid "Products with variation"
235
+ msgstr "محصولات دارای گونه"
236
+
237
+ #: ../admin/views/components/filter.php:28
238
+ msgid "All categories"
239
+ msgstr "همه دسته بندی ها"
240
+
241
+ #: ../admin/views/components/filter.php:41
242
+ msgid "No manage stock"
243
+ msgstr "عدم مدیریت موجودی"
244
+
245
+ #: ../admin/views/components/filter.php:42
246
+ msgid "Yes manage stock"
247
+ msgstr "مدیریت موجودی"
248
+
249
+ #: ../admin/views/components/filter.php:52
250
+ msgid "Show"
251
+ msgstr "نمایش"
252
+
253
+ #: ../admin/views/components/filter.php:54
254
+ msgid "Clear filter"
255
+ msgstr "پاک کردن فیلتر ها"
256
+
257
+ #: ../admin/views/components/filter.php:101
258
+ msgid "Hide or display cells"
259
+ msgstr ""
260
+
261
+ #: ../admin/views/components/filter.php:108
262
+ msgid "Sales price"
263
+ msgstr ""
264
+
265
+ #: ../admin/views/components/filter.php:142
266
+ msgid "Save setting"
267
+ msgstr ""
268
+
269
+ #: ../admin/views/import-export.php:150
270
+ msgid "Import"
271
+ msgstr "درون ریزی"
272
+
273
+ #: ../admin/views/import-export.php:153
274
+ msgid "You can upload csv file, with your stock data. "
275
+ msgstr "شما می توانید فایل CSV حاوی اطلاعات موجودی خود را بارگذاری کنید"
276
+
277
+ #: ../admin/views/import-export.php:154
278
+ msgid ""
279
+ "CSV file must be in this format, or you can export file with exist data and "
280
+ "edit them. "
281
+ msgstr ""
282
+ "فایل CSV باید دارای این فرمت باشد ، یا می توانید یک فایل از داده های موجود "
283
+ "را برون بری کرده و سپس آن فایل را ویرایش نمایید"
284
+
285
+ #: ../admin/views/import-export.php:155
286
+ msgid ""
287
+ "If you have a lot of products and export/import not working, increase memory "
288
+ "limit.. "
289
+ msgstr ""
290
+
291
+ #: ../admin/views/import-export.php:156
292
+ msgid "File format. "
293
+ msgstr "فرمت فایل."
294
+
295
+ #: ../admin/views/import-export.php:160
296
+ msgid "Product name"
297
+ msgstr ""
298
+
299
+ #: ../admin/views/import-export.php:166
300
+ msgid "Parent SKU"
301
+ msgstr "SKU والد"
302
+
303
+ #: ../admin/views/import-export.php:169
304
+ msgid "111111"
305
+ msgstr "111111"
306
+
307
+ #: ../admin/views/import-export.php:170
308
+ msgid "T-shirt"
309
+ msgstr ""
310
+
311
+ #: ../admin/views/import-export.php:171 ../admin/views/import-export.php:173
312
+ msgid "yes"
313
+ msgstr "بله"
314
+
315
+ #: ../admin/views/import-export.php:172
316
+ msgid "instock"
317
+ msgstr "موجود"
318
+
319
+ #: ../admin/views/import-export.php:174
320
+ msgid "10"
321
+ msgstr "10"
322
+
323
+ #: ../admin/views/import-export.php:175
324
+ msgid "simple"
325
+ msgstr "ساده"
326
+
327
+ #: ../admin/views/import-export.php:181
328
+ msgid ""
329
+ "product unique identificator, required. Neccessary for import and export."
330
+ msgstr ""
331
+ "شناسه یکتای محصول مورد نیاز است، این داده برای درون ریزی و برون بری حیاتی "
332
+ "محسوب می شود."
333
+
334
+ #: ../admin/views/import-export.php:182 ../admin/views/import-export.php:184
335
+ msgid "values: \"yes\", \"notify\", \"no\". If is empty \"no\" will be save."
336
+ msgstr ""
337
+ "مقدارهای : \"بله\" ، \"آگاه کن\" و \"خیر\" در دسترس هستند. در صورت عدم "
338
+ "انتخاب پیش فرض \"خیر\" است."
339
+
340
+ #: ../admin/views/import-export.php:183
341
+ msgid ""
342
+ "values: \"instock\", \"outofstock\". If is empty \"outofstock\" will be save."
343
+ msgstr ""
344
+ "مقدارهای : \"موجود\" و \"نا موجود\" در دسترس هستند. در صورت عدم انتخاب پیش "
345
+ "فرض \"نا موجود\" است."
346
+
347
+ #: ../admin/views/import-export.php:185
348
+ msgid "quantity value. If is empty, 0 will be save."
349
+ msgstr "مقدار تعداد موجودی کالا ، پیش فرض 0 است."
350
+
351
+ #: ../admin/views/import-export.php:192
352
+ msgid "Upload csv file"
353
+ msgstr "بارگذاری فایل CSV"
354
+
355
+ #: ../admin/views/import-export.php:201
356
+ msgid "Upload"
357
+ msgstr "بارگذاری"
358
+
359
+ #: ../admin/views/import-export.php:212
360
+ msgid "The file "
361
+ msgstr "فایل"
362
+
363
+ #: ../admin/views/import-export.php:240
364
+ msgid "Product with ID: "
365
+ msgstr ""
366
+
367
+ #: ../admin/views/import-export.php:251
368
+ msgid "Sorry, there was an error uploading your file."
369
+ msgstr "متاسفیم ، مشکلی در بارگذاری فایل شما به وجود آمد."
370
+
371
+ #: ../admin/views/import-export.php:265
372
+ msgid "Export"
373
+ msgstr "برون بری"
374
+
375
+ #: ../admin/views/import-export.php:268
376
+ msgid "You can download csv file, with your stock data. "
377
+ msgstr ""
378
+ "شما می توانید فایل CSV تولید شده حاوی اطلاعات موجودی کالاهایتان را دانلود "
379
+ "کنید."
380
+
381
+ #: ../admin/views/import-export.php:269
382
+ msgid "Create export file"
383
+ msgstr "ساخت فایل برون بری"
384
+
385
+ #: ../admin/views/setting.php:32
386
+ msgid "Stock manager setting"
387
+ msgstr ""
388
+
389
+ #: ../admin/views/setting.php:39
390
+ msgid "Products limit"
391
+ msgstr ""
392
+
393
+ #: ../admin/views/setting.php:43
394
+ msgid "Allow stock for variable products"
395
+ msgstr ""
396
+
397
+ #: ../admin/views/setting.php:47
398
+ msgid "Qty input step"
399
+ msgstr ""
400
+
401
+ #: ../woocommerce-stock-manager.php:313
402
+ msgid "All done! Close."
403
+ msgstr ""
404
+
405
+ #~ msgid "Show wariables"
406
+ #~ msgstr "نمایش گونه ها"
407
+
408
+ #~ msgid "Product with SKU: "
409
+ #~ msgstr "محصول با SKU:"
woocommerce-stock-manager/languages/woocommerce-stock-manager-fr_FR.mo ADDED
Binary file
woocommerce-stock-manager/languages/woocommerce-stock-manager-fr_FR.po ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Stock-Manager Français\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2018-12-30 09:57+0100\n"
6
+ "PO-Revision-Date: 2018-12-30 09:57+0100\n"
7
+ "Last-Translator: FreePixel <contact@freepixel.net>\n"
8
+ "Language-Team: InditecGroup.com <info@inditecgroup.com>\n"
9
+ "Language: fr\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 2.2\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../admin/class-stock-manager-admin.php:144
21
+ #: ../admin/class-stock-manager-admin.php:145
22
+ msgid "WooCommerce Stock Manager"
23
+ msgstr "Gestion du stock Woocommerce"
24
+
25
+ #: ../admin/class-stock-manager-admin.php:154
26
+ #: ../admin/class-stock-manager-admin.php:155
27
+ msgid "Import/Export"
28
+ msgstr "Importer/Exporter"
29
+
30
+ #: ../admin/class-stock-manager-admin.php:163
31
+ #: ../admin/class-stock-manager-admin.php:164
32
+ msgid "Setting"
33
+ msgstr ""
34
+
35
+ #: ../admin/class-stock-manager-admin.php:208
36
+ msgid "Settings"
37
+ msgstr "Paramètres "
38
+
39
+ #: ../admin/includes/config.php:6 ../admin/includes/config.php:16
40
+ #: ../admin/includes/config.php:21 ../admin/includes/config.php:26
41
+ #: ../admin/includes/config.php:31 ../admin/includes/wcm-class-table.php:244
42
+ #: ../admin/views/import-export.php:159 ../admin/views/import-export.php:181
43
+ msgid "SKU"
44
+ msgstr "Réf."
45
+
46
+ #: ../admin/includes/config.php:11 ../admin/includes/wcm-class-table.php:254
47
+ msgid "ID"
48
+ msgstr "ID"
49
+
50
+ #: ../admin/includes/wcm-class-table.php:104
51
+ #: ../admin/views/components/filter.php:122
52
+ msgid "Tax status"
53
+ msgstr ""
54
+
55
+ #: ../admin/includes/wcm-class-table.php:107
56
+ #: ../admin/views/components/filter.php:124
57
+ msgid "Tax class"
58
+ msgstr ""
59
+
60
+ #: ../admin/includes/wcm-class-table.php:110
61
+ #: ../admin/views/components/filter.php:126
62
+ msgid "Shipping class"
63
+ msgstr ""
64
+
65
+ #: ../admin/includes/wcm-class-table.php:234
66
+ #: ../admin/views/components/filter.php:104
67
+ msgid "Thumbnail"
68
+ msgstr ""
69
+
70
+ #: ../admin/includes/wcm-class-table.php:264
71
+ msgid "Name"
72
+ msgstr "Nom"
73
+
74
+ #: ../admin/includes/wcm-class-table.php:274
75
+ #: ../admin/views/import-export.php:165
76
+ msgid "Product type"
77
+ msgstr "Type produit"
78
+
79
+ #: ../admin/includes/wcm-class-table.php:284
80
+ msgid "Parent ID"
81
+ msgstr "ID du parent"
82
+
83
+ #: ../admin/includes/wcm-class-table.php:294
84
+ #: ../admin/views/components/filter.php:106
85
+ msgid "Price"
86
+ msgstr "Prix"
87
+
88
+ #: ../admin/includes/wcm-class-table.php:304
89
+ msgid "Sale price"
90
+ msgstr "Prix de vente"
91
+
92
+ #: ../admin/includes/wcm-class-table.php:314
93
+ #: ../admin/views/components/filter.php:110
94
+ msgid "Weight"
95
+ msgstr "Poids"
96
+
97
+ #: ../admin/includes/wcm-class-table.php:324
98
+ #: ../admin/views/components/filter.php:40
99
+ #: ../admin/views/components/filter.php:112
100
+ #: ../admin/views/import-export.php:161 ../admin/views/import-export.php:182
101
+ msgid "Manage stock"
102
+ msgstr "Gestion du stock"
103
+
104
+ #: ../admin/includes/wcm-class-table.php:334
105
+ #: ../admin/views/components/filter.php:46
106
+ #: ../admin/views/components/filter.php:114
107
+ #: ../admin/views/import-export.php:162 ../admin/views/import-export.php:183
108
+ msgid "Stock status"
109
+ msgstr "État du stock"
110
+
111
+ #: ../admin/includes/wcm-class-table.php:344
112
+ #: ../admin/views/components/filter.php:116
113
+ #: ../admin/views/import-export.php:163 ../admin/views/import-export.php:184
114
+ msgid "Backorders"
115
+ msgstr "Réappro."
116
+
117
+ #: ../admin/includes/wcm-class-table.php:354
118
+ #: ../admin/views/components/filter.php:118
119
+ #: ../admin/views/import-export.php:164 ../admin/views/import-export.php:185
120
+ msgid "Stock"
121
+ msgstr "Stock"
122
+
123
+ #: ../admin/includes/wcm-class-table.php:364
124
+ #: ../admin/includes/wcm-class-table.php:412
125
+ #: ../admin/includes/wcm-class-table.php:444
126
+ #: ../admin/includes/wcm-class-table.php:739
127
+ msgid "Save"
128
+ msgstr "Sauvegarder"
129
+
130
+ #: ../admin/includes/wcm-class-table.php:413
131
+ #: ../admin/includes/wcm-class-table.php:445
132
+ msgid "Close"
133
+ msgstr "Fermer"
134
+
135
+ #: ../admin/includes/wcm-class-table.php:460 ../admin/views/admin.php:79
136
+ msgid "Show variables"
137
+ msgstr "Afficher les variables"
138
+
139
+ #: ../admin/includes/wcm-class-table.php:480
140
+ msgid "Taxable"
141
+ msgstr ""
142
+
143
+ #: ../admin/includes/wcm-class-table.php:481
144
+ msgid "Shipping only"
145
+ msgstr ""
146
+
147
+ #: ../admin/includes/wcm-class-table.php:538
148
+ msgid "Same as parent"
149
+ msgstr ""
150
+
151
+ #: ../admin/includes/wcm-class-table.php:540
152
+ msgid "No shipping class"
153
+ msgstr ""
154
+
155
+ #: ../admin/includes/wcm-class-table.php:632
156
+ #: ../admin/includes/wcm-class-table.php:665
157
+ msgid "Yes"
158
+ msgstr "Oui"
159
+
160
+ #: ../admin/includes/wcm-class-table.php:633
161
+ #: ../admin/includes/wcm-class-table.php:663
162
+ msgid "No"
163
+ msgstr "Non"
164
+
165
+ #: ../admin/includes/wcm-class-table.php:647
166
+ #: ../admin/views/components/filter.php:47
167
+ msgid "In stock"
168
+ msgstr "En stock"
169
+
170
+ #: ../admin/includes/wcm-class-table.php:648
171
+ #: ../admin/views/components/filter.php:48
172
+ msgid "Out of stock"
173
+ msgstr "Produit épuisé"
174
+
175
+ #: ../admin/includes/wcm-class-table.php:649
176
+ msgid "On backorder"
177
+ msgstr ""
178
+
179
+ #: ../admin/includes/wcm-class-table.php:664
180
+ msgid "Notify"
181
+ msgstr "Notifier"
182
+
183
+ #: ../admin/views/admin.php:44
184
+ msgid "Stock manager"
185
+ msgstr "Gestionnaire de stock Woocommerce"
186
+
187
+ #: ../admin/views/admin.php:151
188
+ msgid "Save all"
189
+ msgstr "Tout sauvegarder"
190
+
191
+ #: ../admin/views/components/filter.php:3
192
+ msgid "Filter"
193
+ msgstr "Filtre"
194
+
195
+ #: ../admin/views/components/filter.php:4
196
+ #: ../admin/views/components/filter.php:63
197
+ msgid "Search by sku"
198
+ msgstr "Rechercher par Réf."
199
+
200
+ #: ../admin/views/components/filter.php:5
201
+ #: ../admin/views/components/filter.php:73
202
+ msgid "Search by product name"
203
+ msgstr "Rechercher par nom de produit"
204
+
205
+ #: ../admin/views/components/filter.php:6
206
+ msgid "Display setting"
207
+ msgstr "Afficher les paramètres"
208
+
209
+ #: ../admin/views/components/filter.php:15
210
+ msgid "Order by"
211
+ msgstr "Commandes par"
212
+
213
+ #: ../admin/views/components/filter.php:16
214
+ msgid "Product name ASC"
215
+ msgstr "Nom produit ascendant"
216
+
217
+ #: ../admin/views/components/filter.php:17
218
+ msgid "Product name DESC"
219
+ msgstr "Nom produit déscendant"
220
+
221
+ #: ../admin/views/components/filter.php:18
222
+ msgid "SKU ASC"
223
+ msgstr "Réf. ascendante"
224
+
225
+ #: ../admin/views/components/filter.php:19
226
+ msgid "SKU DESC"
227
+ msgstr "Réf. descendante"
228
+
229
+ #: ../admin/views/components/filter.php:23
230
+ msgid "Simple products"
231
+ msgstr "Produits simples"
232
+
233
+ #: ../admin/views/components/filter.php:24
234
+ msgid "Products with variation"
235
+ msgstr "Produits avec variations"
236
+
237
+ #: ../admin/views/components/filter.php:28
238
+ msgid "All categories"
239
+ msgstr "Toutes les catégories"
240
+
241
+ #: ../admin/views/components/filter.php:41
242
+ msgid "No manage stock"
243
+ msgstr "Ne pas gérer le stock"
244
+
245
+ #: ../admin/views/components/filter.php:42
246
+ msgid "Yes manage stock"
247
+ msgstr "Oui gérer le stock"
248
+
249
+ #: ../admin/views/components/filter.php:52
250
+ msgid "Show"
251
+ msgstr "Afficher"
252
+
253
+ #: ../admin/views/components/filter.php:54
254
+ msgid "Clear filter"
255
+ msgstr "Effacer le filtre"
256
+
257
+ #: ../admin/views/components/filter.php:101
258
+ msgid "Hide or display cells"
259
+ msgstr "Masquer les cellules vides"
260
+
261
+ #: ../admin/views/components/filter.php:108
262
+ msgid "Sales price"
263
+ msgstr "Prix de vente"
264
+
265
+ #: ../admin/views/components/filter.php:142
266
+ msgid "Save setting"
267
+ msgstr "Sauvegarder les paramètres"
268
+
269
+ #: ../admin/views/import-export.php:150
270
+ msgid "Import"
271
+ msgstr "Importer"
272
+
273
+ #: ../admin/views/import-export.php:153
274
+ msgid "You can upload csv file, with your stock data. "
275
+ msgstr "Vous pouvez envoyer le fichier CSV, avec vos données de stock. "
276
+
277
+ #: ../admin/views/import-export.php:154
278
+ msgid ""
279
+ "CSV file must be in this format, or you can export file with exist data and "
280
+ "edit them. "
281
+ msgstr ""
282
+ "Le fichier CSV doit être dans ce format, ou vous pouvez exporter le fichier "
283
+ "avec des données existantes et les modifier."
284
+
285
+ #: ../admin/views/import-export.php:155
286
+ msgid ""
287
+ "If you have a lot of products and export/import not working, increase memory "
288
+ "limit.. "
289
+ msgstr ""
290
+
291
+ #: ../admin/views/import-export.php:156
292
+ msgid "File format. "
293
+ msgstr "Format de fichier. "
294
+
295
+ #: ../admin/views/import-export.php:160
296
+ msgid "Product name"
297
+ msgstr "Nom du produit"
298
+
299
+ #: ../admin/views/import-export.php:166
300
+ msgid "Parent SKU"
301
+ msgstr "Ref parent"
302
+
303
+ #: ../admin/views/import-export.php:169
304
+ msgid "111111"
305
+ msgstr "111111"
306
+
307
+ #: ../admin/views/import-export.php:170
308
+ msgid "T-shirt"
309
+ msgstr "T-shirt"
310
+
311
+ #: ../admin/views/import-export.php:171 ../admin/views/import-export.php:173
312
+ msgid "yes"
313
+ msgstr "oui"
314
+
315
+ #: ../admin/views/import-export.php:172
316
+ msgid "instock"
317
+ msgstr "en stock"
318
+
319
+ #: ../admin/views/import-export.php:174
320
+ msgid "10"
321
+ msgstr "10"
322
+
323
+ #: ../admin/views/import-export.php:175
324
+ msgid "simple"
325
+ msgstr "simple"
326
+
327
+ #: ../admin/views/import-export.php:181
328
+ msgid ""
329
+ "product unique identificator, required. Neccessary for import and export."
330
+ msgstr ""
331
+ "Identification unique du produit, requis. Nécessaire pour l'importation et "
332
+ "l'exportation."
333
+
334
+ #: ../admin/views/import-export.php:182 ../admin/views/import-export.php:184
335
+ msgid "values: \"yes\", \"notify\", \"no\". If is empty \"no\" will be save."
336
+ msgstr ""
337
+ "Valeurs : \"oui\", \"notifier\", \"non\". Si vide \"non\" sera sauvegardé."
338
+
339
+ #: ../admin/views/import-export.php:183
340
+ msgid ""
341
+ "values: \"instock\", \"outofstock\". If is empty \"outofstock\" will be save."
342
+ msgstr ""
343
+ "Valeurs : \"en stock\", \"épuisé\". Si vide \"épuisé\" sera enregistré."
344
+
345
+ #: ../admin/views/import-export.php:185
346
+ msgid "quantity value. If is empty, 0 will be save."
347
+ msgstr "valeur de quantité. Si vide, 0 sera sauvegardé."
348
+
349
+ #: ../admin/views/import-export.php:192
350
+ msgid "Upload csv file"
351
+ msgstr "Télécharger le fichier CSV"
352
+
353
+ #: ../admin/views/import-export.php:201
354
+ msgid "Upload"
355
+ msgstr "Télécharger"
356
+
357
+ #: ../admin/views/import-export.php:212
358
+ msgid "The file "
359
+ msgstr "Le fichier "
360
+
361
+ #: ../admin/views/import-export.php:240
362
+ msgid "Product with ID: "
363
+ msgstr "Produit avec l’ID : "
364
+
365
+ #: ../admin/views/import-export.php:251
366
+ msgid "Sorry, there was an error uploading your file."
367
+ msgstr ""
368
+ "Désolé, une erreur est survenue lors du téléchargement de votre fichier."
369
+
370
+ #: ../admin/views/import-export.php:265
371
+ msgid "Export"
372
+ msgstr "Exporter"
373
+
374
+ #: ../admin/views/import-export.php:268
375
+ msgid "You can download csv file, with your stock data. "
376
+ msgstr "Vous pouvez télécharger le fichier CSV, avec vos données de stock. "
377
+
378
+ #: ../admin/views/import-export.php:269
379
+ msgid "Create export file"
380
+ msgstr "Créer fichier d’export"
381
+
382
+ #: ../admin/views/setting.php:32
383
+ msgid "Stock manager setting"
384
+ msgstr ""
385
+
386
+ #: ../admin/views/setting.php:39
387
+ msgid "Products limit"
388
+ msgstr ""
389
+
390
+ #: ../admin/views/setting.php:43
391
+ msgid "Allow stock for variable products"
392
+ msgstr ""
393
+
394
+ #: ../admin/views/setting.php:47
395
+ msgid "Qty input step"
396
+ msgstr ""
397
+
398
+ #: ../woocommerce-stock-manager.php:313
399
+ msgid "All done! Close."
400
+ msgstr ""
woocommerce-stock-manager/languages/woocommerce-stock-manager-sk_SK.mo ADDED
Binary file
woocommerce-stock-manager/languages/woocommerce-stock-manager-sk_SK.po ADDED
@@ -0,0 +1,402 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WooCommerce Stock Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2018-12-30 09:57+0100\n"
6
+ "PO-Revision-Date: 2018-12-30 09:57+0100\n"
7
+ "Last-Translator: Vladislav Musílek <musilekv@seznam.cz>\n"
8
+ "Language-Team: Toret <vladislav.musilek@toret.cz>\n"
9
+ "Language: cs_CZ\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 2.2\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ #: ../admin/class-stock-manager-admin.php:144
20
+ #: ../admin/class-stock-manager-admin.php:145
21
+ msgid "WooCommerce Stock Manager"
22
+ msgstr "WooCommerce Stock Manager"
23
+
24
+ #: ../admin/class-stock-manager-admin.php:154
25
+ #: ../admin/class-stock-manager-admin.php:155
26
+ msgid "Import/Export"
27
+ msgstr "Import/Export"
28
+
29
+ #: ../admin/class-stock-manager-admin.php:163
30
+ #: ../admin/class-stock-manager-admin.php:164
31
+ msgid "Setting"
32
+ msgstr ""
33
+
34
+ #: ../admin/class-stock-manager-admin.php:208
35
+ msgid "Settings"
36
+ msgstr "Nastavenia"
37
+
38
+ #: ../admin/includes/config.php:6 ../admin/includes/config.php:16
39
+ #: ../admin/includes/config.php:21 ../admin/includes/config.php:26
40
+ #: ../admin/includes/config.php:31 ../admin/includes/wcm-class-table.php:244
41
+ #: ../admin/views/import-export.php:159 ../admin/views/import-export.php:181
42
+ msgid "SKU"
43
+ msgstr "SKU"
44
+
45
+ #: ../admin/includes/config.php:11 ../admin/includes/wcm-class-table.php:254
46
+ msgid "ID"
47
+ msgstr "ID"
48
+
49
+ #: ../admin/includes/wcm-class-table.php:104
50
+ #: ../admin/views/components/filter.php:122
51
+ msgid "Tax status"
52
+ msgstr ""
53
+
54
+ #: ../admin/includes/wcm-class-table.php:107
55
+ #: ../admin/views/components/filter.php:124
56
+ msgid "Tax class"
57
+ msgstr ""
58
+
59
+ #: ../admin/includes/wcm-class-table.php:110
60
+ #: ../admin/views/components/filter.php:126
61
+ msgid "Shipping class"
62
+ msgstr ""
63
+
64
+ #: ../admin/includes/wcm-class-table.php:234
65
+ #: ../admin/views/components/filter.php:104
66
+ msgid "Thumbnail"
67
+ msgstr ""
68
+
69
+ #: ../admin/includes/wcm-class-table.php:264
70
+ msgid "Name"
71
+ msgstr "Meno"
72
+
73
+ #: ../admin/includes/wcm-class-table.php:274
74
+ #: ../admin/views/import-export.php:165
75
+ msgid "Product type"
76
+ msgstr "Typ produktu"
77
+
78
+ #: ../admin/includes/wcm-class-table.php:284
79
+ msgid "Parent ID"
80
+ msgstr "ID rodiča"
81
+
82
+ #: ../admin/includes/wcm-class-table.php:294
83
+ #: ../admin/views/components/filter.php:106
84
+ msgid "Price"
85
+ msgstr ""
86
+
87
+ #: ../admin/includes/wcm-class-table.php:304
88
+ msgid "Sale price"
89
+ msgstr ""
90
+
91
+ #: ../admin/includes/wcm-class-table.php:314
92
+ #: ../admin/views/components/filter.php:110
93
+ msgid "Weight"
94
+ msgstr ""
95
+
96
+ #: ../admin/includes/wcm-class-table.php:324
97
+ #: ../admin/views/components/filter.php:40
98
+ #: ../admin/views/components/filter.php:112
99
+ #: ../admin/views/import-export.php:161 ../admin/views/import-export.php:182
100
+ msgid "Manage stock"
101
+ msgstr "Spravovať sklad"
102
+
103
+ #: ../admin/includes/wcm-class-table.php:334
104
+ #: ../admin/views/components/filter.php:46
105
+ #: ../admin/views/components/filter.php:114
106
+ #: ../admin/views/import-export.php:162 ../admin/views/import-export.php:183
107
+ msgid "Stock status"
108
+ msgstr "Stav skladu"
109
+
110
+ #: ../admin/includes/wcm-class-table.php:344
111
+ #: ../admin/views/components/filter.php:116
112
+ #: ../admin/views/import-export.php:163 ../admin/views/import-export.php:184
113
+ msgid "Backorders"
114
+ msgstr "Objednávka"
115
+
116
+ #: ../admin/includes/wcm-class-table.php:354
117
+ #: ../admin/views/components/filter.php:118
118
+ #: ../admin/views/import-export.php:164 ../admin/views/import-export.php:185
119
+ msgid "Stock"
120
+ msgstr "Skladom"
121
+
122
+ #: ../admin/includes/wcm-class-table.php:364
123
+ #: ../admin/includes/wcm-class-table.php:412
124
+ #: ../admin/includes/wcm-class-table.php:444
125
+ #: ../admin/includes/wcm-class-table.php:739
126
+ msgid "Save"
127
+ msgstr "Uložiť"
128
+
129
+ #: ../admin/includes/wcm-class-table.php:413
130
+ #: ../admin/includes/wcm-class-table.php:445
131
+ msgid "Close"
132
+ msgstr ""
133
+
134
+ #: ../admin/includes/wcm-class-table.php:460 ../admin/views/admin.php:79
135
+ msgid "Show variables"
136
+ msgstr ""
137
+
138
+ #: ../admin/includes/wcm-class-table.php:480
139
+ msgid "Taxable"
140
+ msgstr ""
141
+
142
+ #: ../admin/includes/wcm-class-table.php:481
143
+ msgid "Shipping only"
144
+ msgstr ""
145
+
146
+ #: ../admin/includes/wcm-class-table.php:538
147
+ msgid "Same as parent"
148
+ msgstr ""
149
+
150
+ #: ../admin/includes/wcm-class-table.php:540
151
+ msgid "No shipping class"
152
+ msgstr ""
153
+
154
+ #: ../admin/includes/wcm-class-table.php:632
155
+ #: ../admin/includes/wcm-class-table.php:665
156
+ msgid "Yes"
157
+ msgstr "Áno"
158
+
159
+ #: ../admin/includes/wcm-class-table.php:633
160
+ #: ../admin/includes/wcm-class-table.php:663
161
+ msgid "No"
162
+ msgstr "Nie"
163
+
164
+ #: ../admin/includes/wcm-class-table.php:647
165
+ #: ../admin/views/components/filter.php:47
166
+ msgid "In stock"
167
+ msgstr "Skladom"
168
+
169
+ #: ../admin/includes/wcm-class-table.php:648
170
+ #: ../admin/views/components/filter.php:48
171
+ msgid "Out of stock"
172
+ msgstr "Nie je skladom"
173
+
174
+ #: ../admin/includes/wcm-class-table.php:649
175
+ msgid "On backorder"
176
+ msgstr ""
177
+
178
+ #: ../admin/includes/wcm-class-table.php:664
179
+ msgid "Notify"
180
+ msgstr "Upozorniť"
181
+
182
+ #: ../admin/views/admin.php:44
183
+ msgid "Stock manager"
184
+ msgstr "Stock manager"
185
+
186
+ #: ../admin/views/admin.php:151
187
+ msgid "Save all"
188
+ msgstr "Uložiť všetko"
189
+
190
+ #: ../admin/views/components/filter.php:3
191
+ msgid "Filter"
192
+ msgstr ""
193
+
194
+ #: ../admin/views/components/filter.php:4
195
+ #: ../admin/views/components/filter.php:63
196
+ msgid "Search by sku"
197
+ msgstr ""
198
+
199
+ #: ../admin/views/components/filter.php:5
200
+ #: ../admin/views/components/filter.php:73
201
+ msgid "Search by product name"
202
+ msgstr ""
203
+
204
+ #: ../admin/views/components/filter.php:6
205
+ msgid "Display setting"
206
+ msgstr ""
207
+
208
+ #: ../admin/views/components/filter.php:15
209
+ msgid "Order by"
210
+ msgstr ""
211
+
212
+ #: ../admin/views/components/filter.php:16
213
+ msgid "Product name ASC"
214
+ msgstr ""
215
+
216
+ #: ../admin/views/components/filter.php:17
217
+ msgid "Product name DESC"
218
+ msgstr ""
219
+
220
+ #: ../admin/views/components/filter.php:18
221
+ msgid "SKU ASC"
222
+ msgstr ""
223
+
224
+ #: ../admin/views/components/filter.php:19
225
+ msgid "SKU DESC"
226
+ msgstr ""
227
+
228
+ #: ../admin/views/components/filter.php:23
229
+ msgid "Simple products"
230
+ msgstr "Jednoduché produkty"
231
+
232
+ #: ../admin/views/components/filter.php:24
233
+ msgid "Products with variation"
234
+ msgstr "Produkty s variantami"
235
+
236
+ #: ../admin/views/components/filter.php:28
237
+ msgid "All categories"
238
+ msgstr "Všetky kategórie"
239
+
240
+ #: ../admin/views/components/filter.php:41
241
+ msgid "No manage stock"
242
+ msgstr "Nespravovať sklad"
243
+
244
+ #: ../admin/views/components/filter.php:42
245
+ msgid "Yes manage stock"
246
+ msgstr "Spravovať sklad"
247
+
248
+ #: ../admin/views/components/filter.php:52
249
+ msgid "Show"
250
+ msgstr "Zobraziť"
251
+
252
+ #: ../admin/views/components/filter.php:54
253
+ msgid "Clear filter"
254
+ msgstr "Vymazať filter"
255
+
256
+ #: ../admin/views/components/filter.php:101
257
+ msgid "Hide or display cells"
258
+ msgstr ""
259
+
260
+ #: ../admin/views/components/filter.php:108
261
+ msgid "Sales price"
262
+ msgstr ""
263
+
264
+ #: ../admin/views/components/filter.php:142
265
+ msgid "Save setting"
266
+ msgstr ""
267
+
268
+ #: ../admin/views/import-export.php:150
269
+ msgid "Import"
270
+ msgstr "Importovať"
271
+
272
+ #: ../admin/views/import-export.php:153
273
+ msgid "You can upload csv file, with your stock data. "
274
+ msgstr "Můžete nahrať váš csv súbor so skladovými dátami."
275
+
276
+ #: ../admin/views/import-export.php:154
277
+ msgid ""
278
+ "CSV file must be in this format, or you can export file with exist data and "
279
+ "edit them. "
280
+ msgstr ""
281
+ "CSV súbor musí byť v nasledujúcom formáte, alebo si môžete vyexportovať "
282
+ "existujúce dáta a upraviť ich."
283
+
284
+ #: ../admin/views/import-export.php:155
285
+ msgid ""
286
+ "If you have a lot of products and export/import not working, increase memory "
287
+ "limit.. "
288
+ msgstr ""
289
+
290
+ #: ../admin/views/import-export.php:156
291
+ msgid "File format. "
292
+ msgstr "Formát súboru."
293
+
294
+ #: ../admin/views/import-export.php:160
295
+ msgid "Product name"
296
+ msgstr ""
297
+
298
+ #: ../admin/views/import-export.php:166
299
+ msgid "Parent SKU"
300
+ msgstr "SKU rodiča"
301
+
302
+ #: ../admin/views/import-export.php:169
303
+ msgid "111111"
304
+ msgstr "111111"
305
+
306
+ #: ../admin/views/import-export.php:170
307
+ msgid "T-shirt"
308
+ msgstr ""
309
+
310
+ #: ../admin/views/import-export.php:171 ../admin/views/import-export.php:173
311
+ msgid "yes"
312
+ msgstr "Áno"
313
+
314
+ #: ../admin/views/import-export.php:172
315
+ msgid "instock"
316
+ msgstr "skladom"
317
+
318
+ #: ../admin/views/import-export.php:174
319
+ msgid "10"
320
+ msgstr "10"
321
+
322
+ #: ../admin/views/import-export.php:175
323
+ msgid "simple"
324
+ msgstr "jednoduchý"
325
+
326
+ #: ../admin/views/import-export.php:181
327
+ msgid ""
328
+ "product unique identificator, required. Neccessary for import and export."
329
+ msgstr ""
330
+ "unikátny identifikátor produktu musí byť zadaný. Je nutný pre import a "
331
+ "export."
332
+
333
+ #: ../admin/views/import-export.php:182 ../admin/views/import-export.php:184
334
+ msgid "values: \"yes\", \"notify\", \"no\". If is empty \"no\" will be save."
335
+ msgstr ""
336
+
337
+ #: ../admin/views/import-export.php:183
338
+ msgid ""
339
+ "values: \"instock\", \"outofstock\". If is empty \"outofstock\" will be save."
340
+ msgstr ""
341
+
342
+ #: ../admin/views/import-export.php:185
343
+ msgid "quantity value. If is empty, 0 will be save."
344
+ msgstr ""
345
+
346
+ #: ../admin/views/import-export.php:192
347
+ msgid "Upload csv file"
348
+ msgstr "Uploadnuť csv súbor"
349
+
350
+ #: ../admin/views/import-export.php:201
351
+ msgid "Upload"
352
+ msgstr "Uploadnuť"
353
+
354
+ #: ../admin/views/import-export.php:212
355
+ msgid "The file "
356
+ msgstr "Súbor"
357
+
358
+ #: ../admin/views/import-export.php:240
359
+ msgid "Product with ID: "
360
+ msgstr ""
361
+
362
+ #: ../admin/views/import-export.php:251
363
+ msgid "Sorry, there was an error uploading your file."
364
+ msgstr "Prepáčte, pri nahrávaní nastala chyba"
365
+
366
+ #: ../admin/views/import-export.php:265
367
+ msgid "Export"
368
+ msgstr "Export"
369
+
370
+ #: ../admin/views/import-export.php:268
371
+ msgid "You can download csv file, with your stock data. "
372
+ msgstr "Môžete stiahnuť csv súbor s vašími skladovými dátami-"
373
+
374
+ #: ../admin/views/import-export.php:269
375
+ msgid "Create export file"
376
+ msgstr "Vytvoriť exportný súbor"
377
+
378
+ #: ../admin/views/setting.php:32
379
+ msgid "Stock manager setting"
380
+ msgstr ""
381
+
382
+ #: ../admin/views/setting.php:39
383
+ msgid "Products limit"
384
+ msgstr ""
385
+
386
+ #: ../admin/views/setting.php:43
387
+ msgid "Allow stock for variable products"
388
+ msgstr ""
389
+
390
+ #: ../admin/views/setting.php:47
391
+ msgid "Qty input step"
392
+ msgstr ""
393
+
394
+ #: ../woocommerce-stock-manager.php:313
395
+ msgid "All done! Close."
396
+ msgstr ""
397
+
398
+ #~ msgid "Show wariables"
399
+ #~ msgstr "Zobraziť varianty"
400
+
401
+ #~ msgid "Product with SKU: "
402
+ #~ msgstr "Produkt s SKU:"
woocommerce-stock-manager/public/class-stock-manager.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WooCommerce Stock Manager
4
+ * @author Vladislav Musílek
5
+ * @license GPL-2.0+
6
+ * @link http:/toret.cz
7
+ * @copyright 2015 Toret.cz
8
+ */
9
+
10
+ class Stock_Manager {
11
+
12
+ /**
13
+ * Plugin version, used for cache-busting of style and script file references.
14
+ *
15
+ * @since 1.0.0
16
+ *
17
+ * @var string
18
+ */
19
+ const VERSION = '1.2.8';
20
+
21
+ /**
22
+ * Plugin slug
23
+ * @since 1.0.0
24
+ *
25
+ * @var string
26
+ */
27
+ protected $plugin_slug = 'stock-manager';
28
+
29
+ /**
30
+ * Instance of this class.
31
+ *
32
+ * @since 1.0.0
33
+ *
34
+ * @var object
35
+ */
36
+ protected static $instance = null;
37
+
38
+ /**
39
+ * Initialize the plugin by setting localization and loading public scripts
40
+ * and styles.
41
+ *
42
+ * @since 1.0.0
43
+ */
44
+ private function __construct() {
45
+
46
+ // Load plugin text domain
47
+ add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) );
48
+
49
+ // Activate plugin when new blog is added
50
+ add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
51
+
52
+ add_action( 'init', array( $this, 'output_buffer' ) );
53
+
54
+ }
55
+
56
+ /**
57
+ * Return the plugin slug.
58
+ *
59
+ * @since 1.0.0
60
+ *
61
+ * @return Plugin slug variable.
62
+ */
63
+ public function get_plugin_slug() {
64
+ return $this->plugin_slug;
65
+ }
66
+
67
+ /**
68
+ * Return an instance of this class.
69
+ *
70
+ * @since 1.0.0
71
+ *
72
+ * @return object A single instance of this class.
73
+ */
74
+ public static function get_instance() {
75
+
76
+ // If the single instance hasn't been set, set it now.
77
+ if ( null == self::$instance ) {
78
+ self::$instance = new self;
79
+ }
80
+
81
+ return self::$instance;
82
+ }
83
+
84
+ /**
85
+ * Fired when the plugin is activated.
86
+ *
87
+ * @since 1.0.0
88
+ *
89
+ * @param boolean $network_wide True if WPMU superadmin uses
90
+ * "Network Activate" action, false if
91
+ * WPMU is disabled or plugin is
92
+ * activated on an individual blog.
93
+ */
94
+ public static function activate( $network_wide ) {
95
+
96
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
97
+
98
+ if ( $network_wide ) {
99
+
100
+ // Get all blog ids
101
+ $blog_ids = self::get_blog_ids();
102
+
103
+ foreach ( $blog_ids as $blog_id ) {
104
+
105
+ switch_to_blog( $blog_id );
106
+ self::single_activate();
107
+ }
108
+
109
+ restore_current_blog();
110
+
111
+ } else {
112
+ self::single_activate();
113
+ }
114
+
115
+ } else {
116
+ self::single_activate();
117
+ }
118
+
119
+ }
120
+
121
+ /**
122
+ * Fired when the plugin is deactivated.
123
+ *
124
+ * @since 1.0.0
125
+ *
126
+ * @param boolean $network_wide True if WPMU superadmin uses
127
+ * "Network Deactivate" action, false if
128
+ * WPMU is disabled or plugin is
129
+ * deactivated on an individual blog.
130
+ */
131
+ public static function deactivate( $network_wide ) {
132
+
133
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
134
+
135
+ if ( $network_wide ) {
136
+
137
+ // Get all blog ids
138
+ $blog_ids = self::get_blog_ids();
139
+
140
+ foreach ( $blog_ids as $blog_id ) {
141
+
142
+ switch_to_blog( $blog_id );
143
+ self::single_deactivate();
144
+
145
+ }
146
+
147
+ restore_current_blog();
148
+
149
+ } else {
150
+ self::single_deactivate();
151
+ }
152
+
153
+ } else {
154
+ self::single_deactivate();
155
+ }
156
+
157
+ }
158
+
159
+ /**
160
+ * Fired when a new site is activated with a WPMU environment.
161
+ *
162
+ * @since 1.0.0
163
+ *
164
+ * @param int $blog_id ID of the new blog.
165
+ */
166
+ public function activate_new_site( $blog_id ) {
167
+
168
+ if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
169
+ return;
170
+ }
171
+
172
+ switch_to_blog( $blog_id );
173
+ self::single_activate();
174
+ restore_current_blog();
175
+
176
+ }
177
+
178
+ /**
179
+ * Get all blog ids of blogs in the current network that are:
180
+ * - not archived
181
+ * - not spam
182
+ * - not deleted
183
+ *
184
+ * @since 1.0.0
185
+ *
186
+ * @return array|false The blog ids, false if no matches.
187
+ */
188
+ private static function get_blog_ids() {
189
+
190
+ global $wpdb;
191
+
192
+ // get an array of blog ids
193
+ $sql = "SELECT blog_id FROM $wpdb->blogs
194
+ WHERE archived = '0' AND spam = '0'
195
+ AND deleted = '0'";
196
+
197
+ return $wpdb->get_col( $sql );
198
+
199
+ }
200
+
201
+ /**
202
+ * Fired for each blog when the plugin is activated.
203
+ *
204
+ * @since 1.0.0
205
+ */
206
+ private static function single_activate() {
207
+
208
+ }
209
+
210
+ /**
211
+ * Fired for each blog when the plugin is deactivated.
212
+ *
213
+ * @since 1.0.0
214
+ */
215
+ private static function single_deactivate() {
216
+
217
+ }
218
+
219
+ /**
220
+ * Load the plugin text domain for translation.
221
+ *
222
+ * @since 1.0.0
223
+ */
224
+ public function load_plugin_textdomain() {
225
+
226
+ $domain = 'woocommerce-stock-manager';
227
+ $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
228
+
229
+ //load_textdomain( $domain, STOCKDIR . 'languages/woocommerce-stock-manager-' . $locale . '.mo' );
230
+ load_plugin_textdomain( $domain, FALSE, STOCKDIR . '/languages/' );
231
+
232
+ }
233
+
234
+ /**
235
+ * Headers allready sent fix
236
+ *
237
+ */
238
+ public function output_buffer() {
239
+ ob_start();
240
+ }
241
+
242
+ }//End class
woocommerce-stock-manager/uninstall.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fired when the plugin is uninstalled.
4
+ *
5
+ * @package Plugin_Name
6
+ * @author Your Name <email@example.com>
7
+ * @license GPL-2.0+
8
+ * @link http://example.com
9
+ * @copyright 2013 Your Name or Company Name
10
+ */
11
+
12
+ // If uninstall not called from WordPress, then exit
13
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
14
+ exit;
15
+ }
16
+
woocommerce-stock-manager/woocommerce-stock-manager.php ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WooCommerce Stock Manager
4
+ * Plugin URI: http:/toret.cz
5
+ * Description: WooCommerce Stock Manager
6
+ * Version: 1.2.8
7
+ * Author: Vladislav Musílek
8
+ * Author URI: http://toret.cz
9
+ * Text Domain: stock-manager
10
+ * License: GPL-2.0+
11
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12
+ * Domain Path: /languages
13
+ * WC tested up to: 3.5.2
14
+ */
15
+
16
+ // If this file is called directly, abort.
17
+ if ( ! defined( 'WPINC' ) ) {
18
+ die;
19
+ }
20
+ define( 'STOCKDIR', plugin_dir_path( __FILE__ ) );
21
+ define( 'STOCKURL', plugin_dir_url( __FILE__ ) );
22
+ /*----------------------------------------------------------------------------*
23
+ * Public-Facing Functionality
24
+ *----------------------------------------------------------------------------*/
25
+
26
+ include_once( plugin_dir_path( __FILE__ ) . 'admin/includes/wcm-class-save.php' );
27
+
28
+ require_once( plugin_dir_path( __FILE__ ) . 'public/class-stock-manager.php' );
29
+
30
+ register_activation_hook( __FILE__, array( 'Stock_Manager', 'activate' ) );
31
+ register_deactivation_hook( __FILE__, array( 'Stock_Manager', 'deactivate' ) );
32
+
33
+ add_action( 'plugins_loaded', array( 'Stock_Manager', 'get_instance' ) );
34
+
35
+ if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
36
+
37
+ require_once( plugin_dir_path( __FILE__ ) . 'admin/class-stock-manager-admin.php' );
38
+ add_action( 'plugins_loaded', array( 'Stock_Manager_Admin', 'get_instance' ) );
39
+
40
+ }
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+ add_action( 'wp_ajax_save_one_product', 'stock_manager_save_one_product_stock_data' );
49
+
50
+ /**
51
+ * Save one product stock data
52
+ *
53
+ */
54
+ function stock_manager_save_one_product_stock_data(){
55
+
56
+ if( current_user_can('manage_woocommerce') ){
57
+
58
+ $product_id = sanitize_text_field( $_POST['product'] );
59
+
60
+ check_ajax_referer( 'wsm-ajax-nonce-'.$product_id, 'secure' );
61
+
62
+ WCM_Save::save_one( $_POST, $product_id );
63
+
64
+ }
65
+
66
+ exit();
67
+
68
+ }
69
+
70
+
71
+ add_action( 'wp_ajax_wsm_save_title_product', 'stock_manager_wsm_save_title_product' );
72
+
73
+ /**
74
+ * Save product title
75
+ *
76
+ */
77
+ function stock_manager_wsm_save_title_product(){
78
+
79
+ if( current_user_can('manage_woocommerce') ){
80
+
81
+ //check_ajax_referer( 'wsm_update', 'security' );
82
+
83
+ $item = sanitize_text_field($_POST['item']);
84
+ $title = sanitize_text_field($_POST['title']);
85
+
86
+ $args = array(
87
+ 'ID' => $item,
88
+ 'post_title' => $title,
89
+ );
90
+
91
+ $product_id = wp_update_post( $args );
92
+
93
+
94
+
95
+ }
96
+ echo $product_id;
97
+ exit($product_id);
98
+ }
99
+
100
+ add_action( 'wp_ajax_wsm_save_sku', 'stock_manager_wsm_save_sku' );
101
+
102
+ /**
103
+ * Save product title
104
+ *
105
+ */
106
+ function stock_manager_wsm_save_sku(){
107
+
108
+ if( current_user_can('manage_woocommerce') ){
109
+
110
+ //check_ajax_referer( 'wsm_update', 'security' );
111
+
112
+ $item = sanitize_text_field($_POST['item']);
113
+ $sku = sanitize_text_field($_POST['sku']);
114
+
115
+ update_post_meta( $item, '_sku', $sku );
116
+
117
+
118
+
119
+ }
120
+ echo $item;
121
+ exit();
122
+ }
123
+
124
+
125
+ /**
126
+ * Get WooCommerce setting for number field step
127
+ *
128
+ */
129
+ function wsm_get_step(){
130
+ $number = get_option('woocommerce_price_num_decimals');
131
+ if( $number == '0' ){ $step = '1'; }
132
+ if( $number == '1' ){ $step = '0.1'; }
133
+ if( $number == '2' ){ $step = '0.01'; }
134
+ if( $number == '3' ){ $step = '0.001'; }
135
+ if( $number == '4' ){ $step = '0.0001'; }
136
+ if( $number == '5' ){ $step = '0.00001'; }
137
+ if( $number == '6' ){ $step = '0.000001'; }
138
+
139
+ return $step;
140
+
141
+ }
142
+
143
+ /**
144
+ * Save stock
145
+ *
146
+ */
147
+ function wsm_save_stock( $product_id, $regular_price, $sale_price = null ){
148
+
149
+
150
+
151
+ }
152
+
153
+
154
+
155
+ /**
156
+ * Save price function
157
+ *
158
+ */
159
+ function wsm_save_price( $product_id, $regular_price, $sale_price = null ){
160
+
161
+ $product = wc_get_product( $product_id );
162
+
163
+ if( !empty( $regular_price ) ){
164
+ $price = sanitize_text_field( $regular_price );
165
+ //update_post_meta( $product_id, '_price', $price );
166
+ //update_post_meta( $product_id, '_regular_price', $price );
167
+ $product->set_price( $price );
168
+ $product->set_regular_price( $price );
169
+ }
170
+
171
+ if( !empty( $sale_price ) ){
172
+ $sale_price = sanitize_text_field($sale_price);
173
+ //update_post_meta( $product_id, '_sale_price', $sale_price );
174
+ $product->set_sale_price( $sale_price );
175
+ }
176
+
177
+ $product->save();
178
+
179
+ }
180
+
181
+
182
+
183
+ function wsm_search_by_title_only( $search, &$wp_query ){
184
+ global $wpdb;
185
+ if ( empty( $search ) )
186
+ return $search; // skip processing - no search term in query
187
+ $q = $wp_query->query_vars;
188
+ $n = ! empty( $q['exact'] ) ? '' : '%';
189
+ $search = '';
190
+ $searchand = '';
191
+ foreach ( (array) $q['search_terms'] as $term ) {
192
+ $term = esc_sql( $wpdb->esc_like( $term ) );
193
+ $search .= "{$searchand}($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";
194
+ $searchand = ' AND ';
195
+ }
196
+ if ( ! empty( $search ) ) {
197
+ $search = " AND ({$search}) ";
198
+ if ( ! is_user_logged_in() )
199
+ $search .= " AND ($wpdb->posts.post_password = '') ";
200
+ }
201
+ return $search;
202
+ }
203
+
204
+
205
+ /**
206
+ * Get products for export
207
+ *
208
+ */
209
+ add_action( 'wp_ajax_wsm_get_products_or_export', 'wsm_get_products_or_export' );
210
+ function wsm_get_products_or_export(){
211
+
212
+ $offset = sanitize_text_field( $_POST['offset'] );
213
+ $posts_per_page = 10;
214
+ $args = array(
215
+ 'post_type' => 'product',
216
+ 'posts_status' => 'publish',
217
+ 'posts_per_page' => $posts_per_page,
218
+ 'offset' => $offset
219
+ );
220
+ $_products = new WP_Query( $args );
221
+ if( !empty( $_products->posts ) ){
222
+ $data = array();
223
+ $i = 1 + $offset;
224
+ foreach( $_products->posts as $item ){
225
+
226
+ $product = wc_get_product( $item->ID );
227
+ if( !empty( $product->get_sku() ) ){ $sku = $product->get_sku(); }else{ $sku = ''; }
228
+ $product_name = $item->post_title;
229
+ if( !empty( $product->get_manage_stock() ) ){ $manage_stock = $product->get_manage_stock(); }else{ $manage_stock = ''; }
230
+ if( !empty( $product->get_stock_status() ) ){ $stock_status = $product->get_stock_status(); }else{ $stock_status = ''; }
231
+ if( !empty( $product->get_backorders() ) ){ $backorders = $product->get_backorders(); }else{ $backorders = ''; }
232
+ if( !empty( $product->get_stock_quantity() ) ){ $stock = $product->get_stock_quantity(); }else{ $stock = ''; }
233
+ $product_type = $product->get_type();
234
+
235
+ $data[$i]['id'] = $item->ID;
236
+ $data[$i]['sku'] = $sku;
237
+ $data[$i]['product_name'] = $product_name;
238
+ $data[$i]['manage_stock'] = $manage_stock;
239
+ $data[$i]['stock_status'] = $stock_status;
240
+ $data[$i]['backorders'] = $backorders;
241
+ $data[$i]['stock'] = $stock;
242
+ $data[$i]['type'] = $product_type;
243
+ $data[$i]['parent_id'] = '';
244
+
245
+ $i++;
246
+
247
+ if($product_type == 'variable'){
248
+
249
+ $args = array(
250
+ 'post_parent' => $item->ID,
251
+ 'post_type' => 'product_variation',
252
+ 'numberposts' => -1,
253
+ 'post_status' => 'publish'
254
+ );
255
+ $variations_array = get_children( $args );
256
+ foreach($variations_array as $vars){
257
+
258
+ $item_product = wc_get_product($vars->ID);
259
+ if( !empty( $item_product->get_sku() ) ){ $sku = $item_product->get_sku(); }else{ $sku = ''; }
260
+
261
+ $product_name = '';
262
+ foreach($item_product->variation_data as $k => $v){
263
+ $tag = get_term_by('slug', $v, str_replace('attribute_','',$k));
264
+ if($tag == false ){
265
+ $product_name .= $v.' ';
266
+ }else{
267
+ if(is_array($tag)){
268
+ $product_name .= $tag['name'].' ';
269
+ }else{
270
+ $product_name .= $tag->name.' ';
271
+ }
272
+ }
273
+ }
274
+
275
+ if( !empty( $item_product->get_manage_stock() ) ){ $manage_stock = $item_product->get_manage_stock(); }else{ $manage_stock = ''; }
276
+ if( !empty( $item_product->get_stock_status() ) ){ $stock_status = $item_product->get_stock_status(); }else{ $stock_status = ''; }
277
+ if( !empty( $item_product->get_backorders() ) ){ $backorders = $item_product->get_backorders(); }else{ $backorders = ''; }
278
+ if( !empty( $item_product->get_stock_quantity() ) ){ $stock = $item_product->get_stock_quantity(); }else{ $stock = ''; }
279
+ $product_type = 'product-variant';
280
+
281
+ $data[$i]['id'] = '';
282
+ $data[$i]['sku'] = $sku;
283
+ $data[$i]['product_name'] = $product_name;
284
+ $data[$i]['manage_stock'] = $manage_stock;
285
+ $data[$i]['stock_status'] = $stock_status;
286
+ $data[$i]['backorders'] = $backorders;
287
+ $data[$i]['stock'] = $stock;
288
+ $data[$i]['type'] = $product_type;
289
+ $data[$i]['parent_id'] = $item->ID;
290
+
291
+ $i++;
292
+
293
+ }
294
+ }
295
+
296
+
297
+ }
298
+ $offset = $offset + 10;
299
+ //$data = json_encode( $data );
300
+ $reponse = array(
301
+ 'status' => 'continue',
302
+ 'data' => $data,
303
+ 'offset' => $offset
304
+ );
305
+ echo json_encode( $reponse );
306
+ exit();
307
+
308
+
309
+ }else{
310
+
311
+ $reponse = array(
312
+ 'status' => 'finish',
313
+ 'text' => __( 'All done! Close.', 'woocommerce-stock-manager' )
314
+ );
315
+ echo json_encode( $reponse );
316
+ exit();
317
+
318
+ }
319
+
320
+ }
321
+
322
+ add_action( 'wp_ajax_wsm_get_csv_file', 'wsm_get_csv_file' );
323
+ function wsm_get_csv_file(){
324
+
325
+ $data = stripslashes( $_POST['data'] );
326
+ $data = (array)json_decode( $data );
327
+
328
+ //$temp_memory = fopen('php://memory', 'w');
329
+ $string = array();
330
+ foreach ($data as $line) {
331
+
332
+ $line_array = array(
333
+ 'Id' => $line->id,
334
+ 'Sku' => $line->sku,
335
+ 'Product name' => $line->product_name,
336
+ 'Manage stock' => $line->manage_stock,
337
+ 'Stock status' => $line->stock_status,
338
+ 'Backorders' => $line->backorders,
339
+ 'Stock' => $line->stock,
340
+ 'Type' => $line->type,
341
+ 'Parent ID' => $line->parent_id
342
+ );
343
+ $string[] = $line_array;
344
+ //fputcsv($temp_memory, $line_array, ';');
345
+ }
346
+ //fseek($temp_memory, 0);
347
+
348
+ //header('Content-Type: application/csv');
349
+ //header('Content-Disposition: attachement; filename="stock-manager-export.csv";');
350
+
351
+ //fpassthru($temp_memory);
352
+
353
+ echo json_encode( $string );
354
+
355
+ exit();
356
+
357
+ }
358
+
359
+
360
+ /**
361
+ * Get product data
362
+ *
363
+ */
364
+ add_action( 'wp_ajax_wsm_get_product_data', 'wsm_get_product_data' );
365
+ function wsm_get_product_data(){
366
+
367
+ $product_id = sanitize_text_field( $_POST['productid'] );
368
+ $product = wc_get_product( $product_id );
369
+ $data = array();
370
+ $data['productid'] = $product_id;
371
+
372
+ if( !empty( $product->get_manage_stock() ) ){ $data['manage_stock'] = $product->get_manage_stock(); }
373
+ if( !empty( $product->get_stock_status() ) ){ $data['stock_status'] = $product->get_stock_status(); }
374
+ if( !empty( $product->get_backorders() ) ){ $data['backorders'] = $product->get_backorders(); }
375
+ if( !empty( $product->get_stock_quantity() ) ){ $data['stock'] = $product->get_stock_quantity(); }
376
+
377
+ echo json_encode( $data );
378
+ exit();
379
+
380
+ }