Support » Plugin: Product XML Feeds for WooCommerce » please make multiply_by a global attribute for numeric results

  • ucsendre

    (@ucsendre)


    Hello,

    Could you please make “multiply_by” shortcode attribute global for all numeric result fields (like for [alg_product_weight] ) that would make this great plugin even a bit more fantastic.

    Thank you very much indeed.

    Best regards,
    Endre

Viewing 1 replies (of 1 total)
  • ucsendre

    (@ucsendre)

    This solved the problem for me now:

    add_shortcode( 'alg_product_weight_in_gramms', 'alg_product_weight_in_gramms' );
    if ( ! function_exists( 'alg_product_weight_in_gramms' ) ) {
    function alg_product_weight_in_gramms( $atts, $content = '' ) { global $product;
    if ( $product ) { return ( $product->has_weight() ) ? floatval( $product->get_weight() ) * 1000 : ''; }
    return ''; } }

    I still believe “multiply_by” should be global.

    Best regards,
    Endre

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.