WooCommerce coupon codes in order overview HPOS

You are correct that using WC()->session->set(‘jne_custom_shipping_cost’, $shipping_cost); only stores the shipping cost in the session without actually modifying the order data. To include the custom shipping cost into the actual order total when the order is placed, you need to use specific WooCommerce hooks : //Function 1 : Add the custom shipping cost to the … 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; }

How could i add username field in WooCommerce

// Add Username Field to Registration Form add_action( ‘woocommerce_register_form_start’, ‘custom_woocommerce_register_username’ ); function custom_woocommerce_register_username() { ?> <p class=”form-row form-row-wide”> <label for=”reg_username”><?php _e( ‘Username’, ‘woocommerce’ ); ?> <span class=”required”>*</span></label> <input type=”text” class=”input-text” name=”username” id=”reg_username” value=”<?php echo ( ! empty( $_POST[‘username’] ) ) ? esc_attr( wp_unslash( $_POST[‘username’] ) ) : ”; ?>” /> </p> <?php } // Validate … Read more

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