instructions.txt 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Write WordPress plugin called "studiou-wc-product-cat-manage" in PHP, that extends WooCommerce plugin.
  2. Plugin will have following features:
  3. 1. Allows to create batch export and import of Product Categories.
  4. 2. Export and import data will be .csv file with following columns:
  5. name - Product Category Name
  6. url-name - Product Category url part name (slug)
  7. parent-name - Reference to parent Product Category Name (If has no parrent, value is empty)
  8. description - Product Category description
  9. display-type - Product Category display type (values: 'default', 'products', 'subcategories', 'both')
  10. visibility - Product Category visibility according to WooCommerce Protected Categories plugin (values: 'public', 'protected')
  11. protected-passwords - Product Category visibility according to WooCommerce Protected Categories plugin if 'visibility' column is set to protected. Defines pipe (|) separated values of passwords for current settings
  12. operation - Record operation, 'A' - means add new record, 'D' - remove record (identification is 'name' column), 'U' - update record (identification is 'name' column)
  13. Columns 'name', 'url-name', 'parent-name', 'description', 'display-type' are native WooCommerce product category properties. Columns 'visibility' and 'protected-passwords' are properties of WooCommerce Protected Categories plugin (extended)
  14. .csv file separator is comma ',' changacter. String values is isolated between quotation mark '"', means if inside quotation mark is comma, comma is not separator. Encoding of import and export file is UTF-8.
  15. 3. Extends Products menu for items "Import product categories" and "Export product categories". In "Import product categories" there will be button for file selection and second button "Import product categories". When I press this button Import will be processed. After import operation imformation will be shown as follows (sample):
  16. Imported 5 items:
  17. Product category 'Item 0' already exists. Skiped.
  18. Product category 'Item 1' created
  19. Product category 'Item 2' created
  20. Product category 'Item 3' created
  21. Product category 'Item 4' updated
  22. Product category 'Item 5' deleted
  23. Product category 'Item 6' not found.
  24. or when error as follows (sample):
  25. Import error:
  26. Null reference exception
  27. 4. Plugin requires following plugins:
  28. WooCommerce minimal version 9.8
  29. WooCommerce Protected Categories minimal version 2.7
  30. 5. Plugin will have following header:
  31. /**
  32. * Plugin Name: QDR - Studiou WC Export/Import Product Categories
  33. * Plugin URI: https://www.quadarax.com/plugins/studiou-wc-product-cat-manage
  34. * Description: Allows batch import and export WooCommerce product categories
  35. * Version: 1.2.0
  36. * Requires at least: 6.8.1
  37. * Requires PHP: 8.2
  38. * Author: Dalibor Votruba
  39. * Author URI: https://www.quadarax.com
  40. * License: GPL v2 or later
  41. * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  42. * Text Domain: studiou-wc-product-cat-manage
  43. * Domain Path: /languages
  44. * WC requires at least: 9.0
  45. * WC tested up to: 9.8
  46. * Woo: 12345:342928dfsfhsf8429842374wdf4234sfd
  47. */
  48. 6. Implements following features:
  49. - new menu "Products" | "Category manipulations"
  50. - In screen there will be several operations (sections) headed by caption (name of operation):
  51. - In screen Category manipulations implements operation called "Move products between categories" in header to move all products from selected product category to other selected.
  52. - There will be two comboboxes with Category list (with information how many products contains): First will be source product category, second will be target product category.
  53. - The will be button "Do" that start operation:
  54. - iterate products from source category
  55. - product in iteration will me reassigned to target category (and remove from source category)
  56. - at the end of operation print out output information how many products was moved and new count of products in source category and new count of products in target ctegory.
  57. - In screen Category manipulations implements operation called "Batch description between categories" in header to set description to selected product category.
  58. - There will be listbox with checkboxes with Category list. Listbox will have client operations "check all", "uncheck all".
  59. - There will be multiline textbox called "Product categories description".
  60. - The will be button "Do" that start operation:
  61. - iterate selected product categories.
  62. - category in iteration will be set category field "Description"
  63. - at the end of operation print out output information how many categories was set.
  64. - all text will be translatable