You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
I searched first and found this from way back in 2007 https://forum.kryptronic.com/viewtopic.php?id=18890 but there was no reply so I'm posting a new one.
I need to edit my drop shipper emails. Suppliers are complaining the right most portion gets cut off. I don't know why, you'd think the text would wrap around.
So I want to move all items in the right column, which is only the Delivery Address, and place it above the "Items" section.
In ccp0.ordersummaryxhtml I searched for "delivery Address" and found on line 527
if ($ship_type != 'NOTSHIPPED') { print '<td class="khxc_regtable" style="width: 50%">' . $eol; print '<p class="strong">Delivery Address</p>' . $eol; $address = $this->include_namespace($app,'getaddress',array('address' => $ship_addys[$ship_type], 'format' => 'XHTML')); print '<p>' . $address . '</p>' . $eol; print '</td>' . $eol; } // End of if statement.
which is the <td> contents. (I think!) So I just need to figure out where it should go. Any ideas?
Offline
What you are wanting to do is basic HTML, - re-ordering a table structure.
I don't know how familiar you are with HTML and CSS, but all you should need to do is literally re-arrange the table (and move the code sections around as necessary). - You may have use the and rules for some of the tags, especially if grouping information together. Also any forms within the layout may prove problematic because they follow specific one and two column layouts (and are an absolute basket to modify).
Offline
I figured there might be some problems so what I was thinking on doing was to leave an empty <td> where the Delivery Address currently is, then move that IF statement (html modified if necessary) to be placed above the start of "Items".
The first question I have is if $ship_type is defined after that position I want to place it in. If so, then the IF statement will fail because of the undefined $ship_type. Know what I mean?
Last edited by CrownRoyal (01-10-2011 20:31:00)
Offline
I know what you mean, - you might have to re-order the coding sequence, too, but it should still work okay if you do.
Try not to leave empty cells. If possible, alter the table so it is completely removed or expand the previous with . Failing that, replace the moved content with , - some browsers do not care for totally empty table cells.
Last edited by Design_Wholesale (01-10-2011 20:39:41)
Offline
when necessary I usually use  
Offline
Fair enough, - just a matter of personal choice; as long as what you go with works, that's the main thing.
Offline
As an initial test of making this edit, I copied the IF statement for the Delivery Address to the spot above the "Items" in the html. This is what I did
... // +-- // | Print our items. // +-- if ($ship_type != 'NOTSHIPPED') { print '<td class="khxc_regtable" style="width: 50%">' . $eol; print '<p class="strong">Delivery Address</p>' . $eol; $address = $this->include_namespace($app,'getaddress',array('address' => $ship_addys[$ship_type], 'format' => 'XHTML')); print '<p>' . $address . '</p>' . $eol; print '</td>' . $eol; } // End of if statement. print '<div class="khxc_regtablehead">test space</div>' . $eol . $eol; print '<div class="khxc_regtablehead">Items</div>' . $eol . $eol; ...
I ran a test purchase through and the Drop Shipper email I got looks like this:
...
PO1006975329
_____________________________
01/10/2011 10:07:16 PM
_____________________________
_______________________________
________________________________
...
While the print statement echoed the text "Delivery Address" and the
"test" text also displayed, the important delivery address information did not display. So that means that the definition for the $address:
$address = $this->include_namespace($app,'getaddress',array('address' => $ship_addys[$ship_type], 'format' => 'XHTML'));
must be getting its information from the foreach statement:
foreach ($ship_array as $ship_type => $ship_items).....
I wonder if I moved that new code position below the foreach statement. What do you think?
Last edited by CrownRoyal (01-10-2011 22:01:35)
Offline
Try to keep code layout order as it was so, yes, if the $address line was originally contained within the foreach statement, : somewhere between the start and end braces - { } - for that statement, it should remain there in your new layout because the chances are that it would be drawing on variables generated by that statement [which, in the case of addresses, it would be - the foreach statement will be being used to go through the available details for each whatever to provide the address, name, email, etc. for each whatever (otherwise you would simply end up with the same details for each and every instance of whatever, if you follow what I am saying)].
Last edited by Design_Wholesale (01-12-2011 20:32:56)
Offline
follow
Offline
Pretty sure I got this figured out. At about line 540 of funcid=ccp0.ordersummaryxhtml is
if ($ship_type != 'NOTSHIPPED') { print '<td class="khxc_regtable" style="width: 50%">' . $eol; print '<p class="strong">Delivery Address</p>' . $eol; $address = $this->include_namespace($app,'getaddress',array('address' => $ship_addys[$ship_type], 'format' => 'XHTML')); print '<p>' . $address . '</p>' . $eol; print '</td>' . $eol; } // End of if statement.
and I moved it up to about line 345, just underneather
foreach ($ship_array as $ship_type => $ship_items) {.....
Seems to have worked in a test purchase. I'll let it run for a while and see how it goes for the variety of purchases made by customers.
Offline
Good to see that you possibly have it sorted, and it should be okay if it is still within the foreach statement.
Offline
Pages: 1