WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
Price bug with e-Commerce and Shopp - here's the fix (1 post)

  1. Ben Huson
    Member
    Posted 3 years ago #

    In both the following ecommerce tracking functions, the price is not formatted correctly for Google. This is apparent if you have a product/order over £1000.

    The fix is to use number_format() to ensure that decimals places are correct and there is NO comma for thousands.

    wpec_transaction_tracking()

    The references to nzshpcrt_currency_display() should instead use number_format().

    number_format( $purchlogs->allpurchaselogs[0]->totalprice, 2, '.', '' )
    number_format( $total_tax, 2, '.', '' )
    number_format( $total_shipping, 2, '.', '' )

    shopp_transaction_tracking()

    The references to number_format() should ensure there is no thousands seperator.

    number_format( $Purchase->total, 2, '.', '' )
    number_format( $Purchase->tax, 2, '.', '' )
    number_format( $Purchase->shipping, 2, '.', '' )

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic