Adding Price Attributes

Adding Price Attributes

I am searching how to add price values to existing product attributes in Drupal Commerce 2.X For Example: T-shirt price = $10.00 A product variation/color = Red = +$2.00 A product variation/size = Large = +$3.00 Choosing the Red would increase the price to = $12.00... read more
Adding Price Attributes

How can I get the current node view mode and add to block template suggestion?

In my code, I need to get the current view mode of the node to be able to pass it to be used as a block template suggestion. The function I have set up is able to grab all available view modes, but I just want the current one. Possibly a condition that I haven’t... read more
Adding Price Attributes

How to get the language code when a language name is given?

We are creating nodes programmatically on submitting a form. The language of a node is an input value in the form. How can I get the langcode, when I have the Language name? For example, user may type English. So i should convert it to “en” If there an... read more
Adding Price Attributes

How to display my array values in nested array of type stdClass Object

i am having trouble figuring out how to render my array fields values for specific fields. So far i’ve managed to query my db and collect the node values and save it to my cart of items. However, i am unsure how to echo these into a table for users to view in... read more
Adding Price Attributes

main menu link as language switcher

I have 2 language and these situation: main menu -> lang1 -> link to www.foo.com/ main menu -> lang2 -> link to www.foo.com/en All sites when switch manually on browser the language, But my main menu link not work. I have no space to place an other block... read more
Adding Price Attributes

Unable to fetch paragraph’s multi field values inside node twig

I have a content type as “worker”. I have a Paragraph “test” and I am referencing “test” paragraph inside my content type “worker”. This allows multiple values to be saved. How can I get the multiple “test”... read more
Adding Price Attributes

Custom Ajax forms with managed_file form element

We have a form with three fields – where depending on the value of the first select field, we will show the other two form elements – one select field (the options depends on the value of the first select field) and one file upload field. The issue is that... read more
Adding Price Attributes

Validation constraints on form fields ignored

Trying to figure out custom validation with constraints, but no luck yet. Right now, my form posts content and gives no errors when form is filled out incorrectly. (Please avoid suggesting validation modules — I know those exist.) Maybe somebody knows what... read more
Adding Price Attributes

getting error when doing the composer install

Drupal version was 8.6.2 and moved to new server. When doing the core update , getting an error like below. Problem 1 – remove drupal/drupal No version set (parsed as 1.0.0)|remove drupal/core 8.6.3 – don’t install drupal/core 8.6.2|remove... read more