Results 1 to 8 of 8
  1. #1
    Join Date
    May 2011
    Posts
    67
    Plugin Contributions
    6

    Default Need help to creat a break line after 7 IMG in order Page

    Hello Guys,
    I modified my order page to display all IMG ordered with code and attributes.

    Now I need a HOW TO make a break line <tr> after 7 IMG displayed.

    To understand a bit more see it in http://www.pendientesparati.com/prob.html
    after 7 photos I need a new horizontal line with other 7 photos at final ordered products to print purpose.


    I modified ther orders.php and renamed to orders-foto.php and included a button to call the ordered products with PHOTO and attributes.

    Now I NEED WHAT and WHERE put something to mnake a break line after 7 IMG

    <tr>
    <?php
    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
    echo ' <td align="left" valign="top">' . "\n" .
    ' <img border="0" src="http://www.pendientesparati.com/images/' . $order->products[$i]['model'] . '.JPG" width="90" height="120"><br>' . $order->products[$i]['qty'] . 'X ' . $order->products[$i]['model'] . '' . "\n";
    if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
    for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
    echo '<br><small>&nbsp;<i>' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
    if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
    if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
    echo '</i></small>';
    }
    }

    echo ' </td>' . "\n";
    }


    ?>
    </tr>
    Last edited by Mauari; 1 May 2011 at 01:39 AM.

  2. #2
    Join Date
    May 2011
    Posts
    67
    Plugin Contributions
    6

    Default Re: Need help to creat a break line after 7 IMG in order Page

    no one know how I can do it????

  3. #3
    Join Date
    Sep 2010
    Location
    Cahokia, IL
    Posts
    19
    Plugin Contributions
    0

    Default Re: Need help to creat a break line after 7 IMG in order Page

    <tr> means table row
    I only see 1 <tr> in your code - hence the one row.
    try adding another <tr> after your 7th image
    [FONT="Comic Sans MS"]Matt Doty
    www.MoodBoosters.net
    "It's better to be a Smart A$$ than a Dumb A$$[/FONT]

  4. #4
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Need help to creat a break line after 7 IMG in order Page

    You would need to put a counter in and set it to trigger when the count reaches 7

    You need to put a new row in after every seven products, the code below should work

    It creates a table within the row you were using and allows you to create rows within that new table, note it hasn't been tested and there are the obvious bugs but it should give you a starting point, try it as a drop in fro the code you had, and see if it works

    Code:
    <tr>
     <?php
     echo '<td><table><tr>'
     $counter = 1;
     for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
     echo ' <td align="left" valign="top">' . "\n" .
     ' <img border="0" src="http://www.pendientesparati.com/images/' . $order->products[$i]['model'] . '.JPG" width="90" height="120"><br>' . $order->products[$i]['qty'] . 'X ' . $order->products[$i]['model'] . '' . "\n";
     if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
     for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
     echo '<br><small>&nbsp;<i>' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
     if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
     if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
     echo '</i></small>';
     }
     }
    
     echo ' </td>' . "\n";
     if ($counter==7)
    	{echo '</tr><tr>';
    	$counter =1;
    	}
    	else
    	{
    	$counter = ($counter + 1);
    	}
     }
    
     echo '</tr></table></td>'
    
     ?>
     </tr>
    Webzings Design
    Semi retired from Web Design

  5. #5
    Join Date
    May 2011
    Posts
    67
    Plugin Contributions
    6

    Default Re: Need help to creat a break line after 7 IMG in order Page

    Great great great the only BUG WAS the semi colon in the end line <tr>
    <?php
    echo '<td><table><tr>' "here" ;

    Worked FINE, Now I can Print the order and send to prepare
    THANK you so much

  6. #6
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Need help to creat a break line after 7 IMG in order Page

    Good to hear it worked for you
    Webzings Design
    Semi retired from Web Design

  7. #7
    Join Date
    May 2011
    Posts
    67
    Plugin Contributions
    6

    Default Re: Need help to creat a break line after 7 IMG in order Page

    Quote Originally Posted by nigelt74 View Post
    Good to hear it worked for you
    Now after years I need display it ordered by image name o product code

    The question.. how do I can display it ordered my product model o image name?
    <?php
    echo '<td><table><tr>';
    $counter = 1;
    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
    echo ' <td width="100" valign="top">' . "\n" .
    '<img src="' . DIR_WS_CATALOG . DIR_WS_IMAGES . zen_get_products_image($order->products[$i]['id']) .'"width="90" height="120" /><br>' . $order->products[$i]['qty'] . 'X ' . $order->products[$i]['model'] . '' . "\n";
    if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
    for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
    echo '<br><small>&nbsp;<i>' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
    if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
    if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
    echo '</i></small>';
    }
    }

    echo ' </td>' . "\n";
    if ($counter==7)
    {echo '</tr><tr>';
    $counter =1;
    }
    else
    {
    $counter = ($counter + 1);
    }
    }

    echo '</tr>'

    ?>

  8. #8
    Join Date
    May 2011
    Posts
    67
    Plugin Contributions
    6

    Default Re: Need help to creat a break line after 7 IMG in order Page

    The solution is...


    Name:  ORDENAR-PRODUCTOS-POR-MODELO.jpg
Views: 103
Size:  52.5 KB

 

 

Similar Threads

  1. Need a line break between attributes.
    By powpcs in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 6 Aug 2010, 08:15 AM
  2. on products page need line breaks after parts of description
    By jamesdavid in forum General Questions
    Replies: 7
    Last Post: 17 Jun 2008, 05:43 PM
  3. Adding a line break on product listing page...
    By brucegust in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 May 2008, 03:53 PM
  4. Line Break after each category
    By Charlie Denver in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 27 Jul 2007, 10:01 AM
  5. Page Hangs After Placing Order (Need Help)
    By tmcashan in forum General Questions
    Replies: 7
    Last Post: 7 Jun 2007, 09:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR