This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_account_menu_items', 'studiowp_woocommerce_account_menu_items' ); | |
function studiowp_woocommerce_account_menu_items( $items ) { | |
unset( $items['downloads'] ); | |
return $items; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_available_payment_gateways', 'studiowp_woocommerce_available_payment_gateways', 100 ); | |
function studiowp_woocommerce_available_payment_gateways( $gateways ) { | |
if ( is_checkout() ) { | |
if ( get_woocommerce_currency() == 'INR' ) { | |
unset( $gateways['paypal'] ); | |
} | |
if ( get_woocommerce_currency() == 'USD' ) { | |
unset( $gateways['instamojo'] ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class studiowp_search_by_taxonomy { | |
protected $taxonomy = 'category'; | |
protected $slug = 'category'; | |
public function __construct( $taxonomy ) { | |
$this->taxonomy = $taxonomy; | |
$this->slug = str_replace( '-', '_', $this->taxonomy ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* search by category */ | |
new studiowp_search_by_taxonomy( 'category' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* search by product category - WooCommerce */ | |
new studiowp_search_by_taxonomy( 'product_cat' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_email_recipient_new_order', 'studiowp_woocommerce_email_recipient_new_order', 10, 2 ); | |
function studiowp_woocommerce_email_recipient_new_order( $recipient, $order ) { | |
$coupon_code = 'XXXXXXXX'; | |
$add_recipient = 'email@domain.com'; | |
if ( in_array( strtolower( $coupon_code ), $order->get_used_coupons() ) ) { | |
$recipient .= ',' . $add_recipient; | |
} | |
return $recipient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
new studiowp_single_product_price_installments( $parts_count = 4, $factor = 1.2 ); | |
class studiowp_single_product_price_installments { | |
private $add_installment_price = false; | |
private $parts_count; | |
private $factor; | |
public function __construct( $parts_count = 12, $factor = 1.1 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_structured_data_product', 'studiowp_woocommerce_structured_data_product', 10, 2 ); | |
function studiowp_woocommerce_structured_data_product( $markup, $product ) { | |
if ( $product->is_type('variable') ) { | |
unset( $markup['offers'] ); | |
} | |
return $markup; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_structured_data_product', 'studiowp_woocommerce_structured_data_product', 10, 2 ); | |
function studiowp_woocommerce_structured_data_product( $markup, $product ) { | |
if ( $product->is_type('variable') ) { | |
unset( $markup['offers'] ); | |
} | |
return $markup; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_widget_shopping_cart_buttons', 'studiowp_woocommerce_widget_shopping_cart_buttons', 30 ); | |
function studiowp_woocommerce_widget_shopping_cart_buttons() { | |
echo '<br/>'; | |
echo '<a href="' . esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ) . '" class="button my-account wc-forward">' . esc_html__( 'My Account', 'woocommerce' ) . '</a>'; | |
} |