Kupon kódok megjelenítése az értesítő email-ekben

add_action( ‘woocommerce_email_order_meta’, function( $order, $sent_to_admin, $plain_text, $email ) { // Check if coupon is used in order if ( $order->get_used_coupons() ) { // Get the coupon codes used in the order $coupon_codes = implode( ‘, ‘, $order->get_used_coupons() ); // Set…Continue reading

WPForms: new smart tag – Current Date/Time

// Register the smart tag. add_filter( ‘wpforms_smart_tags’, static function( $tags ) { // Key is the tag, value is the tag name. $tags[‘current_time’] = ‘Current Date/Time’; return $tags; } ); // Replace its value on form render on front-end. add_filter(…Continue reading

Disable zoom on product page

function remove_image_zoom_support_webtalkhub() { remove_theme_support( ‘wc-product-gallery-zoom’ ); } add_action( ‘wp’, ‘remove_image_zoom_support_webtalkhub’, 100 );Continue reading

Add text below price on product page

add_action( ‘woocommerce_product_meta_start’, ‘text_after_meta_start’ ); function text_after_meta_start(){ echo ‘  Beställ färgprovar Hemma hos dig inom 2 – 3 veckor Unik, stark och hållbar Tillverkas i vår egen verkstad i Malung-Sälen av lokalt virke Hög kvalitet till ett rättvist pris Personlig service…Continue reading

Moving product short description to under product image

remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 ); add_action( ‘woocommerce_before_single_product_summary’, ‘start_left_side’, 5 ); function start_left_side() { print ‘ ‘.PHP_EOL; } add_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_template_single_excerpt’, 30 ); add_action( ‘woocommerce_before_single_product_summary’, ‘end_left_side’, 40 ); function end_left_side() { print ‘ ‘.PHP_EOL; print ‘ ‘.PHP_EOL; }Continue reading

Add top bar to Storefront Theme (PHP 1/2)

/** * Adds a top bar to Storefront, before the header. */ function storefront_add_topbar() { ?> Måttbeställt Tillverkade i vårt eget snickeri (Malung-Sälen) Hög kvalitet till ett rättvist pris Snabb leverans (2-3 veckor) <?php } add_action( 'storefront_before_header', 'storefront_add_topbar' );Continue reading