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 | |
// requirements: Bootscore + bs Swiper extension | |
remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); | |
add_action('woocommerce_after_single_product_summary', function() { | |
if (function_exists('bootscore_product_slider')) { | |
echo ' | |
<div class="related-posts mb-3"> | |
<hr> | |
<h2 class="h4 text-center my-4">'.apply_filters('bootscore/bs-swiper/related-posts/heading', __('You might also like', 'bootscore')).'</h2>'; |
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 | |
// check the information in the comments | |
add_action( 'before_delete_post', 'fws_delete_images_for_product', 99, 2 ); | |
function fws_delete_images_for_product( $postid, $post ) { | |
if ( 'product' !== $post->post_type ) { | |
return; | |
} | |
$img_ids = array(); |
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 | |
$msg = ''; | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
$data = json_decode(file_get_contents('php://input'), true); | |
parse_str($_SERVER['QUERY_STRING'], $qs_array); |
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
location ~* \.(gif|jpg|jpeg|png|webp|avif|css|js|svg|txt|rar|gz|zip|html|json|map|woff2|woff)$ { | |
error_page 404 /404.html; | |
expires 1y; | |
access_log off; | |
} |
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
ErrorDocument 404 /404.html | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png|webp|avif|css|js|svg|txt|rar|gz|zip|html|json|map|woff2|woff)$ [NC] | |
RewriteRule .* - [L,R=404] | |
</IfModule> |
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('fweo_emailoctopus_show_static', function($show, $post) { | |
/* | |
add here the conditions and return $show = true | |
for example: | |
*/ | |
if (is_category()) $show = true; | |
return $show; | |
}, 10,2); |
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 fws_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { | |
if ( 'free_shipping' === $rate->method_id ) { | |
$free[ $rate_id ] = $rate; | |
break; | |
} | |
} |
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_tabs', 'woo_custom_product_tabs' ); | |
function woo_custom_product_tabs( $tabs ) { | |
// Shipment info tab | |
$tabs['fw_shipment_tab'] = array( | |
'title' => __( 'Shipment info', 'woocommerce' ), | |
'priority' => 100, // use a higher value and move the tab to the end | |
'callback' => 'fw_shipment_tab_content' | |
); | |
} |
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_action( 'add_attachment', 'fws_set_image_alt_after_upload' ); | |
function fws_set_image_alt_after_upload( $post_ID ) { | |
if ( wp_attachment_is_image( $post_ID ) ) { | |
$post = get_post( $post_ID ); | |
update_post_meta( $post_ID, '_wp_attachment_image_alt', $post->post_title ); | |
} | |
} |
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 | |
// place this code inside the functions.php file from your child code. | |
function fw_disable_coupon_field_on_checkout( $enabled ) { | |
if ( is_checkout() ) { | |
$enabled = false; | |
} | |
return $enabled; | |
} | |
add_filter( 'woocommerce_coupons_enabled', 'fw_disable_coupon_field_on_checkout' ); |