Skip to content

Instantly share code, notes, and snippets.

<?php
add_action( 'action_name', 'your_function_name' );
function your_function_name() {
// Your code
}
@codeastrology-dev
codeastrology-dev / codeAstrology_remove_wc_currency_symbols.php
Last active November 3, 2022 05:08
codeAstrology_remove_wc_currency_symbols
<?php
function codeAstrology_remove_wc_currency_symbols( $currency_symbol, $currency ) {
$currency_symbol = '';
return $currency_symbol;
}
add_filter('woocommerce_currency_symbol', 'codeAstrology_remove_wc_currency_symbols', 10, 2);
@codeastrology-dev
codeastrology-dev / codeAstrology_wpto_taxonomy_multiple_off
Created August 11, 2022 06:07
codeAstrology_wpto_taxonomy_multiple_off
<?php
function codeAstrology_wpto_taxonomy_multiple_off($bool){
return false;
}
add_filter('wpto_is_multiple_selectable','codeAstrology_wpto_taxonomy_multiple_off');
@codeastrology-dev
codeastrology-dev / search_select_placeholder.php
Last active November 3, 2022 05:12
search_select_placeholder
<?php
function ca_ua_remove_placeholder( $WPT_DATA ){
$WPT_DATA['search_select_placeholder'] = "Choose your text";
//To hide placeholder, leave empty value
//$WPT_DATA['search_select_placeholder'] = "";
return $WPT_DATA;
}
@codeastrology-dev
codeastrology-dev / codeastrology_wpto_searchbox_taxonomy_name.php
Last active November 3, 2022 05:11
codeastrology_wpto_searchbox_taxonomy_name
<?php
if( !function_exists( 'codeastrology_wpto_searchbox_taxonomy_name' ) ){
function codeastrology_wpto_searchbox_taxonomy_name($taxonomy_name,$taxonomy_details){
if($taxonomy_details->name == 'product_cat'){
return "Filter By Categoty";
}
if($taxonomy_details->name == 'product_tag'){
return "Filter By Tag";
}
if($taxonomy_details->name == 'pa_size'){
@codeastrology-dev
codeastrology-dev / woocommerce_checkout_cart_item_quantity.php
Last active September 11, 2023 07:08
woocommerce_checkout_cart_item_quantity
<?php
// Change the checkput prices with $cart_item variable and weight amount
function wb_checkout_review ( $quantity, $cart_item, $cart_item_key ) {
$cart_item = ' <strong class="product-quantity">' . sprintf( '&times; %s', $cart_item['quantity'] ) . ' kg </strong>'; // change weight measurement here
return $cart_item;
}
add_filter( 'woocommerce_checkout_cart_item_quantity', 'codeAstrology_checkout_review', 10, 3 );
@codeastrology-dev
codeastrology-dev / woocommerce_cart_item_price.php
Last active September 11, 2023 07:06
woocommerce_cart_item_price
<?php
// Change the cart prices with $price variable and weight amount
function wb_change_product_price_cart( $price ) {
$price = $price . ' per kg'; // change weight measurement here
return $price;
}
add_filter( 'woocommerce_cart_item_price', 'codeAstrology_change_product_price_cart' );
@codeastrology-dev
codeastrology-dev / change_product_html.php
Last active September 11, 2023 07:05
odeAstrology_change_product_html( $price )
<?php
// Change and return $price_html variable using the $price and weight amount
function codeAstrology_change_product_html( $price ) {
$price_html = '<span class="amount">' . $price . ' per kg </span>'; // change weight measurement here
return $price_html;
}
add_filter( 'woocommerce_get_price_html', 'codeAstrology_change_product_html' );
@codeastrology-dev
codeastrology-dev / wpt_show_table_only_shop.php
Last active May 25, 2023 04:57
wpt_show_table_only_shop
<?php
if (!function_exists('wpt_show_table_only_shop')) {
function wpt_show_table_only_shop($my_archive, $template){
if(!is_shop()){
return $template;
}
else{
return $my_archive;
}
}
<?php
if( !function_exists( 'codeastrology_wpto_searchbox_taxonomy_name' ) ){
function codeastrology_wpto_searchbox_taxonomy_name($taxonomy_name,$taxonomy_details){
if($taxonomy_details->name == 'product_cat'){
return "Filter By Categoty";
}
if($taxonomy_details->name == 'product_tag'){
return "Filter By Tag";
}
if($taxonomy_details->name == 'pa_size'){