View functions.php
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 | |
function woocommerce_thankyou_change_order_status( $order_id ) { | |
if ( ! $order_id ) return; | |
$order = wc_get_order( $order_id ); | |
if ( $order->get_status() == 'processing' ){ | |
$order->update_status( 'pending' ); |
View functions.php
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 | |
/* | |
* Changing the steps quantity to 2 for all the WooCommerce products | |
*/ | |
function woocommerce_quantity_input_step_callback( $step, $product ) { | |
$step = 2; | |
return $step; | |
} |
View functions.php
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 | |
function woocommerce_button_proceed_to_checkout(){ | |
?> | |
<a href="<?php echo esc_url( wc_get_checkout_url() ); ?>" class="checkout-button button alt wc-forward"> | |
<?php esc_html_e( 'Proceed to Make Payment', 'woocommerce' ); ?> | |
</a> | |
<?php | |
} |
View functions.php
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 | |
function wc_purchasable_or_not( $product_id, $status = true ) { | |
// key : ID of Product where you want to hide Add to Cart. | |
// value : Array of Product IDs which are present in the cart then hide Add to Cart button for Product ID set in key | |
$product_check = array( | |
'2701' => array( '2848', '2563', '1253' ), | |
'2245' => array( '2848', '2563', '1253' ), |
View functions.php
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 | |
function orddd_change_pickup_date_label_callback(){ | |
return __( 'New Pickup Date Label', 'order-pickup-date' ); | |
} | |
add_filter( 'orddd_change_pickup_date_label', 'orddd_change_pickup_date_label_callback' ); | |
function orddd_change_pickup_time_label_callback(){ | |
return __( 'New Pickup Time Slot Label', 'order-pickup-date' ); |
View functions.php
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 | |
/** | |
* Change Date Comparison for Advance Booking Period. | |
* Using this filter you can prepare date based on to time of the booking. | |
* | |
* @param string $time Date and Time String | |
* @param string $date Date | |
* @param string $from From Time | |
* @param string $to To Time |
View functions.php
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 | |
/** | |
* Additonal Information in Google Event Summary | |
* | |
* @param string $summary Inforation of the Google Event Summary. | |
* @param obj $data Prepared App data for Gcal Calculation. | |
*/ | |
function bkap_google_event_summary_callback( $summary, $data ){ |
View functions.php
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
/** | |
* Exclude products from a particular category on the shop page | |
*/ | |
function ts_pre_get_posts_query( $q ) { | |
if ( ! is_user_logged_in() ) { // Hide below mentioned categories for guest user | |
$tax_query = (array) $q->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_cat', |
View functions.php
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 | |
/** | |
* Show products only of selected category. | |
*/ | |
function get_subcategory_terms( $terms, $taxonomies, $args ) { | |
$new_terms = array(); | |
$hide_category = array(); |
View functions.php
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 | |
/** | |
* Show products only of selected category. | |
*/ | |
function get_subcategory_terms( $terms, $taxonomies, $args ) { | |
$new_terms = array(); | |
$hide_category = array( 126 ); // Ids of the category you don't want to display on the shop page | |