I would like to add a statement to my e-shop. I would like something like "Order has products and quantity" but instead of products, i would like "product category and quantity". For example i have 4 products in my cart and the 2 of them are from the same category "books", i would like for example 10% discount only to these two products. I tried "product category:books" and "'total item in order' equals to 2" but refers to all products in cart and not to the specific category "books".
In a Movimenti content type, I have several fields one of these is an entity references, linked to an Anagrafica Dipendente data content type.
The field is enhanced by a function. In form_alter I need to take a field of the Anagrafica Dipendente.
I saw the array of the field and was thinking of using this code
$id = $form['field_dipendente']['widget'][0]['target_id']['#default_value']['id'];
But the error returns to me
Error: Cannot use object of type Drupal\node\Entity\Node
I am new to OO PHP. I get this error message (I am trying to upgrade the Notify project to D9):
"Error: Call to undefined function Drupal\notify\Form\getCount() in Drupal\notify\Form\QueueForm->buildForm() (line 156 of modules/contrib/notify/src/Form/QueueForm.php)"
The call is made from inside the public function buildForm that is in class QueueForm extends ConfigFormBase in a file named "QueueForm.php", and looks like this:
I'm working on a module that performs some tasks related to content translation at creation/edition of nodes.
I want to prevent some users to edit in particular languages. If current editing language is not the good one I would like to reload page with the appropriate language (i.e. send user to /node/edit/10 if he is on /LANG/node/edit/10).
Is it possible from within my HOOK_form_alter()? Returning a redirectResponse() have no effect (which is logical).
Using Olivero for a personal site, whenever I look at another option I always go back to Olivero. It has that something...
Someone knows if there is any option though, inside Drupal, where I can change the size of the tiny featured images? The only option I thought of was to edit theme code. But, asked this first, as there are a lot of settings on Drupal admin, to be shure. Thank you in advance.