๐
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
{ | |
"name": "faq-laravel", | |
"private": true, | |
"license": "UNLICENSED", | |
"scripts": { | |
"shopify": "shopify", | |
"build": "shopify app build", | |
"dev": "shopify app dev", | |
"info": "shopify app info", | |
"scaffold": "shopify app generate extension", |
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
function enqueue_wc_cart_fragments() { | |
wp_enqueue_script( 'wc-cart-fragments' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'enqueue_wc_cart_fragments' ); |
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_action( 'woocommerce_order_item_meta_end', 'custom_product_info', 20, 4 ); | |
function custom_product_info ( $item_id, $item, $order, $plain_text ) { | |
$id = $item->get_product_id(); | |
$product_info = get_field('customer_email',$id); | |
if($product_info){ | |
echo "<p>Customer Message: $product_info</p>"; | |
}} |
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
function custom_add_to_cart_redirect( $url ) { | |
global $woocommerce; | |
// Retrieve the product ID from the 'add-to-cart' request parameter. | |
$product_id = isset( $_REQUEST['add-to-cart'] ) ? intval( $_REQUEST['add-to-cart'] ) : 0; | |
// Check if the product ID is valid and if the category name is 'main-product'. | |
if ( $product_id > 0 && has_term( 'main-product', 'product_cat', $product_id ) ) { | |
// The URL you want to redirect to for 'main-product'. | |
$redirect_url = 'https://yourdomain.com/add_your_url_here'; |
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
function category_id_class($classes) { | |
global $post; | |
foreach((get_the_category($post->ID)) as $category) | |
$classes [] = 'cat-' . $category->cat_ID . '-id'; | |
//if you want to add category slug replace below code | |
//$classes [] = 'cat-' . $category->slug; | |
return $classes; | |
} | |
add_filter('post_class', 'category_id_class'); | |
add_filter('body_class', 'category_id_class'); |
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
if (function_exists("register_sidebar")) { | |
register_sidebar(); | |
} |
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
$related = new WP_Query( | |
array( | |
'post_type' => 'tutorials', //YOUR CPT SLUG | |
'category__in' => wp_get_post_categories( $post->ID ), | |
'posts_per_page' => 3, | |
'post__not_in' => array( $post->ID ), | |
) | |
); | |
if ( $related->have_posts() ) { ?> |
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_filter( "woocommerce_checkout_fields", "my_reordering_checkout_fields", 15, 1 ); | |
function my_reordering_checkout_fields( $fields ) { | |
## ---- Billing Fields ---- ## | |
// Set the order of the fields | |
$billing_order = array( | |
'billing_first_name', | |
'billing_last_name', | |
'billing_email', | |
'billing_phone', | |
'billing_company', |
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 | |
/** | |
* Remove the vertical bar | in the various action nav groups on Membership Account, Log In widget, and more. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ |
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
// removed cf7 <p> tag | |
add_filter('wpcf7_autop_or_not', '__return_false'); |