Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
farookibrahim / functions.php
Created June 23, 2020 09:55
Cartzilla - Single Product "Created by" text change
if( ! function_exists( 'cartzilla_dokan_product_author_info' ) ) {
function cartzilla_dokan_product_author_info( $user_id = null ) {
if( cartzilla_is_dokan_activated()):
if ( ! $user_id ) {
$user_id = get_post_field( 'post_author', get_the_id() );
}
$user_data = get_userdata( $user_id );
$store_info = dokan_get_store_info( $user_id );
$storename = isset( $store_info['store_name'] ) && ! empty( $store_info['store_name'] ) ? $store_info['store_name'] : ( is_object( $user_data ) ? $user_data->display_name : '' );
@farookibrahim
farookibrahim / functions.php
Created June 23, 2020 09:50
Cartzilla - Single Product Custom "Released" Date
if( ! function_exists( 'cartzilla_wc_product_publish_date' ) ) {
function cartzilla_wc_product_publish_date() {
global $product;
$released_date = get_post_meta( $product->get_id(), 'released_date', true );
?>
<li class="d-flex justify-content-between mb-3 pb-3 border-bottom">
<span class="text-dark font-weight-medium"><?php echo esc_html('Released', 'cartzilla'); ?></span>
<span class="text-muted"><?php echo date( 'F j, Y', strtotime( $released_date ) ); ?></span></li><?php
}
@farookibrahim
farookibrahim / style.css
Last active June 24, 2020 07:31
Electro - Product Item display add to cart text instead of icon
.products-carousel .owl-item .product .added_to_cart,
.products-carousel .owl-item .product .button,
.section-onsale-product .onsale-product .added_to_cart,
.section-onsale-product .onsale-product .button,
.section-onsale-product-carousel .onsale-product-carousel .onsale-product .onsale-product-content .added_to_cart,
.section-onsale-product-carousel .onsale-product-carousel .onsale-product .onsale-product-content .button,
li.product .added_to_cart, li.product .button {
width: auto;
text-indent: 0;
display: flex;
@farookibrahim
farookibrahim / functions.php
Created June 22, 2020 11:21
Cartzilla - Remove sales count in products archive
if( ! function_exists( 'cartzilla_mp_loop_product_sold_count' ) ) {
function cartzilla_mp_loop_product_sold_count() {
}
}
@farookibrahim
farookibrahim / functions.php
Created June 22, 2020 06:34
Cartzilla - Remove sidebar information from single product page
if ( ! function_exists( 'cartzilla_remove_single_product_v3_sidebar_details' ) ) {
    function cartzilla_remove_single_product_v3_sidebar_details() {
        if ( 'style-v3' === cartzilla_get_single_product_style() ) {
            remove_action( 'woocommerce_single_product_summary', 'cartzilla_product_sold_count', 60 );
            remove_action( 'woocommerce_single_product_summary', 'cartzilla_single_product_star_rating', 70 );
            remove_action( 'woocommerce_single_product_summary', 'cartzilla_wc_single_product_list', 80 );
        }
    }
}
add_action( 'woocommerce_before_single_product_summary', 'cartzilla_remove_single_product_v3_sidebar_details', 8 );
@farookibrahim
farookibrahim / functions.php
Created June 19, 2020 14:44
Vodi - Movie v6 Casts(Stars) section include Crew
if ( ! function_exists( 'vodi_template_single_movie_casts' ) ) {
function vodi_template_single_movie_casts() {
global $movie;
$casts = $movie->get_cast();
$crews = $movie->get_crew();
if( ! empty( $casts ) || ! empty( $crews ) ) {
$title = apply_filters( 'vodi_template_single_movie_casts_title', esc_html__( 'Stars', 'vodi' ), $movie, $casts );
$carousel_args = apply_filters( 'vodi_template_single_movie_casts_carousel_args', array(
'slidesToShow' => 6,
@farookibrahim
farookibrahim / functions.php
Created June 18, 2020 11:09
Vodi - Movie v7 cast & crew section replace with movie v6 casts section
if ( ! function_exists( 'vodi_toggle_single_movie_v7_hooks' ) ) {
function vodi_toggle_single_movie_v7_hooks() {
if ( vodi_get_single_movie_style() == 'v7' ) {
remove_action( 'masvideos_after_single_movie_summary', 'masvideos_template_single_movie_cast_crew_tabs', 50 );
add_action( 'masvideos_after_single_movie_summary', 'vodi_template_single_movie_casts', 50 );
}
}
}
add_action( 'masvideos_before_single_movie', 'vodi_toggle_single_movie_v7_hooks', 20 );
@farookibrahim
farookibrahim / functions.php
Created June 18, 2020 10:33
Pizzaro - Header v5 add product search
add_action( 'pizzaro_header_v5', 'pizzaro_product_search', 35 );
@farookibrahim
farookibrahim / functions.php
Created June 16, 2020 13:13
Vodi - Section Featured Post Block Change Button Text
if( ! function_exists( 'vodi_child_section_featured_post_args' ) ) {
function vodi_child_section_featured_post_args( $args ) {
$args['action_text'] = 'Play Video';
return $args;
}
}
add_filter( 'vodi_section_featured_post', 'vodi_child_section_featured_post_args' );
@farookibrahim
farookibrahim / functions.php
Created June 15, 2020 16:32
Cartzilla - How to Load Custom Fonts/Icons using Child theme?
if( ! function_exists( 'cartzilla_child_scripts' ) ) {
function cartzilla_child_scripts() {
wp_enqueue_style( 'cartzilla-custom-fonts', get_stylesheet_directory_uri() . '/cartzilla-custom-fonts.css' );
}
}
add_action( 'wp_enqueue_scripts', 'cartzilla_child_scripts', 100 );