$order_info Values

Working with /cart/skins/basic/customer/addons/my_changes/hooks/checkout/order_confirmation.override.tpl I am trying to pass tracking information to third parties.



I know the following variables:



$order_info.items

$item.product_code

$item.price

$item.amount



$order_info.order_id

$order_info.subtotal

$order_info.total



What would the variables be to add the following…



Tax

Shipping Cost

City

State

Country



Then during the loop of items I also need to know…



Item Name

Category



Is there a place where these are all listed?



Thanks!!!



Chris

Well, I finally put in a ticket and support gave me the answer…


{$order_info.order_id}
{$order_info.shipping_cost}
{$order_info.s_state}
{$order_info.s_country}
{$order_info.s_city}
{$order_info.tax_ids}
{$item.product}
{$item.tax_value}




I hope this helps some other people for setting up tracking codes.



Thanks!



Chris

Just FYI, when I have questions like this, I add to the template something like:

```php


```

Then do a view page source and you'll see all the elements of that object. Just just delete the line when you're done.

Oh you are awesome! Thanks for this tip!

yes, very handy - thanks for that…

Thank you. Very usefull.

Thanks. this is really helpful. Can someone help me. I want to put the customers username in the invoice.tpl nfile. whats the string name? i’ve tried $order_info.username and so many others. please help? :confused:

you can use {debug} in any template and visit your page to see all defined variables. but do not forget, if anybody visit your page,

he/she can view all of your defined variables ;)



i am not sure but it must be in cookie variable.

use debug and check please.


[quote name=‘huchein’ timestamp=‘1423907161’ post=‘205312’]

Thanks. this is really helpful. Can someone help me. I want to put the customers username in the invoice.tpl nfile. whats the string name? i’ve tried $order_info.username and so many others. please help? :confused:

[/quote]

Hello guys,

Any ideas how to pass a coupon code variable in order_confirmation.override.tpl?

I've tried several strings below and none of them are working.

$order_info.coupons

$coupon_code

$promo_code

I'm trying to pass coupon code variable to affiliate marketing platform, so affiliates can get credit when their coupon code is used on the site.

Cheers,

Please add the following code:

{$order_info|fn_print_r}

and go to the order confirmation page. You will see the whole content of the $order_info array

Thanks for the info eComLabs,

It would of been a lot easier if published the string, but I don't mind discovering and playing with source code.

So far I've got: [coupons] => Array, but when I've tried to pass it using $order_info.coupons string, it does not work.

I have also tried: $order_info.name, still no positive results.

I remember having this issue before, and I think the variable for coupon code was not name friendly.

Will try to dig some more, but if you already know the answer, I don't mind saving some time. ;)

Cheers,

Promotions are stored as an promotion_id. You will have to resolve this ID to a name (or value) I believe to get the coupon code related to a promotion in an order.

There got to be an easy way to pull the coupon code from Thank you page and pass it to the affiliate tracking code. It was very easy with earlier versions of cs-cart. I am very surprised that nobody inquired about it before.

In general, the basic $order_info structure has not changed a lot other than shipping/packaging

What did you use in V2?

Yes. In 1.35 and 2.25.

My question was "WHAT" did you use in V2? I.e. what was the smarty code you used in V2?

To be honest I don't remember for V2 now, it was a few years ago.

But for 1.35 it was: var uts_coupon = '{$key}' ;

1.35 doesn't help me. Can't you look at your existing V2 code and simply pull it out? Otherwise we're all guessing here at what you mean.

Thanks for the info eComLabs,

It would of been a lot easier if published the string, but I don't mind discovering and playing with source code.

So far I've got: [coupons] => Array, but when I've tried to pass it using $order_info.coupons string, it does not work.

I have also tried: $order_info.name, still no positive results.

I remember having this issue before, and I think the variable for coupon code was not name friendly.

Will try to dig some more, but if you already know the answer, I don't mind saving some time. ;)

Cheers,

coupons is always an array. You should not refer to it by {$order_info.coupons} directly, this does not make sense.

You can use the {foreach} to take the content of each coupon.

In 2.2.5 it will look like the following:

{foreach from=$order_info.coupons item="coupon" key="coupon_key"}
    {$coupon_key}
{/foreach}

It it was not coupons from promotions, but gift certificates, the code will be the following:

{foreach from=$order_info.use_gift_certificates item="gift_certificate" key="gift_certificate_key"}
    {$gift_certificate_key}
{/foreach}

Thanks for the info eComLabs,

It would of been a lot easier if published the string, but I don't mind discovering and playing with source code.

So far I've got: [coupons] => Array, but when I've tried to pass it using $order_info.coupons string, it does not work.

I have also tried: $order_info.name, still no positive results.

I remember having this issue before, and I think the variable for coupon code was not name friendly.

Will try to dig some more, but if you already know the answer, I don't mind saving some time. ;)

Cheers,

Please post the content of the $order_info array here (without sensitive information) so that we can check you and provide with the solution