Zen Cart Logo
Forums / All Other Contributions/Addons / Super Orders v3.0 Support Thread (for ZC v1.3.9)

Super Orders v3.0 Support Thread (for ZC v1.3.9)

Views: 176,709

Results 381 to 400 of 1,018
22 Apr 2011, 5:35 PM
#381
fo0bar avatar

fo0bar

New Zenner

Join Date:
Apr 2011
Location:
Australia
Posts:
16
Plugin Contributions:
0

Super Orders v3.0 Support Thread (for ZC v1.3.9)

....wow! i'm seriously honoured you're using my modifications!

my apologies to everyone about not sharing the code here :blush: i felt that since i'd mucked around so much, i'd lost track of exactly where i'd fiddled, and couldn't really give a "replace here to here" kind of submission :P

Also, advance apologies for my possible lack of forum-etiquitte...this is the first forum i've ever really comitted to. Complete forum noob here....educate me! corrupt me!

I don't mind putting in a little work if people find it useful - i'd be happy to have a bit of a hack at the multiple attribute titles issue - who knows if or when i might even need it! In theory it shouldn't be too hard - a bit of a loop around an array that already exists; i just haven't attempted it yet, as i thought this would be in the new version! And i'll make sure to post the mod here once i'm done this time :wink:

I've been continuing my work on this pdf output - i've also added the store logo to the top left, print date to top right, i'm working on a total item/value/packages count at the bottom, but something in the product loop keeps resetting the variables...I didn't want to go too far on it, as i thought this pdf output was what was being updated..didn't want to go reinventing the wheel!

Oh, and shipping method is definitely on of my top mods to work on. I need it. the AustPost shipping module is just making it a bit difficult for me to work with. I've got it displaying the "main" shipping method (for example, Australia Post), but not the 'sub' method (the choice between parcel/express).

Thanks again for an awesome contrib, i'm lovin' it.

DivaVocals:

fo0bar - PLEASE feel free to share your changes here.. This way if you ever slip into the darkness:laugh:, folks won't be wondering where your cool changes went to..:smile:

As you can understand, I can't incorporate EVERYTHING people ask about here into the codebase.. From my perspective, Super Orders has to serve a WIDE audience.. So I make changes base don that perspective..

BUT...

others might be looking for the VERY change YOU are making and so I ENCOURAGE you to share your changes with the community!!

That said ScriptJunkie shared with me your changes to the "Master Packingslip List" (for those who don't know what this is, part of the PDF Packingslip features includes a master LIST of packing slips.. Think of it as a summarized order picklist)

My apologies for not understanding that the "Master Packingslip List" is what you were updating as opposed to the PDF Packingslip itself..

ANYWAY...

I'm LOVING the checkboxes and other changes you made to the "Master Packingslip List"..:clap: The addition of the customer address, and the modifications to the layout are outstanding and a must have IMHO!!! I have merged your changes into the "Master Packingslip List" in new fileset that I plan to submit (hopefully this weekend)

I am thinking that shipping method would also be something useful to include on the "Master Packingslip List" as well.. Gonna see if I can tackle that at some point for a later release..

..................

22 Apr 2011, 5:56 PM
#382
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

fo0bar:

my apologies to everyone about not sharing the code here :blush: i felt that since i'd mucked around so much, i'd lost track of exactly where i'd fiddled, and couldn't really give a "replace here to here" kind of submission :P

I can help with that :) I compared the file you gave me with the file that came with SO3. These are the resulting changes:

  1. Add tick/check box in front of each order item
  2. Add spaces between each order item line
  3. Decrease order item font size in order to make room for the addition of customer address
  4. Moved Product ID Number and Order Date to align right
  5. Added customer address (aligned right)

These changes make the master packing slip pdf (found in batch printing) much easier to read and much more functional! Thanks Fo0bar!

Here's the code:

EDIT 1

At or about Line 219, Find:

$pdf->Cell(10, 10, '', 'LRTB');

On the next line, Replace This:

$pdf->MultiCell(566, 12, $headingLine);

With This:

$pdf->SetFontSize('10');
        $pdf->Cell(450, 12, $headingLine,'','0');
	$orderRightBox = '#' . $order->info[id] . '          ' . zen_date_short($order->info['date_purchased']) . ' ';
        $pdf->MultiCell('180','10',$orderRightBox,'','','R');
        $pdf->SetFontSize('6');
        $shipTo = zen_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n"); 
        if($order->delivery['street_address'] == ''){
            $shipTo = zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n");    
        } 
	$pdf->Cell('580','10',$shipTo,'','','R');   

        $pdf->MultiCell(566,2,'');

EDIT 2

At or about Line 226, Find:

if ($orderText != ''){

On the next line, Replace This:

$orderText .= ', ';

With This:

$orderText = '';
//$orderText .= ', ';

EDIT 3

At or about Line 227, Find:

}

On the next line, Replace This:

$orderText .= '(' . $order->products[$i]['qty'] . ') ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'];

With This:

//This modification displays the attribute title in the line.
                	$attribText = (!$order->products[$i]['attributes'][0]['value']) ? '' : (' - ' . $order->products[$i]['attributes'][0]['value']) ;
                $orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;
                $pdf->Cell(27, 10, '');
                $pdf->Cell(8, 8, '', 'LRTB');
                $pdf->Cell(5, 0, '');
                $pdf->SetFontSize('6');
                $pdf->MultiCell(520, 10, $orderText); //display order text

EDIT 4

At or about Line 230, Find:

/* order object doesn't include orderid.  added id to info so we can retrieve it here */

On the next line, Replace This:

$orderText = '[#' . $order->info[id] . ' ' . zen_date_short($order->info['date_purchased']) . '] ' . $orderText; 
                               
            $pdf->Cell(27, 12, ''); 
            $pdf->MultiCell(549, 12, $orderText);

With This:

$pdf->MultiCell(520,8,'');
22 Apr 2011, 6:12 PM
#383
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

Brilliant - all of you. Anyone for Cointreau with their coffee.

fo0bar:

i'm working on a total item/value/packages count at the bottom, but something in the product loop keeps resetting the variables...I didn't want to go too far on it, as i thought this pdf output was what was being updated..didn't want to go reinventing the wheel!

Have you seen this

http://www.zen-cart.com/forum/showpost.php?p=995228&postcount=212

Cheers

22 Apr 2011, 6:16 PM
#384
fo0bar avatar

fo0bar

New Zenner

Join Date:
Apr 2011
Location:
Australia
Posts:
16
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

Excellent!

...and how far away is the new release? i've nailed the multiple attributes code if you'd like to include it, basically replace the code i mentioned above with the following code:

                	$attribCount=(sizeof($order->products[$i]['attributes']));
                	if($attribCount>1){
                		//more than one attribute in array
                		
                		$aC=0;
                		while($aC < $attribCount){
                			$attribText .= ' - ' . $order->products[$i]['attributes'][$aC]['value'];
                			$aC++;
                		}
                	}else{
                		$attribText = (!$order->products[$i]['attributes'][0]['value']) ? '' : (' - ' . $order->products[$i]['attributes'][0]['value']) ;
                	}
                $orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;

hope this helps :)

ScriptJunkie:

I can help with that :) I compared the file you gave me with the file that came with SO3. These are the resulting changes:

  1. Add tick/check box in front of each order item
  2. Add spaces between each order item line
  3. Decrease order item font size in order to make room for the addition of customer address
  4. Moved Product ID Number and Order Date to align right
  5. Added customer address (aligned right)

These changes make the master packing slip pdf (found in batch printing) much easier to read and much more functional! Thanks Fo0bar!

Here's the code:

.................

22 Apr 2011, 6:18 PM
#385
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

dw08gm:

Brilliant - all of you. Anyone for Cointreau with their coffee.

Have you seen this

http://www.zen-cart.com/forum/showpost.php?p=995228&postcount=212

Cheers

Not sure I understand what "Total Qty vs Total Products" means.. A screenprint would help..

22 Apr 2011, 6:27 PM
#386
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

The new release is as far away as the free time I have allows.. Sorry to be vague, but my day job and paid side work will ALWAYS trump free contributions.. :laugh::laugh:

Seriously though.. I hope to have it compiled and testing done this weekend.. All depends on my tester's schedule too.. I don't want to release this until I get feedback from testers.. Gonna try and toss something out tonight to the testers..

and BTW, I don't mind sharing code with others who will REALLY test and provide feedback.. But be prepared.. asking to test doesn't mean I will send out the code.. I tend to be VERY selective about who I share code with pre-submission because too many times I've had folks who didn't REALLY want to test, they simply wanted to get the "latest & greatest" version of a module.. (hideCategories is one example of where a few folks ahem stretched the truth about doing "testing" to scam .. I mean obtain a "pre-release" copy of the mod)

In the meantime, your multiple attributes code for the Master Packingslip List looks loads simpler than the multiple attributes code being used for the PDF Packingslip. I was planning on trying to incorporate the PDF Packingslip multiple attributes code into the Master Packingslip List, but yours looks MUCH simpler.. (and you say it's working?? hmmmm)

fo0bar:

Excellent!

...and how far away is the new release? i've nailed the multiple attributes code if you'd like to include it, basically replace the code i mentioned above with the following code:

                $attribCount=(sizeof($order->products[$i]['attributes']));
                if($attribCount>1){
                    //more than one attribute in array
                    
                    $aC=0;
                    while($aC < $attribCount){
                        $attribText .= ' - ' . $order->products[$i]['attributes'][$aC]['value'];
                        $aC++;
                    }
                }else{
                    $attribText = (!$order->products[$i]['attributes'][0]['value']) ? '' : (' - ' . $order->products[$i]['attributes'][0]['value']) ;
                }
            $orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;
22 Apr 2011, 6:32 PM
#387
fo0bar avatar

fo0bar

New Zenner

Join Date:
Apr 2011
Location:
Australia
Posts:
16
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

DivaVocals:

(and you say it's working?? hmmmm)

i've tested it with 2 attributes (only short term as it was on a live shop.. don't try this at home, kids), and it's working great; the way it's written should work for virtually unlimited attributes - it displays it as:

[product text]MODELNUMBER - att1 - att2 - att3

and all the single-attribute products display the same as in my previous mod :)

i'll be back in 12 hours - it's 4:30am!

[edit]
it's actually still running live with that mod; i haven't changed it back 'cause it's working - just removed the item's second attribute :P

22 Apr 2011, 6:36 PM
#388
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

DivaVocals:

Not sure I understand what "Total Qty vs Total Products" means.. A screenprint would help..

I do not have a screenprint to hand however

Product A x 3
Product B x 2
Product C x 4

Total Products = 3 (A+B+C)
Total Quantity = 9 (3+2+4)

Provides extra QA. Useful when like products are bundled prior to final packaging, although can be problematic with products sold by dimension (eg metres/rope) or dollar amounts (eg donations, gift certs).

Hope this helps.

22 Apr 2011, 6:38 PM
#389
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

fo0bar:

....wow! i'm seriously honoured you're using my modifications!

my apologies to everyone about not sharing the code here :blush: i felt that since i'd mucked around so much, i'd lost track of exactly where i'd fiddled, and couldn't really give a "replace here to here" kind of submission :PIt's a good one, and VERY worthy of inclusion!!! Take a bow, you totally deserve it!!

fo0bar:

Also, advance apologies for my possible lack of forum-etiquitte...this is the first forum i've ever really comitted to. Complete forum noob here....educate me! corrupt me!
Ahhhh such a BIG OPENING... sigh I won't go there!!!:laugh:

fo0bar:

I don't mind putting in a little work if people find it useful - i'd be happy to have a bit of a hack at the multiple attribute titles issue - who knows if or when i might even need it! In theory it shouldn't be too hard - a bit of a loop around an array that already exists; i just haven't attempted it yet, as i thought this would be in the new version! And i'll make sure to post the mod here once i'm done this time :wink:

I've been continuing my work on this pdf output - i've also added the store logo to the top left, print date to top right, i'm working on a total item/value/packages count at the bottom, but something in the product loop keeps resetting the variables...I didn't want to go too far on it, as i thought this pdf output was what was being updated..didn't want to go reinventing the wheel!Let me make sure it's clear what code I was planning on submitting..:smile:

What I have is the update to support multiple attributes on the PDF Packinglist, but NOT the PDF Master Packingslip LIST.

It was an over-sight on my part really not to ask the original contributor of the PDF Packingslip code to update the Master Packingslip List as well as the the PDF Packingslip.

BUT since you have provided a working version of the multiple attributes code for the Master Packingslip List, I add that and test it too..:smile:

fo0bar:

Oh, and shipping method is definitely on of my top mods to work on. I need it. the AustPost shipping module is just making it a bit difficult for me to work with. I've got it displaying the "main" shipping method (for example, Australia Post), but not the 'sub' method (the choice between parcel/express).

Thanks again for an awesome contrib, i'm lovin' it.Awesome.. Looking forward to seeing what you come up with.. Just remember that SHARESIES is always a GOOD thing!!:laugh:

22 Apr 2011, 6:42 PM
#390
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

fo0bar:

i've tested it with 2 attributes (only short term as it was on a live shop.. don't try this at home, kids), and it's working great; the way it's written should work for virtually unlimited attributes - it displays it as:

[product text]MODELNUMBER - att1 - att2 - att3

and all the single-attribute products display the same as in my previous mod :)

i'll be back in 12 hours - it's 4:30am!

[edit]
it's actually still running live with that mod; i haven't changed it back 'cause it's working - just removed the item's second attribute :PAhhh.. Will have to have a looksee.. So the attributes are lined up horizontally next to the model number??

The new multiple attributes code i have from the original contributor created arranges the attributes on the PDF Packingslip as follows:

Product detail line
att1
att2
att3

23 Apr 2011, 12:25 AM
#391
fo0bar avatar

fo0bar

New Zenner

Join Date:
Apr 2011
Location:
Australia
Posts:
16
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

DivaVocals:

Ahhh.. Will have to have a looksee.. So the attributes are lined up horizontally next to the model number??

The new multiple attributes code i have from the original contributor created arranges the attributes on the PDF Packingslip as follows:

yep - lined up horizontally - as my changes made the rows a bit higher, i tried to make each row take up as little height as possible - line returns equal paper wasted. that, and i'm O/C (not the lightswitch-flicking, doorknob-wiping variety though...more perfection and symmetry :P ) - single words on their own line just doesn't sit right with me, for whatever reason i don't really know.

feel free to play round with my bits of code, or if you think of something else to add to my list of mods to work on, let me know and i'll give it a shot!

23 Apr 2011, 12:38 AM
#392
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

Hey fo0bar,

I tested the multiple attributes support this afternoon, and it's not functioning as expected under all circumstances. While the circumstances under which it's gone wonky are not common, they could occur in a live store - and therefore the modifications must be able to handle them if they are to be included in a release of SO3.

Also, I discovered an issue with the modification that moves order numbers to the right.

Can you PM me your email address so I can send screen shots of the details? For whatever reason, I'm not able to post images to the forum successfully.

Diva wants to submit the newest SO3 update this weekend, so if the necessary changes are something you can make quickly, they can be included in the next release. If not, we'll hold off until the following release.

Lastly, the reason for needing vertical listing of multiple attributes (vs. the paper saving horizontal method) is that if there are long product and/or attribute names, they get truncated when formatted horizontally. Therefore, vertical formatting is necessary.

Having said that, if you personally prefer to use horizontal formatting, you should by all means do so. But is vertical formatting something you'd be able to work out for inclusion in the SO3 update release?

fo0bar:

yep - lined up horizontally - as my changes made the rows a bit higher, i tried to make each row take up as little height as possible - line returns equal paper wasted. that, and i'm O/C (not the lightswitch-flicking, doorknob-wiping variety though...more perfection and symmetry :P ) - single words on their own line just doesn't sit right with me, for whatever reason i don't really know.

feel free to play round with my bits of code, or if you think of something else to add to my list of mods to work on, let me know and i'll give it a shot!

23 Apr 2011, 12:57 AM
#393
fo0bar avatar

fo0bar

New Zenner

Join Date:
Apr 2011
Location:
Australia
Posts:
16
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

ScriptJunkie:

Hey fo0bar,

I tested the multiple attributes support this afternoon, and it's not functioning as expected under all circumstances. While the circumstances under which it's gone wonky are not common, they could occur in a live store - and therefore the modifications must be able to handle them if they are to be included in a release of SO3.

Also, I discovered an issue with the modification that moves order numbers to the right.

Can you PM me your email address so I can send screen shots of the details? For whatever reason, I'm not able to post images to the forum successfully.

Diva wants to submit the newest SO3 update this weekend, so if the necessary changes are something you can make quickly, they can be included in the next release. If not, we'll hold off until the following release.

Lastly, the reason for needing vertical listing of multiple attributes (vs. the paper saving horizontal method) is that if there are long product and/or attribute names, they get truncated when formatted horizontally. Therefore, vertical formatting is necessary.

Having said that, if you personally prefer to use horizontal formatting, you should by all means do so. But is vertical formatting something you'd be able to work out for inclusion in the SO3 update release?

eep! i'm happy to continue working on it to make it a cover-all. i'll be PMing you my email address right away. I was just looking over my code and did notice that i hadn't done it perfectly to accommodate not having any attributes, but in my particular test it seems fine.

And yes - i'm absolutely more than happy to work out a bit of code to make the attribs display vertically - this isn't much work at all :D

23 Apr 2011, 1:43 AM
#394
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

Great! I'll go check my PM and email you right away :)

fo0bar:

eep! i'm happy to continue working on it to make it a cover-all. i'll be PMing you my email address right away. I was just looking over my code and did notice that i hadn't done it perfectly to accommodate not having any attributes, but in my particular test it seems fine.

And yes - i'm absolutely more than happy to work out a bit of code to make the attribs display vertically - this isn't much work at all :D

23 Apr 2011, 2:33 PM
#395
fo0bar avatar

fo0bar

New Zenner

Join Date:
Apr 2011
Location:
Australia
Posts:
16
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

ScriptJunkie:

Hey fo0bar,

I tested the multiple attributes support this afternoon, and it's not functioning as expected under all circumstances. While the circumstances under which it's gone wonky are not common, they could occur in a live store - and therefore the modifications must be able to handle them if they are to be included in a release of SO3.

Also, I discovered an issue with the modification that moves order numbers to the right.

Can you PM me your email address so I can send screen shots of the details? For whatever reason, I'm not able to post images to the forum successfully.

Diva wants to submit the newest SO3 update this weekend, so if the necessary changes are something you can make quickly, they can be included in the next release. If not, we'll hold off until the following release.

Lastly, the reason for needing vertical listing of multiple attributes (vs. the paper saving horizontal method) is that if there are long product and/or attribute names, they get truncated when formatted horizontally. Therefore, vertical formatting is necessary.

Having said that, if you personally prefer to use horizontal formatting, you should by all means do so. But is vertical formatting something you'd be able to work out for inclusion in the SO3 update release?

Done. All issues fixed (including vertical attributes!), after basically rewriting the entire function. :frusty:

ScriptJunkie, I'll be emailing you a copy of the updated file so you can test it and see if it's functional and suitable for your cart. I think (read:hope) it'll be perfect for what you want. Diva, I'd send it to you but i don't have your email. PM me if you'd like me to email it to you.

for anyone else who wants to try this code:

  1. BACK UP BACK UP BACK UP

  2. open admin/includes/functions/extra_functions/lcsd_merged_packing_slips.php in a text editor.

  3. find the following line:

    function draw_packing_slip_master_list_customer($orderArray, &$pdf){  

select that line, and EVERYTHING UNTIL (**but NOT including **this line:

    function lcsd_merged_packingslips($selected_oids, $merge_selected_oids){

remember, do NOT select that line.

replace everything you've selected in the steps above, with this:

    function draw_packing_slip_master_list_customer($orderArray, &$pdf){  
        $order = $orderArray[0];
        
        $customerName = $order->delivery['name']; 
        if($order->delivery['street_address'] == ''){  /* this is to match the merged packingslips record */
            $customerName = $order->customer['name'];    
        } 
        
        $totalQty = 0;
        foreach($orderArray as $order){               
            for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { 
                $totalQty = $totalQty + $order->products[$i]['qty'];  
            }  
        } 
        if ($totalQty == 1){  
            $headingLine = $customerName . ' (' . $totalQty . ' piece)';
        }
        else{  
            $headingLine = $customerName . ' (' . $totalQty . ' pieces)';
        }

        
         //sort out the header address line
        $shipTo = zen_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n"); 
        if($order->delivery['street_address'] == ''){
            $shipTo = zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n");    
        } 
        $orderRightBox = $shipTo;
        $pdf->SetFontSize('6');
        $pdf->Cell('580','10',$orderRightBox,'','','R');   
        $pdf->Line(18,$pdf->GetY(),594,$pdf->GetY());
        $pdf->Ln(2);
        $pdf->SetFontSize('10');
        $pdf->Cell(10, 10, '', 'LRTB');    
        $pdf->Cell(200, 12, $headingLine,'','0');
	$pdf->Ln(10);
	$pdf->MultiCell(566,2,''); 
	
	
        
        foreach($orderArray as $order){  
            $orderText = '';                                                                      
            for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { 
                if ($orderText != ''){
                    $orderText = '';
                }
		$pdf->Ln(4);
                $pdf->Cell(27, 10, '');
                $pdf->Cell(8, 8, '', 'LRTB');
                $pdf->Cell(5, 0, '');
                $pdf->SetFontSize('6');
                $multiAtt = false;
        	if(sizeof($order->products[$i]['attributes']) >0){
                	$attribCount=(sizeof($order->products[$i]['attributes']));
                	if($attribCount>1){
                		$aC=0;
                		while($aC < $attribCount){
                			$attribText = ' - ' . $order->products[$i]['attributes'][$aC]['value'];
                			if($aC==0){
                				$orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;
                				$pdf->Cell(380,10,$orderText,0,0);
                				$dateId = zen_date_short($order->info['date_purchased']) . '        #' . $order->info[id];
                				$pdf->SetFontSize('10');
	                			$pdf->Cell('140','10',$dateId,'0','1','R');
	                			$multiAtt=true;
                				$pdf->SetFontSize('6');
                			}else{
                				$widthTest = (' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model']);
                				$spaceWidth = $pdf->GetStringWidth($widthTest) + 40;
                				$orderText = $attribText;
                				$pdf->Ln(0);
                				$pdf->Cell($spaceWidth,10,'');
                				$pdf->Cell(20,12,$orderText,0,0);
                			}
                			$aC++;
                			
                		}
                	}else{
                		$attribText = (!$order->products[$i]['attributes'][0]['value']) ? '' : (' - ' . $order->products[$i]['attributes'][0]['value']) ;
                		$orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;
                		$pdf->Cell(380,10,$orderText);
                	}
                }else{
                	$orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'];
                	$pdf->Cell(380,10,$orderText);
                
                }
		$attribText = '' ;
                $orderIdText = $order->info[id];
                if ($orderIdText == $previousOrderId){
                	$pdf->MultiCell('580','10',' ','','','R');
                }else{
                	if (!$multiAtt){
	                	$pdf->SetFontSize('10');
	                	$dateId = zen_date_short($order->info['date_purchased']) . '      #' . $order->info[id];
		                $pdf->Cell('140','10',$dateId,'0','1','R');
		                $pdf->Ln(0);
		                $previousOrderId = $order->info[id];
	                }
                }
            }
            $pdf->Ln(8);
        }
    }        
         

Again, I hope this helps.

23 Apr 2011, 3:35 PM
#396
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

Hi Diva

Any chance of you adding a heading and dashed underline immediately above the customer comments of the email output in the next release.

eg line 226 and elsewhere in admin\includes\functions\extra_functions\common_orders_functions.php

TABLE_HEADING_COMMENTS . "\n" . EMAIL_SEPARATOR . "\n" . strip_tags($notify_comments) .

Thanks in advance

23 Apr 2011, 4:08 PM
#397
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

The upcoming release is going to be eliminating the need for this function file at all as I have "synchronized" and "reconciled" the comments code from Super Orders with the default comments code used in orders.php. (doing the same for Edit Orders as well)

Doing so will make any future changes with comments in Zen Cart easier to incorporate into Super Orders (and Edit Orders)

dw08gm:

Hi Diva

Any chance of you adding a heading and dashed underline immediately above the customer comments of the email output in the next release.

eg line 226 and elsewhere in admin\includes\functions\extra_functions\common_orders_functions.php

TABLE_HEADING_COMMENTS . "\n" . EMAIL_SEPARATOR . "\n" . strip_tags($notify_comments) .

Thanks in advance

23 Apr 2011, 4:36 PM
#398
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

and so I'm CLEAR, these are changes to the PDF "Master list of packing slips" correct??:smile:

fo0bar:

Done. All issues fixed (including vertical attributes!), after basically rewriting the entire function. :frusty:

ScriptJunkie, I'll be emailing you a copy of the updated file so you can test it and see if it's functional and suitable for your cart. I think (read:hope) it'll be perfect for what you want. Diva, I'd send it to you but i don't have your email. PM me if you'd like me to email it to you.

for anyone else who wants to try this code:

  1. BACK UP BACK UP BACK UP

  2. open admin/includes/functions/extra_functions/lcsd_merged_packing_slips.php in a text editor.

  3. find the following line:

function draw_packing_slip_master_list_customer($orderArray, &$pdf){  
> 
> ```php
    function lcsd_merged_packingslips($selected_oids, $merge_selected_oids){
```remember, do NOT select that line.
> 
> replace everything you've selected in the steps above, with this:
> 
> ```php
    function draw_packing_slip_master_list_customer($orderArray, &$pdf){  
        $order = $orderArray[0];
        
        $customerName = $order->delivery['name']; 
        if($order->delivery['street_address'] == ''){  /* this is to match the merged packingslips record */
            $customerName = $order->customer['name'];    
        } 
        
        $totalQty = 0;
        foreach($orderArray as $order){               
            for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { 
                $totalQty = $totalQty + $order->products[$i]['qty'];  
            }  
        } 
        if ($totalQty == 1){  
            $headingLine = $customerName . ' (' . $totalQty . ' piece)';
        }
        else{  
            $headingLine = $customerName . ' (' . $totalQty . ' pieces)';
        }

        
         //sort out the header address line
        $shipTo = zen_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n"); 
        if($order->delivery['street_address'] == ''){
            $shipTo = zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n");    
        } 
        $orderRightBox = $shipTo;
        $pdf->SetFontSize('6');
        $pdf->Cell('580','10',$orderRightBox,'','','R');   
        $pdf->Line(18,$pdf->GetY(),594,$pdf->GetY());
        $pdf->Ln(2);
        $pdf->SetFontSize('10');
        $pdf->Cell(10, 10, '', 'LRTB');    
        $pdf->Cell(200, 12, $headingLine,'','0');
    $pdf->Ln(10);
    $pdf->MultiCell(566,2,''); 
    
    
        
        foreach($orderArray as $order){  
            $orderText = '';                                                                      
            for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { 
                if ($orderText != ''){
                    $orderText = '';
                }
        $pdf->Ln(4);
                $pdf->Cell(27, 10, '');
                $pdf->Cell(8, 8, '', 'LRTB');
                $pdf->Cell(5, 0, '');
                $pdf->SetFontSize('6');
                $multiAtt = false;
            if(sizeof($order->products[$i]['attributes']) >0){
                    $attribCount=(sizeof($order->products[$i]['attributes']));
                    if($attribCount>1){
                        $aC=0;
                        while($aC < $attribCount){
                            $attribText = ' - ' . $order->products[$i]['attributes'][$aC]['value'];
                            if($aC==0){
                                $orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;
                                $pdf->Cell(380,10,$orderText,0,0);
                                $dateId = zen_date_short($order->info['date_purchased']) . '        #' . $order->info[id];
                                $pdf->SetFontSize('10');
                                $pdf->Cell('140','10',$dateId,'0','1','R');
                                $multiAtt=true;
                                $pdf->SetFontSize('6');
                            }else{
                                $widthTest = (' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model']);
                                $spaceWidth = $pdf->GetStringWidth($widthTest) + 40;
                                $orderText = $attribText;
                                $pdf->Ln(0);
                                $pdf->Cell($spaceWidth,10,'');
                                $pdf->Cell(20,12,$orderText,0,0);
                            }
                            $aC++;
                            
                        }
                    }else{
                        $attribText = (!$order->products[$i]['attributes'][0]['value']) ? '' : (' - ' . $order->products[$i]['attributes'][0]['value']) ;
                        $orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText;
                        $pdf->Cell(380,10,$orderText);
                    }
                }else{
                    $orderText .= ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'];
                    $pdf->Cell(380,10,$orderText);
                
                }
        $attribText = '' ;
                $orderIdText = $order->info[id];
                if ($orderIdText == $previousOrderId){
                    $pdf->MultiCell('580','10',' ','','','R');
                }else{
                    if (!$multiAtt){
                        $pdf->SetFontSize('10');
                        $dateId = zen_date_short($order->info['date_purchased']) . '      #' . $order->info[id];
                        $pdf->Cell('140','10',$dateId,'0','1','R');
                        $pdf->Ln(0);
                        $previousOrderId = $order->info[id];
                    }
                }
            }
            $pdf->Ln(8);
        }
    }        
         
```Again, I hope this helps.
23 Apr 2011, 4:54 PM
#399
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

DivaVocals:

and so I'm CLEAR, these are changes to the PDF "Master list of packing slips" correct??:smile:

Correct :)

I'll be beginning testing in the next few minutes :)

23 Apr 2011, 5:58 PM
#400
fo0bar avatar

fo0bar

New Zenner

Join Date:
Apr 2011
Location:
Australia
Posts:
16
Plugin Contributions:
0

Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)

DivaVocals:

and so I'm CLEAR, these are changes to the PDF "Master list of packing slips" correct??:smile:

you got it!

...i'm pretty keen to know how it tests - i'm slightly limited when it comes to testing this multiple attribute stuff in a live store :P