akosh Posted June 4, 2005 Share Posted June 4, 2005 How do I get the following two images to appear beside each other instead of on top of. I can't seem to get the placement of the table right. if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image_button('button_view_cart_shopping_cart.gif', IMAGE_BUTTON_VIEW_CART_SHOPPING_CART) . '</a></center>');;} if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout_shopping_cart.gif', IMAGE_BUTTON_CHECKOUT_SHOPPING_CART) . '</a></center>');;} Link to comment Share on other sites More sharing options...
Wendy James Posted June 4, 2005 Share Posted June 4, 2005 this is one way <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><?PHP if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image_button('button_view_cart_shopping_cart.gif', IMAGE_BUTTON_VIEW_CART_SHOPPING_CART) . '</a></center>');;} ?></td> <td><?PHP if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout_shopping_cart.gif', IMAGE_BUTTON_CHECKOUT_SHOPPING_CART) . '</a></center>');;} ?></td> </tr> </table> but if there is php code before it and after it you will need to put ?> before and <?PHP after Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
akosh Posted June 4, 2005 Author Share Posted June 4, 2005 I've tried that, but it still doesn't work. This is what's happening: This is what I want: Link to comment Share on other sites More sharing options...
Wendy James Posted June 4, 2005 Share Posted June 4, 2005 Hmmm... No idea why it wouldn't work. It is a table, it has to show up next to each other, not one under another. What page are you editing? Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
akosh Posted June 4, 2005 Author Share Posted June 4, 2005 Hmmm... No idea why it wouldn't work. It is a table, it has to show up next to each other, not one under another. What page are you editing? <{POST_SNAPBACK}> I'm editing /includes/boxes/shopping_cart.php Link to comment Share on other sites More sharing options...
Wendy James Posted June 4, 2005 Share Posted June 4, 2005 I have never seen a shopping cart with both of those buttons... can you paste the code here? Maybe that will help me (or someone else) to figure it out Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
akosh Posted June 4, 2005 Author Share Posted June 4, 2005 <?php /* $Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- shopping_cart //--> <tr> <td class="boxline" <?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART); new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART)); $cart_contents_string = ''; if ($cart->count_contents() > 0) { if ((basename($PHP_SELF) == FILENAME_CHECKOUT_SHIPPING) || (basename($PHP_SELF) == FILENAME_CHECKOUT_PAYMENT) || (basename($PHP_SELF) == FILENAME_CHECKOUT_CONFIRMATION)) { $cart_contents_string='<p><b>You are about to purchase:</b></p>';} $cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { tep_session_unregister('new_products_id_in_cart'); } } $cart_contents_string .= '</table>'; } else { $cart_contents_string .= BOX_SHOPPING_CART_EMPTY; } $info_box_contents = array(); $info_box_contents[] = array('text' => $cart_contents_string); if ($cart->count_contents() > 0) { $info_box_contents[] = array('text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'right', 'text' => '<b><i>'.$currencies->format($cart->show_total()).'</i></b>'); } if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image_button('button_view_cart_shopping_cart.gif', IMAGE_BUTTON_VIEW_CART_SHOPPING_CART) . '</a></center>');;} if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout_shopping_cart.gif', IMAGE_BUTTON_CHECKOUT_SHOPPING_CART) . '</a></center>');;} new infoBox($info_box_contents); ?> </td> </tr> <!-- shopping_cart_eof //--> Link to comment Share on other sites More sharing options...
Wendy James Posted June 4, 2005 Share Posted June 4, 2005 Not sure if this will work but you had a bunch of problems on that file. <?php /* $Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- shopping_cart //--> <tr> <td class="boxline"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART); new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART)); $cart_contents_string = ''; if ($cart->count_contents() > 0) { if ((basename($PHP_SELF) == FILENAME_CHECKOUT_SHIPPING) || (basename($PHP_SELF) == FILENAME_CHECKOUT_PAYMENT) || (basename($PHP_SELF) == FILENAME_CHECKOUT_CONFIRMATION)) { $cart_contents_string='<p><b>You are about to purchase:</b></p>';} $cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { tep_session_unregister('new_products_id_in_cart'); } } $cart_contents_string .= '</table>'; } else { $cart_contents_string .= BOX_SHOPPING_CART_EMPTY; } $info_box_contents = array(); $info_box_contents[] = array('text' => $cart_contents_string); if ($cart->count_contents() > 0) { $info_box_contents[] = array('text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'right', 'text' => '<b><i>'.$currencies->format($cart->show_total()).'</i></b>'); } ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="middle"><?PHP if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image_button('button_view_cart_shopping_cart.gif', IMAGE_BUTTON_VIEW_CART_SHOPPING_CART) . '</a></center>');;} ?></td> <td align="center" valign="middle"><?PHP if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $info_box_contents[] = array('text' => '<center><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout_shopping_cart.gif', IMAGE_BUTTON_CHECKOUT_SHOPPING_CART) . '</a></center>');;} ?></td> </tr> </table> <?PHP new infoBox($info_box_contents); ?> </td> </tr> <!-- shopping_cart_eof //--> Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
akosh Posted June 4, 2005 Author Share Posted June 4, 2005 No, it didn't work. It's still doing the same thing. Link to comment Share on other sites More sharing options...
Wendy James Posted June 4, 2005 Share Posted June 4, 2005 I am at a loss then, sorry. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
akosh Posted June 4, 2005 Author Share Posted June 4, 2005 I am at a loss then, sorry. <{POST_SNAPBACK}> Thanks for trying, I appreciate it. Link to comment Share on other sites More sharing options...
akosh Posted June 4, 2005 Author Share Posted June 4, 2005 Anyone else have any ideas? Link to comment Share on other sites More sharing options...
akosh Posted June 5, 2005 Author Share Posted June 5, 2005 Last try. Link to comment Share on other sites More sharing options...
akosh Posted June 6, 2005 Author Share Posted June 6, 2005 Ok, once more. Link to comment Share on other sites More sharing options...
TerryK Posted June 8, 2005 Share Posted June 8, 2005 What is the width of your right column? Add up the width of the two button images and see whether they exceed it. If the combined width of the two buttons exceeds your column table width, they will be forced to display one underneath the other instead of side by side. In that case, either increase your table width, or decrease the size of the buttons. HTH, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. * Link to comment Share on other sites More sharing options...
akosh Posted June 8, 2005 Author Share Posted June 8, 2005 What is the width of your right column? Add up the width of the two button images and see whether they exceed it. If the combined width of the two buttons exceeds your column table width, they will be forced to display one underneath the other instead of side by side. In that case, either increase your table width, or decrease the size of the buttons. HTH, Terry <{POST_SNAPBACK}> I don't think that's the problem. As you can see in the screenshot I posted, there is more than enough room for both of them. Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 8, 2005 Share Posted June 8, 2005 I don't think that's the problem. As you can see in the screenshot I posted, there is more than enough room for both of them. <{POST_SNAPBACK}> Maybe only one px is missing if you add up buttons and padding. I'd make one button smaller by 5px, then you'll know. :-) Monika :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
akosh Posted June 8, 2005 Author Share Posted June 8, 2005 Maybe only one px is missing if you add up buttons and padding. I'd make one button smaller by 5px, then you'll know. :-) Monika <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 9, 2005 Share Posted June 9, 2005 <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <?PHP $shoppingcarttext = ''; if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $shoppingcarttext .= '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image_button('button_view_cart_shopping_cart.gif', IMAGE_BUTTON_VIEW_CART_SHOPPING_CART) . '</a>');} if ( ($cart->count_contents() > 0) && ( basename($PHP_SELF) != FILENAME_SHOPPING_CART) && (basename($PHP_SELF) != FILENAME_CHECKOUT_SHIPPING) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_PAYMENT) && ( basename($PHP_SELF) != FILENAME_CHECKOUT_CONFIRMATION) ) { $shoppingcarttext .= '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout_shopping_cart.gif', IMAGE_BUTTON_CHECKOUT_SHOPPING_CART) . '</a>');} ?> <td align="center" valign="middle"><?php $info_box_contents[] = array('text' => $shoppingcarttext); ?></td> </tr> </table> <?PHP new infoBox($info_box_contents); ?> </td> </tr> <!-- shopping_cart_eof //--> :-) Monika :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted June 9, 2005 Share Posted June 9, 2005 calling $info_box_contents twice makes for a new line being created HTH Monika :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.