Wednesday, 17 January 2018

Timeline For Divi

How to add the timeline

To add this timeline to your Divi website you will need to;
1 – Add the following CSS into your ePanel custom CSS box.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*—- DIVI TIMELINE / DOTS LIST —–*/
.dots-list {
width: 100%;
}
.dots-list ol {
padding-left: 150px;
position: relative;
margin-bottom: 20px;
list-style: none !important;
}
.dots-list ol li {
position: relative;
margin-top: 0em;
margin-bottom: 20px;
}
.dots-list ol li .date {
position: absolute;
left: -115px;
font-weight: bold;
font-size: 1em;
top: -2px;
}
.dots-list ol li:before {
content: "";
background: #35a6cb; /*edit line colour*/
position: absolute;
width: 2px;
top: 5px;
bottom: -25px;
left: -24px;
}
.dots-list ol li:after {
content: "";
background: #c7d8dd;  /*edit circle colour*/
position: absolute;
width: 13px;
height: 13px;
border-radius: 100%;
border:2px solid #35a6cb; /*edit circle border colour*/
top: 5px;
left: -31px;
}
.dots-list ol li:last-child:before {
content: "";
background: rgba(0, 0, 0, 0);
}
2 – Add a text module into your page and then add the following HTML using the text view.
1
2
3
4
5
<ol>
<li><span class="date">01/04/2016</span>This is your list item content. </li>
<li><span class="date">01/04/2016</span>This is your list item content. </li>
<li><span class="date">01/04/2016</span>This is your list item content. </li>
</ol>

3 – In the text modules custom CSS tab add dots-list into the CSS Class field

Thursday, 14 December 2017

Auto Complete all WooCommerce orders

/**
 * Auto Complete all WooCommerce orders.
 */
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
    if ( ! $order_id ) {
        return;
    }

    $order = wc_get_order( $order_id );

    /*  Customized Solution by Nucleus System */
    // Set HERE your targetted products IDs:
    $targetted_products = array( 3038 ); //if product id is crony

    $order = wc_get_order( $order_id );

    if ( $order->get_user_id() > 0 ) {
        foreach ( $order->get_items() as $order_item ) {
            // Here we detect if the a target product is part of this order items
            if ( in_array( $order_item['product_id'], $targetted_products ) ){

                // I think tha this is not really needed as it's set when an order has been paid…
                update_user_meta( $order->get_user_id(), 'paying_customer', 1 ); // 1 => true

                // Remove all roles and set 'editor' as user role (for current user)
                $user = new WP_User( $order->get_user_id() );
                $user->set_role( 'crony' );
                // Product is found, we break the loop…
                break;
            }
        }
    }

    $order->update_status( 'completed' );
}
//
// add_action( 'woocommerce_order_status_completed', 'custom_action_on_completed_customer_email_notification' );
// function custom_action_on_completed_customer_email_notification( $order_id ) {
//
//     // Set HERE your targetted products IDs:
//     $targetted_products = array( 3038 );
//
//     $order = wc_get_order( $order_id );
//
//     if ( $order->get_user_id() > 0 ) {
//         foreach ( $order->get_items() as $order_item ) {
//             // Here we detect if the a target product is part of this order items
//             if ( in_array( $order_item['product_id'], $targetted_products ) ){
//
//                 // I think tha this is not really needed as it's set when an order has been paid…
//                 update_user_meta( $order->get_user_id(), 'paying_customer', 1 ); // 1 => true
//
//                 // Remove all roles and set 'editor' as user role (for current user)
//                 $user = new WP_User( $order->get_user_id() );
//                 $user->set_role( 'crony' );
//                 $user->add_role( 'subscriber' );
//
//                 // Product is found, we break the loop…
//                 break;
//             }
//         }
//     }
// }

Woocommerce : Specific item skip cart direct to checkout

add_filter( 'woocommerce_add_to_cart_redirect', 'woo_redirect_checkout' );

function woo_redirect_checkout() {
    global $woocommerce;
    $desire_product = '3038'; /* <--  this product id */
    //Get product ID
    $product_id = (int) apply_filters( 'woocommerce_add_to_cart_product_id', $_POST['add-to-cart'] );

    //Check if current product is subscription
    if ( $product_id == $desire_product ){
        $checkout_url = $woocommerce->cart->get_checkout_url();
        return $checkout_url;
        exit;
    } else {
        $cart_url = $woocommerce->cart->get_cart_url();
        return $cart_url;
        exit;
    }
}

Meta tag : Change mobile browser address to color theme

<meta name="theme-color" content="#ff6600" />

http://www.wpbeginner.com/wp-tutorials/how-to-change-the-color-of-address-bar-in-mobile-browser-to-match-your-wordpress-site/

Monday, 4 December 2017

Woo commerce

Add content below add to cart button

https://chiefthemes.com/woocommerce-add-content-blow-add-to-cart-button/

Submit RSSa

 rssing.com