Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter csshop

    (@csshop)

    One tracking code is for a marketing company i use Sidecar. The other is a coversion tracking pixel from google.

    The thank you page has to be changed to work with the “side car marketing” tracking code. Had nothing to do withe google conversion tracking code.

    Your plug in worked with the google tracking code before changing the thank you page to accomodate the marketing companies code.

    I just need to figure out how to get your plugin to recognize the new thank you lage ans use it isntead of the default woocommerce thank you page.

    Thread Starter csshop

    (@csshop)

    Because of the marketing campaign company i use, a javascript tracking code needed to be placed on the order confirmation page. This is the thank you page of woocommerce.

    The fields in the javascript code needed to be generated programatically, this means just pasting the code into the thank you page would not work. So I had a programmer write a php program that fills in the needed data automatically for each product.

    They also extended the woocommerce thank you page template by adding a new one to

    /wp-content/themes/kleo/checkout/thankyou.php

    here is the full code of the thank you page

    <?php

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit;
    }

    if ( $order ) : ?>

    //my own code starts here

    <?php

    $dp = ( isset( $filter[‘dp’] ) ? intval( $filter[‘dp’] ) : 2 );

    //$order_id = trim(str_replace(‘#’, ”, $order->get_order_number()));

    $order_id = $order->get_order_number();

    $subtotal=wc_format_decimal( $order->get_subtotal(), $dp );

    $tax=wc_format_decimal( $order->get_total_tax(), $dp );

    $shipping=wc_format_decimal( $order->get_total_shipping(), $dp );
    $total=wc_format_decimal( $order->get_total(), $dp );
    $discount=wc_format_decimal( $order->get_total_discount(), $dp );

    ?>

    <script type=”text/javascript”>
    var sidecar = sidecar || {};
    sidecar.transactions = {
    add: true,
    data: {
    order_id: ‘<?php echo $order_id; ?>’,
    subtotal: ‘<?php echo $subtotal; ?>’,
    tax: ‘<?php echo $tax; ?>’,
    shipping: ‘<?php echo $shipping; ?>’,

    total: ‘<?php echo $total; ?>’
    },

    items: [

    <?php

    $items = $order->get_items();

    foreach ( $items as $item ) {
    $product_id = $item[‘product_id’];

    $price = $item[‘line_total’];
    $quantity = $item[‘qty’];

    echo “
    {
    product_id: ‘”.$product_id.”‘,
    unit_price: ‘”.$price .”‘,
    quantity:’ “.$quantity .”‘
    }”;

    $numItems = count($items);
    $i = 0;

    if(++$i === $numItems) {
    echo ” “;
    }

    else

    {
    echo ‘,’;

    }

    }

    ?>

    ]

    };
    </script>

    //sidecar integration code ends here read the code above

    <?php if ( $order->has_status( ‘failed’ ) ) : ?>

    <p class=”woocommerce-thankyou-order-failed”><?php _e( ‘Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.’, ‘woocommerce’ ); ?></p>

    <p class=”woocommerce-thankyou-order-failed-actions”>
    get_checkout_payment_url() ); ?>” class=”button pay”><?php _e( ‘Pay’, ‘woocommerce’ ) ?>
    <?php if ( is_user_logged_in() ) : ?>
    ” class=”button pay”><?php _e( ‘My Account’, ‘woocommerce’ ); ?>
    <?php endif; ?>
    </p>

    <?php else : ?>

    <p class=”woocommerce-thankyou-order-received”><?php echo apply_filters( ‘woocommerce_thankyou_order_received_text’, __( ‘Thank you. Your order has been received.’, ‘woocommerce’ ), $order ); ?></p>

    <ul class=”woocommerce-thankyou-order-details order_details”>
    <li class=”order”>
    <?php _e( ‘Order Number:’, ‘woocommerce’ ); ?>
    <?php echo $order->get_order_number(); ?>

    <li class=”date”>
    <?php _e( ‘Date:’, ‘woocommerce’ ); ?>
    <?php echo date_i18n( get_option( ‘date_format’ ), strtotime( $order->order_date ) ); ?>

    <li class=”total”>
    <?php _e( ‘Total:’, ‘woocommerce’ ); ?>
    <?php echo $order->get_formatted_order_total(); ?>

    <?php if ( $order->payment_method_title ) : ?>
    <li class=”method”>
    <?php _e( ‘Payment Method:’, ‘woocommerce’ ); ?>
    <?php echo $order->payment_method_title; ?>

    <?php endif; ?>

    <div class=”clear”></div>

    <?php endif; ?>

    <?php do_action( ‘woocommerce_thankyou_’ . $order->payment_method, $order->id ); ?>
    <?php do_action( ‘woocommerce_thankyou’, $order->id ); ?>

    <?php else : ?>

    <p class=”woocommerce-thankyou-order-received”><?php echo apply_filters( ‘woocommerce_thankyou_order_received_text’, __( ‘Thank you. Your order has been received.’, ‘woocommerce’ ), null ); ?></p>

    <?php endif; ?>

    However now my tracking for google conversion pixel is not working any more. The conversion value defaults to the value of $5 and does not give the actual order total value.

    Here is the google tracking pixel.

    <!– Google Code for purchase .us Conversion Page –>
    <script type=”text/javascript”>
    /* <![CDATA[ */
    var google_conversion_id = 954290262;
    var google_conversion_language = “en”;
    var google_conversion_format = “3”;
    var google_conversion_color = “ffffff”;
    var google_conversion_label = “xDIJCPCq6VkQ1qCFxwM”;
    var google_conversion_value = 5.00;
    var google_conversion_currency = “USD”;
    var google_remarketing_only = false;
    /* ]]> */
    </script>
    <script type=”text/javascript” src=”//www.googleadservices.com/pagead/conversion.js”>
    </script>
    <noscript>
    <div style=”display:inline;”>
    <img height=”1″ width=”1″ style=”border-style:none;” alt=”” src=”//www.googleadservices.com/pagead/conversion/954290262/?value=5.00¤cy_code=USD&label=xDIJCPCq6VkQ1qCFxwM&guid=ON&script=0″/>
    </div>
    </noscript>

    The theme I have has a different “thank you page”. How can I make this plug in work with the new thank you page instead of the default woocommerce thank you page.

    What is your website? I would liek to go look at it to see the plug-in in action.

    Thread Starter csshop

    (@csshop)

    Never mind on how to buy, I just fouind it and bought the pro version.

    Can you show me where that setting is located?

    Thread Starter csshop

    (@csshop)

    That would work fine, 2 questions (1) how do i get pro and (2) can you send me a screen shot of how to set that option up?

    Thread Starter csshop

    (@csshop)

    I was able to see a plugin conflict. I disabled the plug in “Admin Columns Pro” and the hits column came back. So I emailed support for them and see if we can find a work around.

    Thanks You

    Thread Starter csshop

    (@csshop)

    Indexing complete!

    Documents in the index: 2485
    Terms in the index: 172322
    Highest post ID indexed: 52688

    still no results in a search

Viewing 8 replies - 1 through 8 (of 8 total)