How to automatically apply woocommerce product title to all product images alt tags?

This is what you need, taken from – https://stackoverflow.com/questions/27087772/how-can-i-change-meta-alt-and-title-in-catalog-thumbnail-product-thumbnail add_filter(‘wp_get_attachment_image_attributes’, ‘change_attachement_image_attributes’, 20, 2); function change_attachement_image_attributes( $attr, $attachment ){ // Get post parent $parent = get_post_field( ‘post_parent’, $attachment); // Get post type to check if it’s product $type = get_post_field( ‘post_type’, $parent); if( $type != ‘product’ ){ return $attr; } /// Get title $title = get_post_field( … Read more

Query WooCommerce orders where meta data does not exist

The meta_query argument (that you can use in a WP_Query) is not enabled by default when using a WC_Order_Query through wc_get_orders() WooCommerce function. But for you can use the undocumented Custom Field Parameters (just like in a WP_Query): meta_key meta_value meta_value_num meta_compare So in your case you can use the following instead: $orders = wc_get_orders( … Read more

WooCommerce get physical store address

The physical address of the store (and many other settings) are stored in WP’s options table (wp_options where “wp_” is the table prefix being used on the site). The option names are: woocommerce_store_address woocommerce_store_address_2 woocommerce_store_city woocommerce_store_postcode woocommerce_default_country The tricky thing is the woocommerce_default_country value. That stores the country AND state/province info depending on your selection … Read more

How can I define a custom template for woocommerce [products] shortcode? [closed]

Open your theme’s function.php and add following add_action( ‘woocommerce_shortcode_before_products_loop’, ‘roka_before_products_shortcode_loop’, 1, 10 ); add_action( ‘woocommerce_shortcode_after_products_loop’, ‘roka_after_products_shortcode_loop’, 0, 10 ); function roka_before_products_shortcode_loop( $atts ) { $GLOBALS[ ‘roka_woocommerce_loop_template’ ] = ( isset( $atts[ ‘class’ ] ) ? $atts[ ‘class’ ] : ” ); } function roka_after_products_shortcode_loop( $atts ) { $GLOBALS[ ‘roka_woocommerce_loop_template’ ] = ”; } Then override … Read more

How to change or add Woocommerce thank you page URL key content?

you can edit the return url woocommerce provides to gateways by using the filter woocommerce_get_return_url some gateway plugins use a different method to get return url by invoking $order->get_checkout_order_received_url() ; which applies the filter woocommerce_get_checkout_order_received_url an example would be like : add_filter(‘woocommerce_get_return_url’,’override_return_url’,10,2); function override_return_url($return_url,$order){ //create empty array to store url parameters in $sku_list = array(); … Read more

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