Adding WooCommerce Cart Items link to WordPress menus

Here’s a quick function to create a nav menu item that contains cart items and a cart link. Useful to blend in WooCommerce features with an existing menu and design.

function add_last_nav_item($items) {
global $woocommerce;
return $items .= '<li class="menu-item-cart-item">CART: <a class="cart-contents" href="'.$woocommerce->cart->get_cart_url().'" title="View your shopping cart">'.sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count).' - '. $woocommerce->cart->get_cart_total().'</a></li>';

Just edit the $items variable to suit.

About Us   David Gavin Home   Oldfields Log Store

[Snippet] Forcing Replication Between Domain Controllers

…because some people still don’t know!

  1. Open Active Directory Sites and Services.
  2. In the console tree, expand Sites, and then expand the site to which you want to force replication from the updated server.
  3. Expand the Servers container to display the list of servers that are currently configured for that site.
  4. Expand the server objects and click their NTDS Settings objects to display their connection objects in the details pane. Find a server that has a connection object from the server on which you made the updates.
  5. Click NTDS Settings below the server object. In the details pane, right-click the connection object whose From Server is the domain controller that has the updates that you want to replicate, and then click Replicate Now.
  6. When the Replicate Now message box appears, review the information, and then click OK.

That is all!

[Snippet] Checking a Global Catalog is really a Global Catalog

Use an LDAP browser or ADSI Editor to connect to the port 3268 Global Catalog communication is performed over TCP port 3268, regular LDAP lookups are sent to TCP port 389.

After assigning a GC role to a server, check its Directory Services event log for event number 1119, which indicates successful obtaining a role of a Global Catalog server