Posts

Showing posts from June, 2022

After Install Fresh laravel, What you need to do

After installing Fresh Laravel,  you have to make.env file and then run these code below from command line   Run   php artisan key:generate . Do  php artisan config:clear , Then  php artisan config:cache And things will start working!

Custom Post Type With Capability

 register_post_type('blog', array(             'capability_type' => 'blogs',             'map_meta_cap'    => true,             'supports' =>  array( 'title', 'editor', 'excerpt' ),             'reqrite'   => array('slug' => 'blogs'),             'has_archive' => true,             'public' => true,             'labels' => array(                     'name' => 'Blogs',                     'add_new_item' => 'Add New Blog',                     'edit_item'    => 'Edit Blog',                     'all_items'  ...

Get Woocommerce Product ID

   add_action( 'woocommerce_thankyou', 'order_created_get_skus', 10 );          function order_created_get_skus($order_id){            $item_sku = array();       $order = wc_get_order( $order_id );             foreach ($order->get_items() as $item) {       //  $product = wc_get_product($item->get_product_id());        // $item_sku[] = $product->get_sku();               echo "product id: " . $item->get_product_id();              }            // now do something with the sku array           }