How to block checkout process when session origin is unknown?

add_action(‘woocommerce_checkout_create_order’, function($order, $data) { if (!isset($_REQUEST[‘wc_order_attribution_utm_source’])) { wc_add_notice(__(‘Order creation failed: Safetech Security.’, ‘woocommerce’), ‘error’); throw new Exception(‘Order creation halted.’); } }, 10, 2); This works for me Updates the issue is in the Paypal wooocommerce plugin, I had to edit the code and stop auto-update if (!isset($_COOKIE[‘sbjs_first’])) { throw new RuntimeException( __(‘Order creation failed: Origin … Read more

Woocommerce Gallery Image Caption: Use “caption” — not “alt tag”. Keep alt tag as is

Phew! Here is the code for functions.php. add_filter( ‘woocommerce_single_product_image_thumbnail_html’, ‘change_alt_to_caption_gallery_images’, 10, 2 ); function change_alt_to_caption_gallery_images ( $wc_get_gallery_image_html, $image_id ){ $caption = get_post_field( ‘post_excerpt’, $image_id ); if ( !empty($caption) && !empty($wc_get_gallery_image_html) ) { $caption = str_replace( ‘”‘, “””, $caption ); $caption_repl=”data-caption=”” . $caption . ‘”‘; $wc_get_gallery_image_html = preg_replace( ‘/data-thumb-alt=”[^”]+”/’, $caption_repl, $wc_get_gallery_image_html ); } return $wc_get_gallery_image_html; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)