I Want To Know Variables For Sales Tracker

I want to pass order_info details to the tracker. I want to know order info variables to pass the below -

USING CS-CART V 4

  1. customerName = '';
  2. customerEmail = '';
  3. grandTotal = '';
  4. subTotal = '';
  5. couponCode = '';
  6. orderId = '';
  7. currency = '';

Also let me know any easy way to know any variable used in cs-cart.

$order_info variable has the data for all these values. You can access the same in checkout.post.php

Where can i find this file.

Can some please help me with these variables?

Create a order_confirmation.post.tpl hook file in your my_changes template directory.

You can then do:


which will display the values in the order_info array on your orders.complete page. You can then view source to see it in html comments.

You can then use whichever elements you want to meet your tracking code needs.

There are plenty of old forum threads on applying tracking codes with much more detail. Suggest you do a search of 'pixel code' or 'tracking codes' or 'order summary'.

Please tell me whether I have passed the correct variable or not.

_xxxxx.customerName = '{$order_info.firstname}';

_xxxxx.customerEmail = '{$order_info.email}';

_xxxxx.grandTotal = '{$order_info.total}';

_xxxxx.subTotal = '{$order_info.subtotal}';

_xxxxx.couponCode = '{$order_info.coupons}';

_xxxxx.orderId = '{$order_info.order_id}';

_xxxxx.currency = '{$order_info.secondary_currency}';

Please help anyone check the above variable

_xxxxx.customerName = '{$order_info.firstname}';

'{$order_info.b_firstname} {$order_info.b_lastname}'

I use 'b_*' values because they are usually more accurate than what the user enters as "contact info". I.e. many people enter the contact info name as "Joe Blow" when their real name is "John Doe" as reflected in their billing info.

$order_info.coupons is going to return you an array. You will need to process the coupon array to get the list of coupons used.

Rest variables are correctly passed? And how can I pass the array of coupons or just one coupon. Because on our Web store we don’t generally allow multiple coupons to be used. Please check and revert as I don’t have that much knowledge.

‘{$order_info.b_firstname} {$order_info.b_lastname}’

I use ‘b_*’ values because they are usually more accurate than what the user enters as “contact info”. I.e. many people enter the contact info name as “Joe Blow” when their real name is “John Doe” as reflected in their billing info.


$order_info.coupons is going to return you an array. You will need to process the coupon array to get the list of coupons used.

Have no idea of what you mean by REST variables. The above are Smarty variables which is what you needed for your tracking code.

You will have to loop through the array of coupons and accumulate the 'values' in whatever format your tracking code requires. There is not a generic answer to your question.

Can you tell me what to put in this _xxxxx.couponCode=' ';

How to pass the coupon. Please tell me exact.

Can you tell me what to put in this _xxxxx.couponCode=' ';

How to pass the coupon. Please tell me exact.

What information do you see when you debug the $order_info.coupons variable? I think, there is an array. So you should use something similar to:

_xxxxx.couponCode='{foreach from=$order_info.coupons item=c}{$c.coupon_code},{/foreach}';

(!) Not tested

I'm really sick and tired of little things that creates major issues with cs-cart. Simple things as passing a coupon code that was used at checkout is essential feature for tracking and marketing and it is so difficult and confusing to make it work.

In many other shopping cart platforms it is so easy for example:

&coupon_code={$coupon}

So why this is not the case with cs-cart?

I still can't figure out how to make this work, and support team is just feeding me with " We are busy messages"

Can someone please help here.

What is the specific issue you are trying to solve?

Are you trying to create a coupon?

Are you trying to create a coupon via the API?

Are you trying to report on a coupon code's usage within orders?

In your other platforms example, how hare multiple coupons used in an order assigned to your &coupons variable?

A real use-case scenario of what you want to do would help us help you.

What is the specific issue you are trying to solve?

Are you trying to create a coupon?

Are you trying to create a coupon via the API?

Are you trying to report on a coupon code's usage within orders?

In your other platforms example, how hare multiple coupons used in an order assigned to your &coupons variable?

A real use-case scenario of what you want to do would help us help you.

It is very simple task:

We have affiliates who promote our product using coupon codes that we generated.

At checkout page, a customer enters a coupon code and if this coupon code is associated with the affiliate, they get paid commission.

When checkout page is completed, this tracking code ( &coupon_code={$coupon}) is passed to our affiliate platform along with order number and sale amount. The variables for sale amount and order ID works great, but I cannot see the actual coupon code.

Thanks,

If you are using a promotion (coupon code) to associate affiliates with orders, then you need to be looking for the promotion_id of the promotion rather than the coupon code. Coupon codes are in fact store in the 'cart' but once the 'cart' is deleted and it transforms into an 'order', the 'coupon' array is lost.

A coupon code is just a condition of a promotion (can be one of many).

But it seems that what you really want is an addon that will associate a parameter from the URL with an affiliate. And to then place that value in the order and/or export the pertinent order data into a separate table or create a transaction that sends this info back to your affiliate management system.

You can do this reasonably by:

1) Create an addon or use my_changes

2) Use a frontend/init.post.php controller to look at urls for a parameter of something like affiliate_id=xyz123

3) If an affiliate_id parameter is found, store its value in the user's session

4) Create a hook in checkout that will look for that session value ad if it's set do what you want with it.

5) You can store the info in the cscart_order_data table by using your own 'type' (suggest using lower case letter to prevent conflict with cs-cart). Or if you're lazy you can just add the field to the cscart_orders table. But that table is so overloaded now, adding to it is not advised.

6) If you want to display it in the admin orders.view page, then you would need to extract that info from the cscart_order_data and then apply it to a section in the order view.

If you would like us to do the above for you, please use the get a quote link in my signature and I'll be happy to quote the work for you.

Can any one help me do this small work.

Is there anyone who can help me on this.

You can get price quote by writing at support@webkul.com.

tbirnseth are you interested?