Package templates #16

Merged
nedimu merged 5 commits from templates into master 2018-09-20 13:12:20 +02:00
nedimu commented 2018-08-30 13:26:11 +02:00 (Migrated from gitlab.com)

Smoke Test

Note: There is now a new product type called Template to handle package templates. You can select it among other product types, and a new Taxonomy called Template Category (to replace virtual product). The Taxonomy UI is added in admin panel

First you need a setup:

At least...

2 Template Categories: Example (Camera holders, Cameras)

2 Simple products: - These Are Real world products and they also MUST have one Template category selected

1 Template -

  1. Select template product from product selection dropdown
  2. Notice 4 tabs hardware, service, installation and software. They are the same as those drag and drop boxes in old wiaas.
    You can add your Template categories to any of the tabs.
  3. Save product
  4. Those categories should be loaded every time you open that product again

1 Bundled Product

  1. Select bundled product from product selection dropdown

  2. Notice the template selection meta box will show

  3. Select your template

  4. Categories from templates and their quantities must show

  5. Save bundled product (The error message should show since you did not add any product to bundle)

  6. Get back to bundled product tab

  7. Add real world simple products to the bundle

  8. Modify the max_quantity for this product to be the SAME as quantity for Template categories

  9. Save your bundle product. If you have done everything correctly no error or info message should show

  10. Change max_quantity of any of your bundled product to be different than quantity of Template category that that real world products shares category with.

  11. An different error message will show , telling you witch categories don't have correct quantities.

Smoke Test Note: There is now a new product type called Template to handle package templates. You can select it among other product types, and a new Taxonomy called Template Category (to replace virtual product). The Taxonomy UI is added in admin panel First you need a setup: At least... 2 Template Categories: Example (Camera holders, Cameras) 2 Simple products: - These Are Real world products and they also MUST have one Template category selected 1 Template - 1) Select template product from product selection dropdown 2) Notice 4 tabs hardware, service, installation and software. They are the same as those drag and drop boxes in old wiaas. You can add your Template categories to any of the tabs. 3) Save product 4) Those categories should be loaded every time you open that product again 1 Bundled Product 1) Select bundled product from product selection dropdown 2) Notice the template selection meta box will show 3) Select your template 4) Categories from templates and their quantities must show 5) Save bundled product (The error message should show since you did not add any product to bundle) 6) Get back to bundled product tab 6) Add real world simple products to the bundle 7) Modify the max_quantity for this product to be the SAME as quantity for Template categories 8) Save your bundle product. If you have done everything correctly no error or info message should show 9) Change max_quantity of any of your bundled product to be different than quantity of Template category that that real world products shares category with. 10) An different error message will show , telling you witch categories don't have correct quantities.
nedimu commented 2018-08-30 13:26:38 +02:00 (Migrated from gitlab.com)

changed title from [WIP]{-Added templates product-} to [WIP]{+Package templates+}

changed title from **[WIP]{-Added templates product-}** to **[WIP]{+Package templates+}**
nedimu commented 2018-09-03 12:33:33 +02:00 (Migrated from gitlab.com)

added 1 commit

  • df4b32a6 - Added proper Templates tab to product

Compare with previous version

added 1 commit <ul><li>df4b32a6 - Added proper Templates tab to product</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=22262408&start_sha=f9cef9b6894f02090a3d79da4c899093abe15ee1)
nedimu commented 2018-09-10 13:00:03 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 71baf035 - Implemented UI of package Template, with ajax calls

Compare with previous version

added 1 commit <ul><li>71baf035 - Implemented UI of package Template, with ajax calls</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=22706091&start_sha=df4b32a68c9e8fc26cc0a650d7437ca70cb53ec7)
nedimu commented 2018-09-11 16:58:30 +02:00 (Migrated from gitlab.com)

added 1 commit

  • f5184a08 - finished CRUD operations

Compare with previous version

added 1 commit <ul><li>f5184a08 - finished CRUD operations</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=22809226&start_sha=71baf0352bd6b34811fa13c5f7ca1d41e7d36522)
nedimu commented 2018-09-12 17:04:26 +02:00 (Migrated from gitlab.com)

added 1 commit

  • f51db487 - Added template selection in admin product page

Compare with previous version

added 1 commit <ul><li>f51db487 - Added template selection in admin product page</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=22891980&start_sha=f5184a08e78441cf87df5795ba789f5a4af928fa)
nedimu commented 2018-09-17 10:42:46 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 5e310541 - Refactoring, UI changes when product type and template is selected

Compare with previous version

added 1 commit <ul><li>5e310541 - Refactoring, UI changes when product type and template is selected</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23271415&start_sha=f51db4871e70944b54e90548b1d91b305a61c3ce)
nedimu commented 2018-09-17 22:30:13 +02:00 (Migrated from gitlab.com)

added 1 commit

  • abb84b95 - Added template and category validation

Compare with previous version

added 1 commit <ul><li>abb84b95 - Added template and category validation</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23322099&start_sha=5e310541417d7e6c5a7ca73eba150f5f5636cf9b)
nedimu commented 2018-09-17 23:26:02 +02:00 (Migrated from gitlab.com)

added 1 commit

  • fcaf3c6e - Code cleaning

Compare with previous version

added 1 commit <ul><li>fcaf3c6e - Code cleaning</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23324364&start_sha=abb84b955c2789ec01df91df85d7b7162f4feeb0)
nedimu commented 2018-09-18 00:02:35 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
nedimu commented 2018-09-18 00:02:53 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 19ffa5d3 - Code cleaning

Compare with previous version

added 1 commit <ul><li>19ffa5d3 - Code cleaning</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23325448&start_sha=fcaf3c6e94b0b8cee449464dc94431f96fa8919b)
nedimu commented 2018-09-18 00:03:58 +02:00 (Migrated from gitlab.com)

unmarked as a Work In Progress

unmarked as a **Work In Progress**
nedimu commented 2018-09-18 00:03:58 +02:00 (Migrated from gitlab.com)

assigned to @akrdzic

assigned to @akrdzic
nedimu commented 2018-09-18 00:06:10 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
akrdzic commented 2018-09-18 13:16:48 +02:00 (Migrated from gitlab.com)

Please merge changes from master branch into this one.

Please merge changes from master branch into this one.
nedimu commented 2018-09-18 13:29:14 +02:00 (Migrated from gitlab.com)

added 20 commits

  • 19ffa5d3...d4c75dcf - 19 commits from branch master
  • f2d3efc5 - Added templates product

Compare with previous version

added 20 commits <ul><li>19ffa5d3...d4c75dcf - 19 commits from branch <code>master</code></li><li>f2d3efc5 - Added templates product</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23362229&start_sha=19ffa5d3bbcc01ab2b90d00203df7161a16d57cd)
nedimu commented 2018-09-19 22:34:16 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 43408382 - Repalced virtual product with template category

Compare with previous version

added 1 commit <ul><li>43408382 - Repalced virtual product with template category</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23500901&start_sha=f2d3efc5265aa90729f7dbca1a33c8c98886be6f)
nedimu commented 2018-09-19 22:40:51 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
akrdzic commented 2018-09-20 10:53:02 +02:00 (Migrated from gitlab.com)

When I add Camera Holder and Camera Unit categories one after the another, the second one gets displayed as CameraHolderCameraUnit

Also it would be very helpful for the user if template description would be in format
Category x[Number]

Selection_020Selection_021

When I add Camera Holder and Camera Unit categories one after the another, the second one gets displayed as **CameraHolderCameraUnit** Also it would be very helpful for the user if template description would be in format **Category x[Number]** ![Selection_020](/uploads/07e7acbf0c321e87e3f5ef4e6edc05f3/Selection_020.png)![Selection_021](/uploads/c1c0075c2e0fb456a8af09a66bd7b3ee/Selection_021.png)
akrdzic commented 2018-09-20 11:26:57 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 94ba6976 - Show downlodable files only for simple and bundles

Compare with previous version

added 1 commit <ul><li>94ba6976 - Show downlodable files only for simple and bundles</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23553086&start_sha=434083820c0d46d344acf1d7c8b3ff25f2e72417)
nedimu commented 2018-09-20 11:29:41 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 246656bc - Fixed template category double title bug

Compare with previous version

added 1 commit <ul><li>246656bc - Fixed template category double title bug</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23553265&start_sha=94ba69761daf4f21eb3c9d6155df2332ff85933b)
akrdzic commented 2018-09-20 11:37:22 +02:00 (Migrated from gitlab.com)

Remove error_log

Remove `error_log`
akrdzic commented 2018-09-20 11:45:48 +02:00 (Migrated from gitlab.com)

This should be inside includes/template and not here. Here is only logic that is specific for admin interface.

This should be inside `includes/template` and not here. Here is only logic that is specific for admin interface.
nedimu commented 2018-09-20 12:33:39 +02:00 (Migrated from gitlab.com)

This is fixed

This is fixed
nedimu commented 2018-09-20 12:33:45 +02:00 (Migrated from gitlab.com)

This is fixed

This is fixed
nedimu commented 2018-09-20 12:35:18 +02:00 (Migrated from gitlab.com)

changed this line in version 14 of the diff

changed this line in [version 14 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23559681&start_sha=246656bc5651251352db038b8a076634fcf833a9#1f8bc9064b8c011e89270223302203b7fa68c73d_88_86)
nedimu commented 2018-09-20 12:35:18 +02:00 (Migrated from gitlab.com)

changed this line in version 14 of the diff

changed this line in [version 14 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23559681&start_sha=246656bc5651251352db038b8a076634fcf833a9#942c16bb8f1c06d450fe4475d32481a62df9e703_1_0)
nedimu commented 2018-09-20 12:35:18 +02:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>d3b0d101 - Deleted error logs</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/16/diffs?diff_id=23559681&start_sha=246656bc5651251352db038b8a076634fcf833a9)
akrdzic commented 2018-09-20 13:12:12 +02:00 (Migrated from gitlab.com)

I will merge this PR since demo is today and will add more comments to this PR after i review and merge profiles and will add another card for it.

I will merge this PR since demo is today and will add more comments to this PR after i review and merge profiles and will add another card for it.
akrdzic commented 2018-09-20 13:12:20 +02:00 (Migrated from gitlab.com)

merged

merged
akrdzic commented 2018-09-20 13:12:20 +02:00 (Migrated from gitlab.com)

mentioned in commit cf92f62703

mentioned in commit cf92f627034e1a577f7e733a370a5cf9ab80142f
akrdzic commented 2018-09-20 16:01:25 +02:00 (Migrated from gitlab.com)

resolved all discussions

resolved all discussions
akrdzic commented 2018-09-20 16:03:18 +02:00 (Migrated from gitlab.com)

We should check with Senad if template categories should have hardware, software, installation and service as root parents, since currently that is not implemented and it mabe should be (actually probably should be).

We should check with Senad if template categories should have hardware, software, installation and service as root parents, since currently that is not implemented and it mabe should be (actually probably should be).
akrdzic commented 2018-09-21 18:55:47 +02:00 (Migrated from gitlab.com)

A lot of code that is specific for woocoommerce product search could be avoided here if woocoommerce product search was not used.

Instead I think that simple input field with JQuery autocomplete feature could be used.

This way:

  • autocomplete source property could be used to retrieve terms
  • autocomplete menu instance rendering feature could be used to render term to menu, so id could be kept in item object (since default instance rendering requires only string)
  • autocomplete select option could be used to trigger request for adding new category to template.
element.autocomplete({
                source: function(request, response) {
                        var term = request.term;
                        // send terms query ...
                    });
                },
                select: function(event, ui) {
                    category = ui.item;
                   // send request to add category to template ...
                }
            })
.autocomplete( 'instance' )._renderItem = function( ul, item ) {
    return $( '<li role="option" id="wiaas-template-category-option-' + item.id + '">' )
    .text( item.name )
    .appendTo( ul );
  };
});
A lot of code that is specific for woocoommerce product search could be avoided here if woocoommerce product search was not used. Instead I think that simple input field with JQuery [autocomplete feature](https://api.jqueryui.com/autocomplete/) could be used. This way: * autocomplete *source* property could be used to retrieve terms * autocomplete menu *instance* rendering feature could be used to render term to menu, so id could be kept in item object (since default instance rendering requires only string) * autocomplete *select* option could be used to trigger request for adding new category to template. ``` element.autocomplete({ source: function(request, response) { var term = request.term; // send terms query ... }); }, select: function(event, ui) { category = ui.item; // send request to add category to template ... } }) .autocomplete( 'instance' )._renderItem = function( ul, item ) { return $( '<li role="option" id="wiaas-template-category-option-' + item.id + '">' ) .text( item.name ) .appendTo( ul ); }; }); ```
akrdzic commented 2018-09-21 18:56:47 +02:00 (Migrated from gitlab.com)

The same code is repeated 4 times.

Also <a> element can have id of the category as data property so it could be used to build id of corresponding element that should be removed or something similar.

The same code is repeated 4 times. Also `<a>` element can have id of the category as data property so it could be used to build id of corresponding element that should be removed or something similar.
akrdzic commented 2018-09-21 19:01:33 +02:00 (Migrated from gitlab.com)

Maybe rename this to add_template_product_meta_box

Maybe rename this to `add_template_product_meta_box`
akrdzic commented 2018-09-21 19:02:02 +02:00 (Migrated from gitlab.com)

Also this to add_template_product_metabox_content

Also this to `add_template_product_metabox_content`
akrdzic commented 2018-09-21 19:04:23 +02:00 (Migrated from gitlab.com)

Let us try not mix view code with logic, since we already have views for this.

Let us try to keep logic here and presentation in views and only if html code is really small so it does not justify adding view we can have it directly in a function.

Let us try not mix view code with logic, since we already have views for this. Let us try to keep logic here and presentation in views and only if html code is really small so it does not justify adding view we can have it directly in a function.
akrdzic commented 2018-09-21 19:12:36 +02:00 (Migrated from gitlab.com)

This way of getting information from template should not be here. It should be inside of class-wiaas-wc-product-template.php and accessed with correspoding methods.

This way of getting information from template should not be here. It should be inside of `class-wiaas-wc-product-template.php` and accessed with correspoding methods.
akrdzic commented 2018-09-21 19:14:50 +02:00 (Migrated from gitlab.com)

The same as above, this whole logic of accessing metadata to retrieve categories, quantities and corresponding metadata should be in class-wiaas-wc-product-template.php.
From there Wiaas_Template_Category_Object objects are to be requested.

The same as above, this whole logic of accessing metadata to retrieve categories, quantities and corresponding metadata should be in `class-wiaas-wc-product-template.php`. From there `Wiaas_Template_Category_Object` objects are to be requested.
akrdzic commented 2018-09-21 19:18:03 +02:00 (Migrated from gitlab.com)

This validation logic should also be moved somewhere else. Maybe to new wiaas-template-functions.php file where these functions that are not binding to single template object but implement template logic can be.

It is important to know that this admin part is only for admin interface, and whole application logic should work even if this admin folder is deleted and wp admin interface is replaced with some other interface.

This validation logic should also be moved somewhere else. Maybe to new `wiaas-template-functions.php` file where these functions that are not binding to single template object but implement template logic can be. It is important to know that this admin part is only for admin interface, and whole application logic should work even if this admin folder is deleted and wp admin interface is replaced with some other interface.
akrdzic commented 2018-09-21 19:19:38 +02:00 (Migrated from gitlab.com)

The same as above, this logic should be move somewhere else and only called here as method or function.
Admin folder cannot contain our core logic implementation.

The same as above, this logic should be move somewhere else and only called here as method or function. Admin folder cannot contain our core logic implementation.
akrdzic commented 2018-09-21 19:46:33 +02:00 (Migrated from gitlab.com)

The same as above. This logic should not be in admin but somewhere else.

The same as above. This logic should not be in `admin` but somewhere else.
akrdzic commented 2018-09-21 20:13:22 +02:00 (Migrated from gitlab.com)

This function does not search correctly since term should be retrieved from $_GET and not $_POST. Currently it probably searches with empty name__like option.

Use:

$term = wp_unslash($_GET['term']);
$terms = get_terms(array(
            'taxonomy' => 'template_category',
            'name__like' => $term,
            'hide_empty' => false // so that query returns terms that have no product assigned to it
        ));
This function does not search correctly since `term` should be retrieved from `$_GET` and not `$_POST`. Currently it probably searches with empty `name__like` option. Use: ``` $term = wp_unslash($_GET['term']); $terms = get_terms(array( 'taxonomy' => 'template_category', 'name__like' => $term, 'hide_empty' => false // so that query returns terms that have no product assigned to it )); ```
akrdzic commented 2018-09-21 20:16:08 +02:00 (Migrated from gitlab.com)

Again since presentation code is pretty large we should keep it in views template for better overview of the implemented logic.

Again since presentation code is pretty large we should keep it in views template for better overview of the implemented logic.
akrdzic commented 2018-09-21 20:20:41 +02:00 (Migrated from gitlab.com)

I am not really sure why do we need this as separate class. It has no separate logic to justify separating it into its own class. It is only array of properties: (category_id, name, quantity).

I am not really sure why do we need this as separate class. It has no separate logic to justify separating it into its own class. It is only array of properties: (`category_id`, `name`, `quantity`).
akrdzic commented 2018-09-21 20:28:40 +02:00 (Migrated from gitlab.com)

I am not sure when and where is this used. Maybe for previous implementation? If so, then it is obsolete.

I am not sure when and where is this used. Maybe for previous implementation? If so, then it is obsolete.
akrdzic commented 2018-09-21 20:29:38 +02:00 (Migrated from gitlab.com)

Again, since this presentation code is large enough that it should be separated to its own view template.

Again, since this presentation code is large enough that it should be separated to its own view template.
akrdzic commented 2018-09-21 20:35:20 +02:00 (Migrated from gitlab.com)

As I presented in my first comment regarding js code for handling product search, this select is not necessary for features needed here. I think it could be replaced with simple text input field that will be used with jQuery autocomplete feature.

Also, side note data-action="woocommerce_json_search_products" is obsolete and not used. This part should be data-action="my_custom_search_endpoint" when used with custom search endpoint. Leaving it as it is and then implementing ajax search in .js defies its purpose.

As I presented in my first comment regarding js code for handling product search, this select is not necessary for features needed here. I think it could be replaced with simple text input field that will be used with jQuery autocomplete feature. Also, side note `data-action="woocommerce_json_search_products"` is obsolete and not used. This part should be `data-action="my_custom_search_endpoint"` when used with custom search endpoint. Leaving it as it is and then implementing ajax search in .js defies its purpose.
akrdzic commented 2018-09-21 20:37:26 +02:00 (Migrated from gitlab.com)

admin folder should not be aware that these properties are saved as template product metadata. It should be handled inside class-wiaas-wc-product-template.php and here only called as a method.

`admin` folder should not be aware that these properties are saved as template product metadata. It should be handled inside `class-wiaas-wc-product-template.php` and here only called as a method.
akrdzic commented 2018-09-21 20:39:40 +02:00 (Migrated from gitlab.com)

Also, since there are many instances of this to avoid marking every one of them I will just say it here:

Places where category ids are saved and displayed should not be referred to as products. That remained from previous implementation and should be correctly changed to template category to reflect new implementation.

Also, since there are many instances of this to avoid marking every one of them I will just say it here: Places where category ids are saved and displayed should not be referred to as products. That remained from previous implementation and should be correctly changed to template category to reflect new implementation.
akrdzic commented 2018-09-21 20:47:13 +02:00 (Migrated from gitlab.com)

I made new card for handling this code review: https://app.asana.com/0/697944902557002/832515489359311

I made new card for handling this code review: https://app.asana.com/0/697944902557002/832515489359311
nedimu commented 2018-09-26 14:33:05 +02:00 (Migrated from gitlab.com)

There was a lot of code in this file, that was not supposed to be here in the first place and now there is no more code that is specific for woocoommerce product search.

I see how your example with jquery and inplut could work. But I still think that using this woocomerce ui is not a big deal.

You shnould check the new version of this file in new PR , and tell me what you think

There was a lot of code in this file, that was not supposed to be here in the first place and now there is no more code that is specific for woocoommerce product search. I see how your example with jquery and inplut could work. But I still think that using this woocomerce ui is not a big deal. You shnould check the new version of this file in new PR , and tell me what you think
nedimu commented 2018-09-26 14:38:26 +02:00 (Migrated from gitlab.com)

fixed

fixed
nedimu commented 2018-09-26 14:39:50 +02:00 (Migrated from gitlab.com)

Fixed

Fixed
nedimu commented 2018-09-26 14:42:37 +02:00 (Migrated from gitlab.com)

I am not really sure about what you ment here

I am not really sure about what you ment here
nedimu commented 2018-09-27 12:35:48 +02:00 (Migrated from gitlab.com)

Fixed

Fixed
nedimu commented 2018-09-27 13:09:20 +02:00 (Migrated from gitlab.com)

Fixed

Fixed
nedimu commented 2018-09-27 13:15:13 +02:00 (Migrated from gitlab.com)

The line of code (140) that you added a comment for does not have anything to do with validation.

If you were referring to validate_bundle() method.

Than I think that this method is exactly where it is supposed to be, since it activates on woocommerce_admin_process_product_object hook, and uses Admin notifications UI. So I don't see it being part of any other part of the project, except for admin panel.

EDIT: I see you addressed the issue ova validate_bundle() method in another comment, and I see now that you refered to get_bundled_product_categories method as validation logic. As far as this issue goes. it is fixed

The line of code (140) that you added a comment for does not have anything to do with validation. If you were referring to validate_bundle() method. Than I think that this method is exactly where it is supposed to be, since it activates on woocommerce_admin_process_product_object hook, and uses Admin notifications UI. So I don't see it being part of any other part of the project, except for admin panel. EDIT: I see you addressed the issue ova validate_bundle() method in another comment, and I see now that you refered to `get_bundled_product_categories` method as validation logic. As far as this issue goes. it is fixed
nedimu commented 2018-09-27 13:18:59 +02:00 (Migrated from gitlab.com)

I agree with you here, but I do need to have a method here that can be activated when woocommerce_process_product_meta_bundle hook fires. I moved the actual saving to DB part to another method and file that is not in admin panel

I agree with you here, but I do need to have a method here that can be activated when woocommerce_process_product_meta_bundle hook fires. I moved the actual saving to DB part to another method and file that is not in admin panel
nedimu commented 2018-09-27 13:33:19 +02:00 (Migrated from gitlab.com)

I think that this method is exactly where it is supposed to be, since it activates on woocommerce_admin_process_product_object hook, and uses Admin notifications UI, So I don't see it as core logic and being part of any other part of the project, except for admin panel.

I think that this method is exactly where it is supposed to be, since it activates on woocommerce_admin_process_product_object hook, and uses Admin notifications UI, So I don't see it as `core` logic and being part of any other part of the project, except for admin panel.
nedimu commented 2018-09-27 13:46:35 +02:00 (Migrated from gitlab.com)

Wow .. my bad... Fixed

Wow .. my bad... Fixed
nedimu commented 2018-09-27 13:49:58 +02:00 (Migrated from gitlab.com)

I don't get this reference. What do you mean by views template ??? And "presentation code" being pretty large

I don't get this reference. What do you mean by views template ??? And "presentation code" being pretty large
nedimu commented 2018-09-27 13:53:52 +02:00 (Migrated from gitlab.com)

This class was created , at first for compering object to object( both ID and quantity and name) by 'equals' method. I did not go trough with that logic.
And I don't see it's purpose now , i don't find it harmful to stay this way.

This class was created , at first for compering object to object( both ID and quantity and name) by 'equals' method. I did not go trough with that logic. And I don't see it's purpose now , i don't find it harmful to stay this way.
nedimu commented 2018-09-27 13:55:24 +02:00 (Migrated from gitlab.com)

It is a dead code..
Fixed

It is a dead code.. Fixed
nedimu commented 2018-09-27 13:56:11 +02:00 (Migrated from gitlab.com)

And again, I don't get this reference

And again, I don't get this reference
nedimu commented 2018-09-27 14:03:20 +02:00 (Migrated from gitlab.com)

I have removed woocommerce_json_search_products since it is not used.
As for, the whole select, I have explained before, that I don't see the problem, and I find it simpler this way instead of using jquery atocompleate.

Woocomerce bundled products is using this same UI, and for consistency I find it more acceptable to have the same search box, instead of different UI for every product type that we have.

I have removed `woocommerce_json_search_products` since it is not used. As for, the whole select, I have explained before, that I don't see the problem, and I find it simpler this way instead of using jquery atocompleate. Woocomerce bundled products is using this same UI, and for consistency I find it more acceptable to have the same search box, instead of different UI for every product type that we have.
nedimu commented 2018-09-27 14:11:35 +02:00 (Migrated from gitlab.com)

This part was taken from woocomerce project structure.
The processing of the actual data (extracting it from post) should be the part of admin PANEL since it is related to admin UI
You can check woocomerce code for metaboxes for that.

Only thing that should not be here is an actual method that saves data to DB

update_post_meta($post_id, '_template_items_' . $option, $processed_template_data);
I have moved this method

This part was taken from woocomerce project structure. The processing of the actual data (extracting it from post) should be the part of admin PANEL since it is related to admin UI You can check woocomerce code for metaboxes for that. Only thing that should not be here is an actual method that saves data to DB `update_post_meta($post_id, '_template_items_' . $option, $processed_template_data);` I have moved this method
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: senaduka/old-new-wiaas#16