Skip to content

Instantly share code, notes, and snippets.

View themepaint's full-sized avatar

Shariful Islam themepaint

View GitHub Profile
@themepaint
themepaint / Remove Additional Notes from WooCommerce Checkout
Last active February 9, 2016 08:01
Remove Additional Notes from WooCommerce Checkout
// Use It In functions.php
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
@themepaint
themepaint / compare button Text Remove & Style
Last active February 7, 2016 07:16
compare button Text Remove & Style
// compare button
if( class_exists( 'YITH_Woocompare_Frontend' ) ) {
class ComBtn extends YITH_Woocompare_Frontend{
public function enqueue_scripts() {
// scripts
wp_enqueue_script( 'yith-woocompare-main', YITH_WOOCOMPARE_ASSETS_URL . '/js/woocompare.js', array('jquery'), $this->version, true );
wp_localize_script( 'yith-woocompare-main', 'yith_woocompare', array(
@themepaint
themepaint / Woocommerce Product Compare with YIT
Created February 3, 2016 08:14
Woocommerce Product Compare withYIT
<div class="woocommerce product compare-button">
<?php
echo '<a href="' . get_permalink( $product->id ) . '&amp;action=yith-woocompare-add-product&amp;id=' . $product->id . '" class="compare button" data-product_id="' . $product->id . '"><i class="fa fa-refresh"></i></a>';
?>
</div>
@themepaint
themepaint / Woocommerce Price Filter CSS
Created February 2, 2016 08:20
Woocommerce Price Filter CSS
.price_slider{
margin-bottom: 1em;
}
.price_slider_amount {
text-align: right;
line-height: 2.4em;
font-size: 0.8751em;
}
<?php
/*Product DIscount Calculation*/
//put it on Function
function discount_product(){
global $product;
$discount = $product->sale_price ;
if ($discount) {
$percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 );
$wc_percent = $price .' <span class="product-discount">'. sprintf( __('%s', 'cruise' ), $percentage . '% OFF</span>' );
}
@themepaint
themepaint / Woocommerce Get URl
Created January 4, 2016 05:49
Woocommerce Get URL some Functions.
//Shop Page URL
$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
//My Account URL
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
if ( $myaccount_page_id ) {
$myaccount_page_url = get_permalink( $myaccount_page_id );
}
//Cart URL
@themepaint
themepaint / Get Time Format from Dashboard format
Last active December 22, 2015 15:06
Get Time Format from Dashboard format
//For Time From Dashboard
<?php the_time(get_option( 'date_format' ) )?>
@themepaint
themepaint / All type Shortcode
Created October 14, 2015 05:24
All type Shortcode
=================== Type 1 Popular ==============
/*Latest Post Shortcode*/
function cruise_latest_post($atts, $content = null ) {
// Attributes
extract( shortcode_atts(
array(
'title' => 'Search For Courses',
), $atts )
);
@themepaint
themepaint / YITH Wishlist Icon Filtering
Created October 12, 2015 03:49
YITH Wishlist Icon Filtering
function iconWishlist($value){
return '<i class="fa fa-heart"></i><span>Add to wishlist</span>';
}
function iconWishlistAdd(){
return '<i class="fa fa-check"></i><span>View wishlist</span>';
}
add_filter( 'yith_wcwl_button_label','iconWishlist');
@themepaint
themepaint / Tags List in Shortcode
Last active August 29, 2015 14:27
Tags List in Shortcode Final
add_shortcode('footer_tags',function(){
$html ='<div class="tagcloud">';
$tags = get_tags();
foreach ( $tags as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
$html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug} tag-link-29' style='font-size: 8pt;'>";
$html .= "{$tag->name}</a>";
}