Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
display total number of purchased items in email notification
Posted: 25 May 2012 06:41 AM   [ Ignore ]
Has a Great Personality
Rank
Total Posts:  35
Joined  2010-04-08

I had the following bit of code in our email notification to show the total number of purchased items: {order_items:total_results}

However this doesn’t actually show the correct total if one item has a quantity greater than 1

For example, I want to show:

2 of item A and 4 of Item B = 6 total items purchased (not 2 total items purchased)  - I can’t seem to find the correct tag to display what I want. Any help would be great. Thanks!

Profile
 
 
Posted: 25 May 2012 09:44 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10218
Joined  2008-09-29

I believe that order_items:total_results is the total number of unique items (rows). I don’t think we have anything to display the number you need at present. I’m moving this to feature requests.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 25 May 2012 09:51 AM   [ Ignore ]   [ # 2 ]
Has a Great Personality
Rank
Total Posts:  35
Joined  2010-04-08

ah okay. thanks for moving this to a feature request.

Profile
 
 
Posted: 20 June 2012 08:52 PM   [ Ignore ]   [ # 3 ]
Is a Really Great Dancer
Avatar
RankRank
Total Posts:  97
Joined  2010-03-18

Just ran into this exact thing myself. Count me in as someone who would like to see {order_items:total_quantity} in addition to {order_items:total_results}.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 21 June 2012 01:47 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Can you try adding this function to ft.cartthrob_order_items.php?

public function replace_total_quantity($data$params = array(), $tagdata FALSE)
    
{
        $total_quantity 
0;
        
        foreach (
$data as $row)
        
{
            
if ( ! isset($row['quantity']))
            
{
                
continue;
            
}
            
            
if (isset($row['sub_items']))
            
{
                
foreach ($row['sub_items'as $_row)
                
{
                    
if ( ! isset($_row['quantity']))
                    
{
                        
continue;
                    
}
                    
                    $total_quantity 
+= $row['quantity'$_row['quantity'];
                
}
            }
            
else
            
{
                $total_quantity 
+= $row['quantity'];
            
}
        }
        
        
return $total_quantity;
    

If it works, I’ll add it to the next release.

Profile