Useful CodeLets

Drupal: Country dependant city dropdowns

This Codlet allows you to load state and city dropdown fields from country you select.
It works as follow:

1. select country, states dropdown will be loaded from country.
2. select state, city dropdown will be loaded from state you select.

Ex. selected country is 'INDIA' you get states dropdown depend on INDIA,

Drupal: Programmatically manage members of sub groups

This CodeLet let you Programmatically manage members of sub groups. also you can add sub group.
you can inviter/remove peoples of sub groups. Invitation will be sent by email.
after installation of this CodeLet you must have to pass the group gid on query string,
Ex. yourdomain/subgroups/$gid.

CodeLet Dependencies:
1-Organic groups ( og )
2-Subgroups for Organic groups ( og_subgroups )
3-OG Invite People ( og_invite_people ).

DrupalD's picture

Drupal: Generate unique invoice number for unbercart order

This CodeLet generate a unique invoice number for every order placed with ubercart. The unique invice number is stored in a custom table and a function is provided to fetch the invoice number for respective order number. You can use this function in order template to display the inovice number

Drupal 8 : Get title and meta tags from Site URL using Ajax

This CodeLet set title and body field values using Ajax.
Place this CodeLet to your custom module file(.module) or Create a Custom module for Drupal 8 as per documentation https://www.drupal.org/docs/8/creating-custom-modules.

First of all add a field(field_link) to your content type. after that add an ajax to that field as per CodeLet.
Ajax example to replace multiple fields on ajaxCallback.
You set multiple fields value on ajax trigger in Drupal 8.

Set user password using RULES

This CodeLet allows to set the user password during Rule execution, the following process can be used.

a) create user entity ($newuser)
b) set a rules variable $password (use PHP code to generate a random string)
c) execute custom PHP which looks like

This way, you can also use the variable $password in say, an email to the user letting them know what their automatically generated password is.

DrupalD's picture

Drupal: Recycle Ubercart coupons

This CodeLet recycles coupons created using Ubercart coupon module. The CodeLet chooses a coupon randomly from the available active coupons and send an email with coupon details to respective users. The coupon is remain active uintil defined period and then expires. This CodeLet, when cron runs, activates those coupons and those can be used again.

Pages

QR code for this page URL This page URL
Feedback