This file contains hidden or 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 | |
if(!function_exists('wc_get_products')) { | |
return; | |
} | |
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; | |
$ordering = WC()->query->get_catalog_ordering_args(); | |
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby'])); | |
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby']; |
This file contains hidden or 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 our Custom Fields to simple products | |
*/ | |
function mytheme_woo_add_custom_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
// Text Field |
This file contains hidden or 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 cf7_active_campaign_add_meta_boxes() { | |
add_meta_box( 'cf7-active-campaign-settings', 'Active Campaign', 'cf7_active_campaign_metaboxes', '', 'form', 'low'); | |
} | |
add_action( 'wpcf7_add_meta_boxes', 'cf7_active_campaign_add_meta_boxes' ); | |
function cf7_activecampaign_add_page_panels($panels) { | |
$panels['redirect-panel'] = array( 'title' => 'Active Campaign Settings', 'callback' => 'cf7_activecampaign_page_panel_meta' ); | |
return $panels; | |
} |
This file contains hidden or 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 | |
/** | |
* Display the checkout steps so the customer knows where they are. | |
* | |
* The output uses classes of Bootstrap 4 and the icons of FontAwesome (Free) | |
**/ | |
function onx_woocommerce_checkout_steps() | |
{ | |
echo '<nav id="woo-checkout-steps" class="nav nav-pills nav-justified mb-4" role="navigation">'; |
This file contains hidden or 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
/* | |
* goes in theme functions.php or a custom plugin | |
* | |
* Subject filters: | |
* woocommerce_email_subject_new_order | |
* woocommerce_email_subject_customer_processing_order | |
* woocommerce_email_subject_customer_completed_order | |
* woocommerce_email_subject_customer_invoice | |
* woocommerce_email_subject_customer_note | |
* woocommerce_email_subject_low_stock |
This file contains hidden or 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 custom_pre_get_posts_query( $q ) { | |
$tax_query = (array) $q->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', |
This file contains hidden or 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_product_subcategories_args', 'remove_uncategorized_category' ); | |
/** | |
* Remove uncategorized category from shop page. | |
* | |
* @param array $args Current arguments. | |
* @return array | |
**/ | |
function remove_uncategorized_category( $args ) { | |
$uncategorized = get_option( 'default_product_cat' ); |
This file contains hidden or 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
#!/bin/sh | |
CRTPATH=$(pwd -W) | |
for i in *.key ; do | |
DOMAIN=${i%.key} | |
cat << EOF > openssl_$DOMAIN.conf | |
[req] | |
distinguished_name = req_distinguished_name | |
req_extensions = v3_req | |
prompt = no | |
[req_distinguished_name] |
This file contains hidden or 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 | |
/** | |
* @snippet WooCommerce - Add content after "Proceed to checkout" button via functions.php | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 3.2.5 | |
*/ | |
redlight_wc_cart_after_procced_to_checkout(){ | |
$checkout_url = 'https://example.com/your-page/'; | |
?> | |
<a href="<?php echo $checkout_url; ?>" class="checkout-button button alt wc-forward"><?php _e( 'Continue shopping', 'woocommerce' ); ?></a> |
This file contains hidden or 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 billing fields | |
* | |
*/ | |
function my_custom_function(){ | |
global $woocommerce; | |
$checkout = $woocommerce->checkout(); | |
//print_r($checkout); | |
$checkout_fields = $checkout->checkout_fields['billing']; | |
unset( $checkout_fields['billing_email']); |