Create customers in admin & assign categories to users

Open to all! Ask other shopowners for help.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Create customers in admin & assign categories to users

Post by ecartz »

LeeFoster wrote: Wed Jun 22, 2022 11:08 am are there any listeners I can use on catalog.php?
Each action at https://github.com/CE-PhoenixCart/Phoen ... ns/catalog has a listener. E.g. copyToConfirmAction


Join The Code Co-op to get access to your library in the Code Co-op Forum
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

ecartz wrote: Wed Jun 22, 2022 12:50 pm Each action at https://github.com/CE-PhoenixCart/Phoen ... ns/catalog has a listener. E.g. copyToConfirmAction
What about for the actual form insert?
User avatar
burt
Core Team
Posts: 4560
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Create customers in admin & assign categories to users

Post by burt »

LeeFoster wrote: Wed Jun 22, 2022 12:58 pm What about for the actual form insert?
Loads of examples in the Supporters Codes.
I am not here to build for you.
I am here to build with you. Let's help each other.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

burt wrote: Wed Jun 22, 2022 1:55 pm
LeeFoster wrote: Wed Jun 22, 2022 12:58 pm What about for the actual form insert?
Loads of examples in the Supporters Codes.
I'm using injectFormDisplay for the customer one but can't see that I can use this for catalog.php. Will look at other supporters code for examples.
User avatar
burt
Core Team
Posts: 4560
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Create customers in admin & assign categories to users

Post by burt »

Code: Select all

  public function listen_productActionSave() {
      // whatever you need to do here
  }

  public function listen_updateProductAction() {
    $this->listen_productActionSave();
  }

  public function listen_insertProductAction() {
    $this->listen_productActionSave();
  }
See the PRO example of S06E02 as an example.
I am not here to build for you.
I am here to build with you. Let's help each other.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

burt wrote: Wed Jun 22, 2022 2:50 pm

Code: Select all

  public function listen_productActionSave() {
      // whatever you need to do here
  }

  public function listen_updateProductAction() {
    $this->listen_productActionSave();
  }

  public function listen_insertProductAction() {
    $this->listen_productActionSave();
  }
See the PRO example of S06E02 as an example.
Sorry I wasn't clear, I mean to display the extra input in the new/edit category form. Unless you're saying I can use one of these to do that, in which case I'm going to be very confused.
User avatar
burt
Core Team
Posts: 4560
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Create customers in admin & assign categories to users

Post by burt »

For the actual form;

injectDataForm
injectLanguageForm

See /admin/includes/actions/catalog/views/new_product.php

You could put your extra things in a new Tab, which is what I like doing.

I am almost certain there are examples of both of these in Supporters Code. I know there is for new tab.
I am not here to build for you.
I am here to build with you. Let's help each other.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

burt wrote: Wed Jun 22, 2022 3:27 pm You could put your extra things in a new Tab, which is what I like doing.

I am almost certain there are examples of both of these in Supporters Code. I know there is for new tab.
For new products I would put it in a new tab, categories don't have tabs though.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Create customers in admin & assign categories to users

Post by ecartz »

burt wrote: Wed Jun 22, 2022 3:27 pm injectDataForm
s04e11 - Admin Comments
s09e03 - PI Layout Modules/leadtime

I don't see any examples of injectLanguageForm.

For productTab:

s02e06 - Product Terms
s02e10 - Low Stock and Dashboard
s04e10 - Product Specs
s05e04 - MORE Info Page Extensions
s05e07 - More PI mods
s10e02 - File Uploading
s10e06 - Soft Redirects

For categories, you would add to the infoBox.

s02e10 - Low Stock and Dashboard
s04e11 - Admin Comments
s05e07 - More PI mods
s10e06 - Soft Redirects

Examples not necessarily specific to categories. All are infobox modifications on the catalog page. I think that Admin Comments does something with categories.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

This is my hook file so far, unfortunately nothing shows.

Code: Select all

public function listen_infoBox($parameters) {
    global $cInfo;
	      
	   $contents[] = ['text' => 'Private Category' . '<br>' . (new Tickable('private', ['value' => $cInfo->private, 'class' => 'custom-control-input', 'id' => 'private'], 'checkbox'))->set('value', $cInfo->private)];
    
  }
I'm hoping to get a little tick button at the bottom below the sort order.
edit category.PNG
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply