Skip to content

Instantly share code, notes, and snippets.

@akther80
akther80 / functions.php
Created February 8, 2019 06:15
Tokoo - Electro v2 - Add confirm password field in Registration Form
// ----- validate password match on the registration page
function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) {
global $woocommerce;
extract( $_POST );
if ( strcmp( $password, $password2 ) !== 0 ) {
return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'tokoo' ) );
}
return $reg_errors;
}
add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3);
@akther80
akther80 / functions.php
Created February 11, 2019 06:51
Electro v2 - Add Price and Add to Cart wrap in product body
add_action( 'woocommerce_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart',61);
add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_price',62 );
add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 63 );
add_action( 'woocommerce_shop_loop_item_title', 'electro_wrap_price_and_add_to_cart_close', 64 );
@akther80
akther80 / functions.php
Created February 12, 2019 05:38
Electro v2 - Remove product availability in single product page
add_action( 'init', 'ec_child_remove_availability_in_single_product' );
function ec_child_remove_availability_in_single_product() {
remove_action( 'woocommerce_single_product_summary', 'electro_template_loop_availability', 10 );
}
@akther80
akther80 / functions.php
Last active March 10, 2019 18:54
Tokoo - Rearrange header icons position
add_action( 'init', 'tk_child_rearrange_header_icon_position' );
function tk_child_rearrange_header_icon_position() {
remove_action( 'tokoo_header_icons', 'tokoo_header_cart' );
remove_action( 'tokoo_header_icons', 'tokoo_header_wishlist' );
remove_action( 'tokoo_header_icons', 'tokoo_header_user_account' );
add_action( 'tokoo_header_icons', 'tokoo_header_user_account', 10);
add_action( 'tokoo_header_icons', 'tokoo_header_cart', 20 );
}
@akther80
akther80 / functions.php
Created February 21, 2019 05:42
Tokoo - Remove wishlist from product item
add_action( 'init', 'tk_child_remove_wishlist_from_loop' );
function tk_child_remove_wishlist_from_loop() {
remove_action( 'woocommerce_before_shop_loop_item', 'tokoo_add_to_wishlist_button', 6 );
}
@akther80
akther80 / functions.php
Last active March 4, 2019 09:17
Electro v2 - WooCommerce cart table replace remove icon with text
function wc_cart_table_replace_remove_icon_with_text( $html, $cart_item_key ) {
return str_replace( '×', 'Remove', $html );
}
add_filter( 'woocommerce_cart_item_remove_link', 'wc_cart_table_replace_remove_icon_with_text', 10, 2 );
@akther80
akther80 / functions.php
Created March 1, 2019 15:01
Electro v2 - Remove loop title
add_action( 'init', 'ec_child_remove_loop_title', 10 );
function ec_child_remove_loop_title() {
remove_action( 'woocommerce_before_shop_loop', 'electro_wc_loop_title', 10 );
}
@akther80
akther80 / functions.php
Last active March 20, 2019 19:28
Electro v2 - Remove product meta from single product description
if ( ! function_exists( 'electro_product_description_tab' ) ) {
function electro_product_description_tab() {
echo '<div class="electro-description clearfix">';
wc_get_template( 'single-product/tabs/description.php' );
echo '</div>';
}
}
if ( ! function_exists( 'electro_product_specification_tab' ) ) {
function electro_product_specification_tab() {
@akther80
akther80 / functions.php
Last active March 20, 2019 19:28
Electro v2 - Add SKU in single product summary
add_action( 'init', 'ec_child_add_sku_in_single_product_summary', 10 );
function ec_child_add_sku_in_single_product_summary() {
remove_action( 'woocommerce_single_product_summary', 'electro_template_single_divider', 11 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 11 );
add_action( 'woocommerce_single_product_summary', 'electro_template_single_divider', 12);
}
@akther80
akther80 / editor.html
Created March 18, 2019 11:08
Mediacenter - Home v1 shortcode for Visual Composer
[vc_row has_container="true" container_class="container" el_class="inner-bottom-xs"][vc_column width="5/12" offset="vc_col-lg-3 vc_col-md-3"][mc_vertical_menu dropdown_trigger="click" dropdown_animation="fadeInDown" title="All Departments" icon_class="fa-list" menu="vertical-menu"][/vc_column][vc_column offset="vc_col-lg-9 vc_hidden-lg vc_col-md-9 vc_hidden-md" el_class="inner-bottom-xs"][/vc_column][vc_column offset="vc_col-lg-9 vc_col-md-9"][rev_slider_vc alias="home-page-boxed-slider"][/vc_column][/vc_row][vc_row row_animation="none" has_container="true" container_class="container"][vc_column width="1/2"][mc_banner banner_link="https://demo2.chethemes.com/mediacenter/product-category/smart-phones-tablets/" banner_link_target="_self" banner_hover_animation="pulse" banner_text_position="text-left" banner_image="635" title="New Life" subtitle="Introducing New Category"][/vc_column][vc_column width="1/2"][mc_banner banner_link="https://demo2.chethemes.com/mediacenter/product-category/gadgets/" banner_link_targ