Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

$order_info Values Rate Topic   - - - - -

 
  • Offline
  • Member
  • Members
  • Join Date: 13-Oct 09
  • 77 posts

Posted 17 October 2012 - 04:47 PM #1

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
Chris Edwards

 
  • Offline
  • Member
  • Members
  • Join Date: 13-Oct 09
  • 77 posts

Posted 19 October 2012 - 04:58 PM #2

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
Chris Edwards

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10911 posts

Posted 20 October 2012 - 05:55 AM #3

Just FYI, when I have questions like this, I add to the template something like:
<!--- {$order_info|print_r:true} -->
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.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Offline
  • Member
  • Members
  • Join Date: 13-Oct 09
  • 77 posts

Posted 25 October 2012 - 03:53 PM #4

Oh you are awesome! Thanks for this tip!
Chris Edwards

 
  • natewallis
  • Advanced Member
  • Members
  • Join Date: 11-Jan 13
  • 147 posts

Posted 17 January 2013 - 04:31 AM #5

yes, very handy - thanks for that..

 
  • alphastar
  • Junior Member
  • Trial users
  • Join Date: 20-Jan 10
  • 5 posts

Posted 26 June 2013 - 06:20 PM #6

Thank you. Very usefull.

 
  • huchein
  • Newbie
  • Trial users
  • Join Date: 14-Feb 15
  • 1 posts

Posted 14 February 2015 - 09:46 AM #7

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:

 
  • bluexpres
  • Member
  • Members
  • Join Date: 20-Jul 13
  • 45 posts

Posted 19 February 2015 - 12:46 PM #8

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.

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:



 
  • xmaster007
  • Junior Member
  • Members
  • Join Date: 20-Nov 09
  • 98 posts

Posted 09 December 2015 - 03:43 PM #9

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,



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18175 posts

Posted 09 December 2015 - 03:54 PM #10

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • xmaster007
  • Junior Member
  • Members
  • Join Date: 20-Nov 09
  • 98 posts

Posted 09 December 2015 - 04:39 PM #11

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,



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10911 posts

Posted 09 December 2015 - 06:00 PM #12

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • xmaster007
  • Junior Member
  • Members
  • Join Date: 20-Nov 09
  • 98 posts

Posted 09 December 2015 - 06:04 PM #13

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.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10911 posts

Posted 09 December 2015 - 06:48 PM #14

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

What did you use in V2?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • xmaster007
  • Junior Member
  • Members
  • Join Date: 20-Nov 09
  • 98 posts

Posted 09 December 2015 - 06:52 PM #15

Yes. In 1.35 and 2.25.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10911 posts

Posted 09 December 2015 - 06:59 PM #16

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


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • xmaster007
  • Junior Member
  • Members
  • Join Date: 20-Nov 09
  • 98 posts

Posted 09 December 2015 - 07:38 PM #17

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}' ;



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10911 posts

Posted 10 December 2015 - 01:24 AM #18

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3014 posts

Posted 10 December 2015 - 06:08 AM #19

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"}
    <span>{$coupon_key}</span>
{/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"}
    <span>{$gift_certificate_key}</span>
{/foreach}

Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Mega SEO Package - All you need for your SEO


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18175 posts

Posted 10 December 2015 - 07:17 AM #20

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.