logo

Blog

22 April

Get user list by role programmatically in Drupal8

Published On: Wed, 04/22/2020 - 22:13

User this code before

use Drupal\user\Entity\User;

Thise code will be return user list of a given role (editor)

	$ids = \Drupal::entityQuery('user')
	->condition('status', 1)
	->condition('roles', 'editor')
	->execute();
	$users = User::loadMultiple($ids);
	foreach($users as $user){
		$username = $user->get('name')->value;
		$uid = $user->get('uid')->value;
		$userlist[$uid] = $username;
	}
				  

22 April

Apply coupon to Regular Price in Woocommerce

Published On: Wed, 04/22/2020 - 22:13

When we apply coupon for discount its applied for sale price by default but we need to apply discount coupon on regular price so you can use this code on function.php By default cart and product show sale price after applying this code Regular price will be update on cart.

add_action( 'woocommerce_before_calculate_totals', 'add_custom_price', 10, 1);
function add_custom_price( $cart_object) {

    global $woocommerce;

    if ( is_admin()…
				  

22 April

Online Reputation Management

Published On: Wed, 04/22/2020 - 22:13

Online popularity control known as Online Reputation Management Company too is a key to success in online company. Why so? It is because it removes possibility for your company to earn bad name on the world wide web and increases your good picture through advertising good material relevant to your company. Under online popularity control assistance, everything published on the world wide web about you is considerably supervised. Content which contain harmful pieces of details are hidden on…

22 April

Set up Google plus login process Drupal 7

Published On: Wed, 04/22/2020 - 22:13

Pre-requisites: Google Developer Account Go to developers.google.com Open the api console From the drop down menu in the top left: Select Create Give the project a name Press Create Project The Project will be created and set to active Select API Access from the left menu Click the button marked Create an oauth 2.0 client ID Give the product a name and logo (whatever you want here) Select web application enter your site address click create client id You will need to edit settings here once…

22 April

How to design OMR Sheets using the OMR Software?

Published On: Wed, 04/22/2020 - 22:13

With the advancement of science and technology, the OMR industry too has experienced a major enhancement of the provided features. The traditionally developed OMR software was just used to read the OMR sheets that would be contributing to the effective checking and calculation of final scorecards. The user can conduct exams on a specific pattern of OMR sheets only. Now, with the modification to the OMR software the user can easily design a vivid range of OMR sheets. OMR sheet scanning…

22 April

A small store to a large retail store is advisable to use Point of Service systems to easily customize their routine operations. It increases productivity, business, revenue, relationship with customers, and also saves time efficiently. Free POS applications can be used in simple business procedures using existing tools where advanced system is not affordable. POS is connected with multiple computers, printers, scanners at the administrator, sales counter, and many more locations. If…

22 April

CKEditor automatically strips classes from div in Drupal

Published On: Wed, 04/22/2020 - 22:13

Using CKEditor as a back end editor on my website. It is driving me round the bend though as it seems to want to change the code to how it sees fit whenever I press the source button. Soln 1. Follow this given step to resolve this issue. Go to "Admin >> Configuration >> CKEditor"; under Profiles, choose your profile (e.g. Full). Edit that profile, and on "Advanced Options >> Custom JavaScript configuration" add config.allowedContent = true;.

Soln 2. The easiest…

22 April

Can't save or submit anything after enable Boost in Drupal 7

Published On: Wed, 04/22/2020 - 22:13

I got the problem. After enabled and configured Boost, I cant change any single setting on the site, nothing gets saved. When hitting "Save" button on node edit form or any other submit form, the page just gets reloaded submit not working.

Solution.

This problem occurs only in the dev-version or Version 1.1. Version 1.0 is working well.

1. First install version 1.0 of the module. Activate that module. Go to admin/config/system/boost/htaccess/generator and take the…

22 April

These below code you can put on your template pages, you can apply condition according to requirement so so caching will exclude for those pages where apply this code.

$GLOBALS['conf']['cache'] = FALSE;
$GLOBALS['do_not_cache'] = 1;

We can use CacheExclude module to manage caching for perticular page or condition https://www.drupal.org/project/cacheexclude

22 April

How to access field value for a node in Drupal 8

Published On: Wed, 04/22/2020 - 22:13

Use this code at the top of your coding

use Drupal\node\Entity\Node		//Working with nodes Load a node by NID:
	$nid = 123;     // example value

Method 1

	$node_storage = \Drupal::entityTypeManager()->getStorage('node');
	$node = $node_storage->load($nid);

Method 2

$node = \Drupal\node\Entity\Node::load($nid);

Get node's NID:

echo $node->id();  // 123Get node's bundle type:

	echo $node->bundle…