Categories
Life Hack

Don’t give up.

The picture was taken while running along this beautiful lake.

You will never truly know yourself until tested by adversity. No matter how many times you have fallen. Look up, get up, and don’t ever give up.

Categories
Plugins WooCommerce

How to limit min and max quantity for WooCommerce

Min and Max Quantity for WooCommerce plugin allow you to set up limits for the cost of products in orders and in groups and limits for the number of products, product variations, products in orders, and products in the group. You can add products and product variations to the group. An infinite amount of groups.

FEATURES:
✅ Quantity limits for products
✅ Quantity limits for product variations
✅ Quantity limits for products in cart
✅ Cost limits for products in cart

ADDITIONAL FEATURES IN PAID PLUGIN:
✅ Quantity limits for groups of products
✅ Quantity limits for products from categories
✅ Quantity limits for products from specific attributes
✅ Cost limits for groups of products
✅ Cost limits for products from categories
✅ Cost limits for products from specific attributes
✅ Infinite groups of products

Categories
Chasing Dreams IRONMAN My Lifestyle Sports Triathlon

Chasing Dreams: Road to IRONMAN 70.3 World Championship 2021

CHASING DREAMS

SOCIAL SHORTS is committed to tell the stories around us as a documentary film series and connect them to people worldwide. Here we are introducing Ironman Mahbubur Rahman. Mahbubur Rahman is a Bangladeshi endurance athlete with a passion for Triathlon. His athletic career in the past few years has spanned distance running, open water swimming, and Ironman triathlon. Since finishing his first Ironman race – Ironman 70.3 Colombo in 2018, he has completed Ironman 70.3 Bintan (2019), Ironman Malaysia (2019), and Ironman 70.3 Bangsaen (2020). He is also first among Bangladeshis to qualify for IRONMAN 70.3 World Championship. He is an activist with BDRunners and BD Triathletes – two of the largest online communities for endurance sports enthusiasts in Bangladesh. Mahbub is now training and focused on qualifying for the Ironman World Championship Kona! For better view, here is the YouTube link : #SocialShorts #ChasingDreams #ironman #roadtokona2021 #ironman703worldchampionship #swimming #cycling #running #triathlon #triathlete #bdtri #bdrunners #AALPS #DhakaRunLords #sheltech #sports #Bangladesh

Posted by Social Shorts on Sunday, August 9, 2020

Sport has changed my life completely. I find self-satisfaction by constantly exceeding my limits. But my athletic life was not easy. I have had to move forward, leaving behind many obstacles. I believe there is nothing you can dream that you will not be able to achieve by putting your whole heart, body, soul, and mind into the journey itself, not the victory. This belief motivates me to chase my dreams, not in sports, but also in real life.

On February 23, 2020, I participated in the Toyota Ironman 70.3 Bangsean and became the first Bangladeshi 🇧🇩 to qualify for the IRONMAN 70.3 World Championship 🏅.

How was my journey to qualify for the Ironman 70.3 World Championship, and what is my next goal? Social Shorts has released this documentary based on my IRONMAN journey. This documentary follows my lofty challenge and covers what it takes to finish IRONMAN 70.3(1.9k swim, 90k bike, and 21.1k run) or IRONMAN(3.8k swim, 180k bike, and 42k run). 🏊‍♂️🚴‍♂️🏃‍♂️

Please pray for me to stay healthy and represent Bangladesh for the first time in the IRONMAN 70.3 World Championship on September 17-18, 2021. 🙏

Thanks to Ziauddin Suvah and the Social Shorts team, they have worked tirelessly to make it possible. 😘✌️

#ChasingDreams #Sheltech #DhakaRunLords #ConfidenceGroup #BDTri #BDRunners #IRONBrothers #Tryathletelife #ironmanasia #swimming #cycling #running #ironman #challengefamily #challengeasiapacific #triathlon #wearetriathlon #allabouttheathlete #swimbikerun #IMMalaysia #ironmantraining #ironmanworldchampionship #ironman703worldchampionship #roadtokona2021
Categories
Chasing Dreams IRONMAN My Lifestyle Sports Triathlon

First Bangladeshi to qualify for IRONMAN 70.3 World Championship

Mahbubur Rahman is a Bangladeshi endurance athlete with a passion for Triathlon. His athletic career in the past few years has spanned distance running, open water swimming, and IRONMAN triathlon.

Since finishing his first Ironman race – Ironman 70.3 Colombo in 2018, he has completed Ironman 70.3 Bintan (2019), Ironman Malaysia (2019) and Ironman 70.3 Bangsaen (2020).

He is also first among Bangladeshis to qualify for IRONMAN 70.3 World Championship. On February 23, 2020, he participated in the Toyota Ironman 70.3 Bangsean and became the first Bangladeshi 🇧🇩 to qualify for the IRONMAN 70.3 World Championship 🏅.

In between his Ironman training and races Mahbub has crossed Bangla Channel (16.1k open water swim in the Bay of Bengal) in 2018, 1st runner up of Dhaka Half Marathon 2018 and 2019, Podium finisher at Dhaka Challenge Triathlon 2017, Two times champion of Brac Bank run (2018, 2019), Champion of BYLC-Running with Purpose 2019, 1st runner up of BYLC- Running with Purpose 2018 and Podium finisher at Bandarban Sky Marathon 2016.

Apart from being a full time IT specialist Mahbub contributes his free time in helping local athletes. He is an activist with BDRunners and BD Triathletes – two of the largest online communities for endurance sports enthusiasts in Bangladesh.

Mahbub is now training and focused on qualifying for the Ironman World Championship Kona!

Categories
Programming

Iteration vs. Looping

Now I am going to discuss the difference between looping and iteration.

Looping occurs when you tell your program to do something a certain number of times.

Iteration occurs when you have a collection of data (for example, an array), and you operate on each member of that collection.

For example, if I tell my program to print out the phrase “I love programming!” five times, that’s looping. If I tell my program to enumerate over the array [1, 2, 3, 4, 5] and add 10 to each number, that’s iteration.

Categories
Plugins WP User Frontend

How to create form for uploading external/affiliate type WooCommerce product

The process for creating a form to upload external/affiliate type product given here.

1) Add a hidden type field with meta key & value to your product form. The meta value should be external.

Refer Screenshot:
http://prntscr.com/egkcws

2) Add an URL & a text type custom field, insert _product_url & _button_text meta key for them respectively.

Refer Screenshot:
http://prntscr.com/egkdox

3) Add the following code inside the theme’s functions.php file.

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, contact me for assistance.
function wpuf_support_external_product( $post_id ) {
   
    $product_type = get_post_meta( $post_id, 'product_type', true );

    wp_set_object_terms( $post_id, $product_type, 'product_type' );
   
}

add_action( 'wpuf_add_post_after_insert', 'wpuf_support_external_product' );
add_action( 'wpuf_edit_post_after_update', 'wpuf_support_external_product' );

Now, check the form on the frontend, try to upload a product & check the submitted product type in wp-admin. The product type should be external/affiliate.

Reference Video:
https://www.youtube.com/watch?v=i2NDYqlAqjo

Categories
Plugins WP User Frontend

How to show all the posts submitted by all users in a page

To show all the posts submitted by all users in a page, follow the instructions given here.

1) Create a new page, insert [wpuf_dashboard] shortcode in that page & Publish it.

Refer Screenshot:
http://prntscr.com/egiu0w

2) Add the following code inside the theme’s functions.php file.

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, contact me for assistance.
function show_all_posts_for_admin( $args  ) {

    if ( current_user_can( 'administrator' ) ) {
        unset($args['author']);
        return $args;
    }else {
        return $args;
    }

}

add_filter( 'wpuf_dashboard_query', 'show_all_posts_for_admin' );

Now, logged in from multiple users account & submit posts using frontend form, check the page you created on the frontend. You can see all the posts submitted by all users on that page.

Categories
Plugins WordPress WP User Frontend

How to add user id as product SKU with WP User Frontend product form.

You can follow the instructions given below to insert user id as product SKU.

1) Add a hidden field to the product form you created & insert _sku meta key to that field.

​Refer Screenshot:
http://prntscr.com/ef1e0f

2) Now, Add the following code inside the theme’s functions.php file.

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, contact me for assistance.


function wpuf_update_product_sku( $post_id ) {
   
    if ( isset( $_POST['_sku'] ) ) {

            $user_id = get_current_user_id();
            update_post_meta( $post_id, '_sku', $user_id );

    }

}

add_action( 'wpuf_edit_post_after_update', 'wpuf_update_product_sku' );
add_action( 'wpuf_add_post_after_insert', 'wpuf_update_product_sku' );

​​

​All done, submit a product using frontend product form & check the product SKU in wp-admin. The SKU id will be the user id.

Categories
Plugins WooCommerce WordPress WP User Frontend

How to create unique SKU with WP User Frontend custom field.

The unique SKU of the products is not being set when the products are created. To add unique SKU with products, then follow the instructions given below.

1) Add a custom text field with _sku to the product form.

Screenshot:
http://prntscr.com/eb2ext

2) Add the following code inside the theme’s functions.php file.

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, contact me for assistance.
function wpuf_unique_product_sku_notice( $error ) {
    if ( isset( $_POST['_sku'] ) ) {
        global $wpdb;

        $sku = $_POST['_sku'];

        $product_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_sku' AND meta_value='%s' LIMIT 1", $sku ) );

        if ( $product_id ) {
            return __( 'SKU is not unique, you must enter unique SKU' );
        }
    }

    return '';
}

add_filter( 'wpuf_update_post_validate', 'wpuf_unique_product_sku_notice' );
add_filter( 'wpuf_add_post_validate', 'wpuf_unique_product_sku_notice' );

3) Now, try to submit a product using the frontend product form. Use an existing SKU related to other product. You will see the following error.

Screenshot:

All done.

Categories
Plugins WordPress WP User Frontend

How to update WooCommerce sale price dates meta using WPUF date fields

If you are having an issue with updating the schedule dates of WooCommerce product using WPUF fields, you can follow the given instructions to solve this issue.

1) Add two date type field to WPUF form that you created to allow users for uploading products.

2) Insert _sale_price_dates_from & _sale_price_dates_to meta keys accordingly for these two fields.

Refer Screenshot:
http://prntscr.com/du6fqj

3) Change the date format of WPUF date field.

Refer Screenshot:
http://prntscr.com/du66dq

4) Now, add the following code inside the theme’s functions.php file.

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, contact me for assistance.
function update_product_schedule_date_meta( $post_id ) {
    $dates_from = get_post_meta( $post_id, '_sale_price_dates_from', true );
    $dates_to = get_post_meta( $post_id, '_sale_price_dates_to', true );

    $dates_from = strtotime($dates_from);
    $dates_to = strtotime($dates_to);

    update_post_meta( $post_id, '_sale_price_dates_from', $dates_from );
    update_post_meta( $post_id, '_sale_price_dates_to', $dates_to );
}

add_action( 'wpuf_add_post_after_insert', 'update_product_schedule_date_meta' );
add_action( 'wpuf_edit_post_after_update', 'update_product_schedule_date_meta' );

All done, add a product from the frontend with the sales price and insert dates for sales from, sales to fields. The fields data will update properly to WooCommerce sale price dates.