Exporting Custom Menu Translation

Exporting Custom Menu Translation

Question: How do I export/import translation of Custom Menu Items I have a module that takes all the .po files for custom strings and then uses locale to batch import them. This works great. I was wanting to translate my custom menu links, but when I search for them... read more
Change the subtotal amount in commerce_email_order_items

Change the subtotal amount in commerce_email_order_items

First, sorry for my poor English, and the faults you will probably found. Globally, what I am trying to do , is to add the shipping amount into the ‘base_price’ component price, also labelled subtotal. So far, it’s working correctly on the site... read more
Change the subtotal amount in commerce_email_order_items

How do I attach AJAX click events on <button> or <div> tags?

There are many examples how to make ajax form submits and also many examples how to make drupal ajax links. How do I attach AJAX click events on, for example, <button> or <div> tags? read more
Change the subtotal amount in commerce_email_order_items

Add exposed filter for user roles

In Ubercart, the uc_order view (admin/structure/views/view/uc_orders) uses exposed filters for status and order ID. I can add another filter, for example username, email and so on by clicking on Add filter criteria and selecting the criteria (user:username,... read more
How to exclude nodes from views result?

How to exclude nodes from views result?

I have a view with one field that shows rendered nodes, and a contextual filter (multiple values allowed) that provides the nids that should be used in the view. Each node (with nid from the context filter) contains a node reference field with multiple values (nids of... read more
Passing Node ID/Title to Next Page Webform Field

Passing Node ID/Title to Next Page Webform Field

I am new to drupal 8 and assisting my development team with design part. We are stuck in one place and not manage to move forward. We want to pass the node ID info to a webform filed which exist in another page. In the attached image I have explained what we want to... read more
Change the subtotal amount in commerce_email_order_items

How to load content in a div with ajax?

After validate with javascript that I’ll be able to use the client location: if (navigator.geolocation) { … I need to load the content of a view block with arguments (based in the position coords). I know how to obtain the HTML that I want to put inside... read more
Change the subtotal amount in commerce_email_order_items

Problem installing Devel module onto site

I went to drupal.org, copied the link for the Devel module, went to my site, New Module (under extensions) paste the link into the “Install from a URL” and when I hit Install it gives me the following error message: “Failed to fetch file due to error... read more
Change the subtotal amount in commerce_email_order_items

Providing menu route parameter values from url

Suppose I have the following route in my ej.routing.yml file: ej.form.user.profile: path: ‘/user/{user}/ej_profile’ defaults: _title: ‘EJ Profile’ _form: ‘DrupalejFormUserProfileForm’ requirements: _role: ‘authenticated’... read more
Change the subtotal amount in commerce_email_order_items

How to combine two batch operations for views data export into one?

I have been using a custom module that was posted here: https://www.drupal.org/node/1875456 I slightly modified this module and created two copies of it, as I have two views and planning to add third one but it currently doesn’t work properly so let me explain:... read more
Change the subtotal amount in commerce_email_order_items

Views Bulk Operations skip confirmation

I have defined a custom action for a VBO. function expense_action_info() { return [ ‘expense_finalize_action’ => [ ‘type’ => ‘node’, ‘label’ => t(‘Approve and finalize expense’),... read more
Change the subtotal amount in commerce_email_order_items

Set a specific changed date for a node

I am creating nodes programatically based on the feed from an external api. I have managed to create all nodes, assign field values and also set the created date. Now my problem is that I also need to set the changed date of each node to match the value returned from... read more
Change the subtotal amount in commerce_email_order_items

Twig Tokens in Views not Rendering Inside an HTML Element

I’m using views to create a custom block of shortcut icons and need the images to link to the corresponding content. Using Rewrite Results I can overwrite the output of the view and have an anchor tag wrap around the image, however when I inspecting the output... read more
Change the subtotal amount in commerce_email_order_items

How do I create a calendar of events? [closed]

I am needing a solution to add an event to a calendar, and the events are also displayed on a web page in order of the next event. Similar to this WordPress plugin: https://wordpress.org/plugins/the-events-calendar/screenshots/ Any help is greatly appreciated. read more
Change the subtotal amount in commerce_email_order_items

How to convert an image field to an entity reference field

We have Drupal Paragraphs using image fields that are media entities. When the media entity is updated with a new image the old images still show unless we manually edit each page, remove the image from the paragraph, and add it back. We have tested using entity... read more
Change the subtotal amount in commerce_email_order_items

limit the number of nodes per User

I’d like to limit the number of nodes that an authenticated user can create. For example users can not create more than One post for specific Content Type. I am wondering how can I do so? Thanks.. read more
Change the subtotal amount in commerce_email_order_items

How to set "Entity has Field" when the Rules Event is unrelated to the entity?

In Rules, I am trying to update/calculate a field in the User’s account upon completion of a commerce payment. The condition data selector obviously only wants to populate commerce related fields, since my Event is “After saving new payment”. How can... read more
Change the subtotal amount in commerce_email_order_items

Drupal Array to string conversion hook

I am trying to change the links of the Language Switcher module. I am using the following code, but it doesn’t work. function mytheme_links__language_block(&$variables) { // Change variables return $variables; } When it gets executed, I get the following... read more
Change the subtotal amount in commerce_email_order_items

template_preprocess custom block type

I have a custom block type with two different fields. What I am trying to accomplish is, to hide the first field if the second is not empty. That seems like something that could be done in template_preprocess, but where would I put it and what would be my template?... read more
Change the subtotal amount in commerce_email_order_items

How to make Drupal 8 forget an old deleted field?

After deploying a Drupal 8 site to a new server, we have the problem of an old deleted field being remembered by some subsystem or other, leading to this error being thrown on whenever cron runs: DrupalCoreDatabaseDatabaseExceptionWrapper: SQLSTATE[42S02]: Base table... read more