Create customers in admin & assign categories to users

Open to all! Ask other shopowners for help.
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: Tue Jun 28, 2022 12:34 pm Or actually, toss it entirely and do

Code: Select all

public function listen_updateCategoryPrep() {
  if (isset($_POST['private'])) {
    $GLOBALS['sql_data']['private'] = Text::input($_POST['private']);
  }
}
That section's hooked between the initialization and the perform.
Running some tests with this code and it's not passing a POST value from the checkbox.

I get the below error
Notice: Undefined index: private in


Join The Code Co-op to get access to your library in the Code Co-op Forum
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 »

Is the checkbox checked or unchecked? That's the message that I would expect with an unchecked box and without the isset. The isset is specifically to watch for the unchecked case.

Code: Select all

'value' => $GLOBALS['cInfo']->private
is incorrect. That needs to be a constant value (the value when checked), not something that changes. Given the other code, it should be

Code: Select all

'value' => '1'
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Create customers in admin & assign categories to users

Post by radhavallabh »

Hi dear;
Were you able to convert this into an addon finally?
It would be very helpful in creating an additional module using this feature....
Please do let me know...
Thank you in advance;
Very Warm Regds./
radhavallabh


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