Jump to content

avu

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by avu

  1. Why dos the <strong>300.00 ฿</strong> not go to the right border and why is it up 2 mm from the rest of the line text? this it the HTML output <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr style="float:left;"> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "> <td><a href="http://xxxx.com/product_info.php?products_id=29{1}2"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb7" type="submit">Update</button></span><script type="text/javascript">$("#tdb7").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script> <input type="text" name="cart_quantity[]" value="1" size="2" /><input type="hidden" name="products_id[]" value="29{1}2" /> 02 Orange Yellow <a href="http://xxxx.com/product_info.php?products_id=29{1}2"> <strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li style="float:right;width:0%;}" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>300.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr style="float:left;"> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "> <td><a href="http://xxxx.com/product_info.php?products_id=29{1}3"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb8" type="submit">Update</button></span><script type="text/javascript">$("#tdb8").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script> <input type="text" name="cart_quantity[]" value="2" size="2" /><input type="hidden" name="products_id[]" value="29{1}3" /> 03 Orange <a href="http://xxxx.com/product_info.php?products_id=29{1}3"> <strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li style="float:right;width:0%;}" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>300.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr style="float:left;"> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "> <td><a href="http://xxxx.com/product_info.php?products_id=29{1}4"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb9" type="submit">Update</button></span><script type="text/javascript">$("#tdb9").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script> <input type="text" name="cart_quantity[]" value="3" size="2" /><input type="hidden" name="products_id[]" value="29{1}4" /> 04 Parstel Pink <a href="http://xxxx.com/product_info.php?products_id=29{1}4"> <strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li style="float:right;width:0%;}" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>300.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr style="float:left;"> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "> <td><a href="http://xxxx.com/product_info.php?products_id=30"><img src="images/185.jpg" alt="20 CM Ball" title=" 20 CM Ball " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb10" type="submit">Update</button></span><script type="text/javascript">$("#tdb10").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script> <input type="text" name="cart_quantity[]" value="1" size="2" /><input type="hidden" name="products_id[]" value="30" /> </td></li> </tr></table></td> </tr> </table> This is the code <table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php for ($i=0, $n=sizeof($products); $i<$n; $i++) { echo ' <tr>'; $products_name = '<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;">' . ' <tr style="float:left;">' . ' <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . ' <td>' . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']); if (STOCK_CHECK == 'true') { $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']); if (tep_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= ' ' . '' . $products[$i][$option]['products_options_values_name'] . ' '; $products_name .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><strong>' . $products[$i]['name'] . '</strong></a></li>' . ' ' . '<li style="float:right;width:0%;}" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong>'; } } $products_name .= ' </td></li>' . ' </tr>' . '</table>'; echo ' <td valign="top">' . $products_name . '</td>' . ' </tr>'; } ?> </table> also product without attribute missing this code. So I need to make an if no attribute than this code $products_name .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><strong>' . $products[$i]['name'] . '</strong></a></li>' . ' ' . '<li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong>';
  2. It produces array 'total' => string '26' (length=2) also in the date base here are There are also products_attributes that contains products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix attributes_hide_from_groups
  3. I’m not sure what exactly you want to know or how to find it? In the database there are products_options that contains products_options_id, language_id, products_options_name And products_options_values that contains products_options_values_id, language_id, products_options_values_name, and this is the ones I like to spilt up after every15
  4. You got me thinking Actually I think that the $products_options_name is the option group and not the options. So with $products_attributes the new out put count all the option that in this case is 26 <?php if ($products_options_total['total'] == 1) { for($i=0;$i<$products_attributes['total'];$i++) { $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0"); $list_of_prdcts_attributes_id = ''; $products_options = array(); // makes sure this array is empty again while ($_products_options = tep_db_fetch_array($products_options_query)) { $products_options[] = $_products_options; $list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($products_options); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) { $products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') for ($n = 0 ; $n < count($products_options); $n++) { $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']); if ($products_options[$n]['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } // EOF SPPC attributes mod if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php $count = 0; $maxPerList = 15; echo '<ul><li><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "</li></ul>"; $total = count($products_attributes); $count = 1; echo "<ul>"; foreach($products_attributes as $currValue) { echo "<li>{$currValue}</li>"; if ($count % $maxPerList == 0 && $count != $total) { //Check if remainder is 0 or if it is the last product echo "</ul><ul>"; } $count++; } echo "</ul>"; } } // End of loop } the out put now is <ul><li><input type="text" name=0_quantity value="" style="text-align:right;" size="3">&#8194;<input type="hidden" name="0_id[1]" value="1" />01 Red</li></ul><ul><li>26</li></ul> <ul><li><input type="text" name=1_quantity value="" style="text-align:right;" size="3">&#8194;<input type="hidden" name="1_id[1]" value="2" />02 Orange Yellow</li></ul><ul><li>26</li></ul> <ul><li><input type="text" name=2_quantity value="" style="text-align:right;" size="3">&#8194;<input type="hidden" name="2_id[1]" value="3" />03 Orange</li></ul><ul><li>26</li></ul> <ul><li><input type="text" name=3_quantity value="" style="text-align:right;" size="3">&#8194;<input type="hidden" name="3_id[1]" value="4" />04 Parstel Pink</li></ul><ul><li>26</li></ul>
  5. This is the out put <ul><li><input type="text" name=0_quantity value="" style="text-align:right;" size="3">&#8194;<input type="hidden" name="0_id[1]" value="1" />01 Red</li></ul><ul><li>1</li><li>Color</li></ul> <ul><li><input type="text" name=1_quantity value="" style="text-align:right;" size="3">&#8194;<input type="hidden" name="1_id[1]" value="2" />02 Orange Yellow</li></ul><ul><li>1</li><li>Color</li></ul> <ul><li><input type="text" name=2_quantity value="" style="text-align:right;" size="3">&#8194;<input type="hidden" name="2_id[1]" value="3" />03 Orange</li></ul><ul><li>1</li><li>Color</li></ul>
  6. The $products_options_name is a color For each color are the name and a text felt to put quantity. I don’t get errors but the option name are now 2 line down from the text input felt and the line between there is a number “1” and it must be on same line
  7. What I want to do is show products_options 1-15 than split the listing so row 16-30 come in new column split again and show the next 15 products_options This code list in 3 line per product and do also not cut after 15. $count = 0; $maxPerList = 15; echo '<ul><li><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "</li></ul>"; $total = count($products_options_name); $count = 1; echo "<ul>"; foreach($products_options_name as $currValue) { echo "<li>{$currValue}</li>"; if ($count % $maxPerList == 0 && $count != $total) { //Check if remainder is 0 or if it is the last product echo "</ul><ul>"; } $count++; } echo "</ul>"; } }
  8. So this must be this part Now with out $count = 0; Can’t figure out if the $count++; has to be before, after or between the <ul><li> echo '<ul><li><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "</li></ul>"; foreach($products_options_name as $currValue) { if($count == $maxPerList) { echo "<ul>"; echo "<li>"; $count++; echo "</li>"; echo "</ul>"; } }
  9. Ok I got the formatting I think and hope. The tags ul and li now open and close. <?php if ($products_options_total['total'] == 1) { for($i=0;$i<$products_attributes['total'];$i++) { $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0"); $list_of_prdcts_attributes_id = ''; $products_options = array(); // makes sure this array is empty again while ($_products_options = tep_db_fetch_array($products_options_query)) { $products_options[] = $_products_options; $list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($products_options); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) { $products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') for ($n = 0 ; $n < count($products_options); $n++) { $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']); if ($products_options[$n]['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } // EOF SPPC attributes mod if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php $count = 0; $maxPerList = 15; echo '<ul><li><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "</li></ul>"; foreach($products_options_name as $currValue) { if($count == $maxPerList) { echo "<ul>"; echo "<li>"; $count = 0; echo "</li>"; $count++; echo "</ul>"; } } } }
  10. Sins my PHP/HTML knowledge are limit as well as my English are limit please explain in other words what you want I do so it is not incomplete, badly formatted example. When you said “badly formatted” I think you mean <ul style="list-style: none; padding-left: 0px; margin: 0px; "><li style="list-style: none; "> has to be in the CSS, let me know if I misunderstand? Because that is changed And when you sad “incomplete” you means the missing {} but there are the same numbers
  11. Hi Xyph not sure what you mean, is it this? <?php if ($products_options_total['total'] == 1) { for($i=0;$i<$products_attributes['total'];$i++) { $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0"); $list_of_prdcts_attributes_id = ''; $products_options = array(); // makes sure this array is empty again while ($_products_options = tep_db_fetch_array($products_options_query)) { $products_options[] = $_products_options; $list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($products_options); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) { $products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') for ($n = 0 ; $n < count($products_options); $n++) { $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']); if ($products_options[$n]['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } // EOF SPPC attributes mod if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php $count = 0; $maxPerList = 15; echo '<ul><li><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "<ul>"; foreach($products_options_name as $currValue) { if($count == $maxPerList) { echo "</ul>"; echo "<ul>"; echo "<li>"; $count = 0; } echo "</li>"; $count++; echo "</ul>"; }} } // End of loop }
  12. Sorry I mean the <li> here echo "</ul>"; echo "<ul>"; echo "<li>"; $count = 0; } echo "</li>"; $count++; echo "</ul>";
  13. Not sure where you want to place the <li> but I think this is the place. sorry for the missing } It dos not split up anything as intended yet. I think the problem is within this code <?php if ($products_options_total['total'] == 1) { for($i=0;$i<$products_attributes['total'];$i++) { $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0"); $list_of_prdcts_attributes_id = ''; $products_options = array(); // makes sure this array is empty again while ($_products_options = tep_db_fetch_array($products_options_query)) { $products_options[] = $_products_options; $list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($products_options); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) { $products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') for ($n = 0 ; $n < count($products_options); $n++) { $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']); if ($products_options[$n]['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } // EOF SPPC attributes mod if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php $count = 0; $maxPerList = 15; echo '<ul style="list-style: none; padding-left: 0px; margin: 0px; "><li style="list-style: none; "><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "<ul>"; foreach($products_options_name as $currValue) { if($count == $maxPerList) { echo "</ul>"; echo "<ul>"; $count = 0; } echo "<li>"; echo "</li>"; $count++; echo "</ul>"; }} } // End of loop }
  14. Why dos this loop not split up after 15 options? $count = 0; $maxPerList = 15; echo '<ul style="list-style: none; padding-left: 0px; margin: 0px; "><li style="list-style: none; "><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "<ul>"; foreach($products_options_name as $currValue) { if($count == $maxPerList) { echo "</ul>"; echo "<ul>"; $count = 0; } echo "</li>"; $count++; echo "</ul>"; all the file <?php /* $Id$ adapted for Separate Pricing Per Customer v4.2 2007/06/23 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); // BOF Separate Pricing per Customer if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } // EOF Separate Pricing per Customer require(DIR_WS_INCLUDES . 'template_top.php'); if ($product_check['total'] < 1) { ?> <div class="contentContainer"> <div class="contentText"> <?php echo TEXT_PRODUCT_NOT_FOUND; ?> </div> <div style="float: right;"> <?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?> </div> </div> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { // BOF Separate Pricing per Customer if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id = '" . $customer_group_id . "'"); if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) { $product_info['products_price']= $scustomer_group_price['customers_group_price']; } } // end if ($customer_group_id > 0) // EOF Separate Pricing per Customer $products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { // BOF Separate Pricing per Customer if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id = '" . $customer_group_id . "'"); if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) { $product_info['products_price']= $scustomer_group_price['customers_group_price']; } } // end if ($customer_group_id > 0) // EOF Separate Pricing per Customer $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br /><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?> <div> <style="float: right;"><?php echo $products_price; ?> <h1><?php echo $products_name; ?></h1> </div> <div class="contentContainer"> <div class="contentText"> <?php if (tep_not_null($product_info['products_image'])) { $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order"); if (tep_db_num_rows($pi_query) > 0) { ?> <div id="piGal" style="float: right;"> <ul> <?php $pi_counter = 0; while ($pi = tep_db_fetch_array($pi_query)) { $pi_counter++; $pi_entry = ' <li><a href="'; if (tep_not_null($pi['htmlcontent'])) { $pi_entry .= '#piGalimg_' . $pi_counter; } else { $pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image']); } $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $pi['image']) . '</a>'; if (tep_not_null($pi['htmlcontent'])) { $pi_entry .= '<div style="display: none;"><div id="piGalimg_' . $pi_counter . '">' . $pi['htmlcontent'] . '</div></div>'; } $pi_entry .= '</li>'; echo $pi_entry; } ?> </ul> </div> <script type="text/javascript"> $('#piGal ul').bxGallery({ maxwidth: 300, maxheight: 200, thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>, thumbcontainer: 300, load_image: 'ext/jquery/bxGallery/spinner.gif' }); </script> <?php } else { ?> <div id="piGal" style="float: right;"> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?> </div> <?php } ?> <script type="text/javascript"> $("#piGal a[rel^='fancybox']").fancybox({ cyclic: true }); </script> <?php } ?> <?php echo stripslashes($product_info['products_description']); ?> <?php // BOF SPPC Hide attributes from customer groups $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 "); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <p><?php echo TEXT_PRODUCT_OPTIONS; ?></p> <p> <!-- // Code segment includes/modified for Multiple product option lines. // maintainance and Qns : Harishyam :> feenix_666@yahoo.com --> <?php if ($products_options_total['total'] == 1) { for($i=0;$i<$products_attributes['total'];$i++) { $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0"); $list_of_prdcts_attributes_id = ''; $products_options = array(); // makes sure this array is empty again while ($_products_options = tep_db_fetch_array($products_options_query)) { $products_options[] = $_products_options; $list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($products_options); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) { $products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') for ($n = 0 ; $n < count($products_options); $n++) { $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']); if ($products_options[$n]['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } // EOF SPPC attributes mod if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php $count = 0; $maxPerList = 15; echo '<ul style="list-style: none; padding-left: 0px; margin: 0px; "><li style="list-style: none; "><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">&#8194;'; echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text']; echo "<ul>"; foreach($products_options_name as $currValue) { if($count == $maxPerList) { echo "</ul>"; echo "<ul>"; $count = 0; } echo "</li>"; $count++; echo "</ul>"; }} } // End of loop } else { //do your regular thing $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } } ?> <strong><?php echo $products_options_name['products_options_name'] . ':'; ?></strong><br /><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?><br /> <?php } ?> </p> <?php } ?> <div style="clear: both;"></div> <?php if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <p style="text-align: center;"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></p> <?php } ?> </div> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1"); $reviews = tep_db_fetch_array($reviews_query); ?> <div class="buttonSet"> <span class="buttonAction"><?php if ($products_options_total['total'] != 1) { echo 'Enter Quantity: ' . tep_draw_input_field('cart_quantity','1','size="3" style="text-align:right;"') . ' ' ; } ?> <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span> </div> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } ?> </div> </form> <?php } require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  15. Why does this button at the end of the file not add anything to the cart? <td align="right" class="main"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></td> <form name="cart_multi" method="post" action="<?php echo tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_multi', 'NONSSL'); ?>"> <script language=javascript> function changeValue(textObject,delta){ var myVal = parseInt(textObject.value); if (myVal == NaN) { myVal = 0; } else { myVal = myVal + delta; } /* check that it is not negetive */ if (myVal < 0) { myVal = 0; } textObject.value = myVal; return; } </script> <?php /* $Id$ adapted for Separate Pricing Per Customer v4.2 2007/08/23 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); ?> <div class="contentText"> <?php if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="right" class="main"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></td> </tr> </table> <br> <div> <span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span> <span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span> </div> <br /> <?php } $prod_list_contents = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header ui-corner-top infoBoxHeading">' . ' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingHeader">' . ' <tr>'; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = ''; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = ''; break; case 'PRODUCT_LIST_PRICE': $lc_text = TABLE_HEADING_PRICE; $lc_align = 'right'; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = TABLE_HEADING_QUANTITY; $lc_align = 'right'; break; case 'PRODUCT_LIST_MIN_ORDER_QTY': $lc_align = 'center'; $lc_text = ' ' . TABLE_HEADING_MIN_ORDER_QTY . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'right'; break; case 'PRODUCT_LIST_IMAGE': $lc_text = TABLE_HEADING_IMAGE; $lc_align = 'center'; break; case 'PRODUCT_LIST_BUY_NOW': $lc_text = TABLE_HEADING_BUY_NOW; $lc_align = 'center'; break; } if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text); } $prod_list_contents .= ' <td' . (tep_not_null($lc_align) ? ' align="' . $lc_align . '"' : '') . '>' . $lc_text . '</td>'; } $prod_list_contents .= ' </tr>' . ' </table>' . ' </div>'; if ($listing_split->number_of_rows > 0) { $rows = 0; $listing_query = tep_db_query($listing_split->sql_query); // BOF Separate Pricing per Customer $no_of_listings = tep_db_num_rows($listing_query); // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if(isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } while ($_listing = tep_db_fetch_array($listing_query)) { $listing[] = $_listing; $list_of_prdct_ids[] = $_listing['products_id']; } // next part is a debug feature, when uncommented it will print the info that this module receives /* echo '<pre>'; print_r($listing); echo '</pre>'; */ // get all product prices for products with the particular customer_group_id // however not necessary for customer_group_id = 0 if ($customer_group_id != '0') { $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "'"); // $no_of_pg_products = tep_db_num_rows($pg_query) ; while ($pg_array = tep_db_fetch_array($pg_query)) { $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '', 'final_price' => $pg_array['price']); } for ($x = 0; $x < $no_of_listings; $x++) { // replace products prices with those from customers_group table if(!empty($new_prices)) { for ($i = 0; $i < count($new_prices); $i++) { if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) { $listing[$x]['products_price'] = $new_prices[$i]['products_price']; $listing[$x]['final_price'] = $new_prices[$i]['final_price']; } } } // end if(!empty($new_prices) $listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group $listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price } // end for ($x = 0; $x < $no_of_listings; $x++) } // end if ($customer_group_id != '0') // an extra query is needed for all the specials $specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and status = '1' and customers_group_id = '" . $customer_group_id . "'"); while ($specials_array = tep_db_fetch_array($specials_query)) { $new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']); } // add the correct specials_new_products_price and replace final_price for ($x = 0; $x < $no_of_listings; $x++) { if(!empty($new_s_prices)) { for ($i = 0; $i < count($new_s_prices); $i++) { if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) { $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price']; $listing[$x]['final_price'] = $new_s_prices[$i]['final_price']; } } } // end if(!empty($new_s_prices) } // end for ($x = 0; $x < $no_of_listings; $x++) $prod_list_contents .= ' <div class="ui-widget-content ui-corner-bottom productListTable">' . ' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingData">'; // while ($listing = tep_db_fetch_array($listing_query)) { (was original code) for ($x = 0; $x < $no_of_listings; $x++) { $rows++; $prod_list_contents .= ' <tr>'; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $prod_list_contents .= ' <td>' . $listing[$x]['products_model'] . '</td>'; break; case 'PRODUCT_LIST_NAME': if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>'; } else { $prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a></td>'; break; case 'PRODUCT_LIST_PRICE': if (tep_not_null($listing[$x]['specials_new_products_price'])) { $prod_list_contents .= ' <td align="right"><del>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span></td>'; } else { $prod_list_contents .= ' <td align="right">' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</td>'; } break; case 'PRODUCT_LIST_QUANTITY': $prod_list_contents .= ' <td align="right">' . $listing[$x]['products_quantity'] . '</td>'; break; case 'PRODUCT_LIST_MIN_ORDER_QTY': $prod_list_contents .= ' <td align="right">' . $lc_text = ' ' . $listing[$x]['products_min_order_qty'] . ' '; break; case 'PRODUCT_LIST_WEIGHT': $prod_list_contents .= ' <td align="right">' . $listing[$x]['products_weight'] . '</td>'; break; case 'PRODUCT_LIST_IMAGE': if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>'; } else { $prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>'; } break; case 'PRODUCT_LIST_BUY_NOW': $prod_list_contents .= ' <td align="center">' . $lc_text = '<input type=button value=" -1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),-1);return false;"><input type="text" name="add_id['.$number_of_products.']" id="add_id_'.$listing[$x]['products_id'].'" value="0" size="3"><input type=button value="+1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),1);return false;">'; $lc_text .= '<input type="hidden" name="products_id['.$number_of_products.']" value="'.$listing[$x]['products_id'].'">'; break; } } $prod_list_contents .= ' </tr>'; } $prod_list_contents .= ' </table>' . ' </div>' . '</div>'; echo $prod_list_contents; } else { ?> <p><?php echo TEXT_NO_PRODUCTS; ?></p> <?php } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <br /> <div> <span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span> <span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span> </div> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="right" class="main"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></td> </tr> </table> </form> <?php } ?> </div>
  16. <div class="contentText"> <input type="hidden" name="id[29{1}1][1]" value="1" /> <input type="hidden" name="id[29{1}2][1]" value="2" /> <input type="hidden" name="id[29{1}3][1]" value="3" /> <input type="hidden" name="id[29{1}4][1]" value="4" /> <input type="hidden" name="id[29{1}5][1]" value="5" /> <input type="hidden" name="id[29{1}7][1]" value="7" /> <input type="hidden" name="id[29{1}8][1]" value="8" /> <input type="hidden" name="id[33{1}1][1]" value="1" /> <input type="hidden" name="id[33{1}2][1]" value="2" /> <input type="hidden" name="id[33{1}3][1]" value="3" /> <input type="hidden" name="id[33{1}4][1]" value="4" /> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "> <td><a href="http://xxxxxxx.com/product_info.php?products_id=29{1}1"> <img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb5" type="submit">Update</button></span> <script type="text/javascript">$("#tdb5").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="1" size="2" /> <input type="hidden" name="products_id[]" value="29{1}1" /> 01 Red <a href="http://xxxxxxx.com/product_info.php?products_id=29{1}1"> <strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>300.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "> <td><a href="http://xxxxxxx.com/product_info.php?products_id=29{1}2"> <img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb6" type="submit">Update</button></span> <script type="text/javascript">$("#tdb6").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="2" size="2" /> <input type="hidden" name="products_id[]" value="29{1}2" /> 02 Orange Yellow <a href="http://xxxxxxx.com/product_info.php?products_id=29{1}2"> <strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>600.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=29{1}3"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb7" type="submit">Update</button></span><script type="text/javascript">$("#tdb7").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="3" size="2" /><input type="hidden" name="products_id[]" value="29{1}3" /> 03 Orange <a href="http://xxxxxxx.com/product_info.php?products_id=29{1}3"><strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>900.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=29{1}4"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb8" type="submit">Update</button></span><script type="text/javascript">$("#tdb8").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="4" size="2" /><input type="hidden" name="products_id[]" value="29{1}4" /> 04 Parstel Pink <a href="http://xxxxxxx.com/product_info.php?products_id=29{1}4"><strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>1,200.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=29{1}5"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb9" type="submit">Update</button></span><script type="text/javascript">$("#tdb9").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="5" size="2" /><input type="hidden" name="products_id[]" value="29{1}5" /> 05 Light Burgundy <a href="http://xxxxxxx.com/product_info.php?products_id=29{1}5"><strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>1,500.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "> <td><a href="http://xxxxxxx.com/product_info.php?products_id=31"> <img src="images/185.jpg" alt="35 green light" title=" 35 green light " width="40" height="25" /></a></td> <td><span class="tdbLink"> <button id="tdb10" type="submit">Update</button></span> <script type="text/javascript">$("#tdb10").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="6" size="2" /> <input type="hidden" name="products_id[]" value="31" /> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=29{1}7"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb11" type="submit">Update</button></span><script type="text/javascript">$("#tdb11").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="7" size="2" /><input type="hidden" name="products_id[]" value="29{1}7" /> 07 Purple <a href="http://xxxxxxx.com/product_info.php?products_id=29{1}7"><strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>2,100.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=29{1}8"><img src="images/185.jpg" alt="Round Ball 18.5 cm (100 balls)" title=" Round Ball 18.5 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb12" type="submit">Update</button></span><script type="text/javascript">$("#tdb12").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="8" size="2" /><input type="hidden" name="products_id[]" value="29{1}8" /> 08 Strong Yellow <a href="http://xxxxxxx.com/product_info.php?products_id=29{1}8"><strong>Round Ball 18.5 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>2,400.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=32"><img src="images/185.jpg" alt="17 CM Ball" title=" 17 CM Ball " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb13" type="submit">Update</button></span><script type="text/javascript">$("#tdb13").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="9" size="2" /><input type="hidden" name="products_id[]" value="32" /> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=30"><img src="images/185.jpg" alt="20 CM Ball" title=" 20 CM Ball " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb14" type="submit">Update</button></span><script type="text/javascript">$("#tdb14").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="10" size="2" /><input type="hidden" name="products_id[]" value="30" /> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=33{1}1"><img src="images/185.jpg" alt="Round Ball 20 cm (100 balls)" title=" Round Ball 20 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb15" type="submit">Update</button></span><script type="text/javascript">$("#tdb15").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="2" size="2" /><input type="hidden" name="products_id[]" value="33{1}1" /> 01 Red <a href="http://xxxxxxx.com/product_info.php?products_id=33{1}1"><strong>Round Ball 20 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>800.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=33{1}2"><img src="images/185.jpg" alt="Round Ball 20 cm (100 balls)" title=" Round Ball 20 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb16" type="submit">Update</button></span><script type="text/javascript">$("#tdb16").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="3" size="2" /><input type="hidden" name="products_id[]" value="33{1}2" /> 02 Orange Yellow <a href="http://xxxxxxx.com/product_info.php?products_id=33{1}2"><strong>Round Ball 20 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>1,200.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=33{1}3"><img src="images/185.jpg" alt="Round Ball 20 cm (100 balls)" title=" Round Ball 20 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb17" type="submit">Update</button></span><script type="text/javascript">$("#tdb17").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="45" size="2" /><input type="hidden" name="products_id[]" value="33{1}3" /> 03 Orange <a href="http://xxxxxxx.com/product_info.php?products_id=33{1}3"><strong>Round Ball 20 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>18,000.00 ฿</strong> </td></li> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="http://xxxxxxx.com/product_info.php?products_id=33{1}4"><img src="images/185.jpg" alt="Round Ball 20 cm (100 balls)" title=" Round Ball 20 cm (100 balls) " width="40" height="25" /></a></td> <td><span class="tdbLink"><button id="tdb18" type="submit">Update</button></span><script type="text/javascript">$("#tdb18").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="6" size="2" /><input type="hidden" name="products_id[]" value="33{1}4" /> 04 Parstel Pink <a href="http://xxxxxxx.com/product_info.php?products_id=33{1}4"><strong>Round Ball 20 cm (100 balls)</strong></a></li> <li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>2,400.00 ฿</strong> </td></li> </tr></table></td> </tr> </table>
  17. Now I try online and the space between the image and the update button are different from line to line. another problem are the product with out attributes don’t show the following code $products_name .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><strong>' . $products[$i]['name'] . '</strong></a></li>' . '' . '<li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong>';
  18. Now I got just like i want it, thanks a lot for your help Haku This is what i did <table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php for ($i=0, $n=sizeof($products); $i<$n; $i++) { echo ' <tr>'; $products_name = '<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;">' . ' <tr>' . ' <li class="left" style="list-style: none; padding-left: 0px; margin: 0px; "><td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . ' <td>' . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']); if (STOCK_CHECK == 'true') { $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']); if (tep_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= ' ' . '' . $products[$i][$option]['products_options_values_name'] . ' '; $products_name .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><strong>' . $products[$i]['name'] . '</strong></a></li>' . ' ' . '<li class="right" style="list-style: none; padding-left: 0px; margin: 0px; "><strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong>'; } } $products_name .= ' </td></li>' . ' </tr>' . '</table>';
  19. Dos it help to show this? <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <p><td align="center"><a href="http://localhost/product_info.php?products_id=29{1}1"></a></td> <td align="center"><span class="tdbLink"><button id="tdb4" type="submit">Update</button></span><script type="text/javascript">$("#tdb4").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="1" size="2" /><input type="hidden" name="products_id[]" value="29{1}1" /> 01 Red <a href="http://localhost/product_info.php?products_id=29{1}1"><strong>Round Ball 18.5 cm (100 balls)</strong></a></p> <p class="right"><strong>300.00฿</strong> </td></p> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <p><td align="center"><a href="http://localhost/product_info.php?products_id=29{1}2"></a></td> <td align="center"><span class="tdbLink"><button id="tdb5" type="submit">Update</button></span><script type="text/javascript">$("#tdb5").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="2" size="2" /><input type="hidden" name="products_id[]" value="29{1}2" /> 02 Orange Yellow <a href="http://localhost/product_info.php?products_id=29{1}2"><strong>Round Ball 18.5 cm (100 balls)</strong></a></p> <p class="right"><strong>600.00฿</strong> </td></p> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <p><td align="center"><a href="http://localhost/product_info.php?products_id=29{1}3"></a></td> <td align="center"><span class="tdbLink"><button id="tdb6" type="submit">Update</button></span><script type="text/javascript">$("#tdb6").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="3" size="2" /><input type="hidden" name="products_id[]" value="29{1}3" /> 03 Orange <a href="http://localhost/product_info.php?products_id=29{1}3"><strong>Round Ball 18.5 cm (100 balls)</strong></a></p> <p class="right"><strong>900.00฿</strong> </td></p> </tr></table></td> </tr> <tr> <td valign="top"><table border="0" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;"> <tr> <p><td align="center"><a href="http://localhost/product_info.php?products_id=29{1}4"></a></td> <td align="center"><span class="tdbLink"><button id="tdb7" type="submit">Update</button></span><script type="text/javascript">$("#tdb7").button({icons:{primary:"ui-icon-refresh"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script><input type="text" name="cart_quantity[]" value="4" size="2" /><input type="hidden" name="products_id[]" value="29{1}4" /> 04 Parstel Pink <a href="http://localhost/product_info.php?products_id=29{1}4"><strong>Round Ball 18.5 cm (100 balls)</strong></a></p> <p class="right"><strong>1,200.00฿</strong> </td></p> </tr></table></td> </tr> </table>
  20. If do like this it now in 2 lines not 1, and it go only right to the end of the line about (the line that is text left side) not out to the table right side. <table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php for ($i=0, $n=sizeof($products); $i<$n; $i++) { echo ' <tr>'; $products_name = '<table border="0" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;">' . ' <tr>' . ' <p><td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']); if (STOCK_CHECK == 'true') { $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']); if (tep_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= ' ' . '' . $products[$i][$option]['products_options_values_name'] . ' '; $products_name .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><strong>' . $products[$i]['name'] . '</strong></a></p>' . ' ' . '<p class="right"><strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong>'; } } $products_name .= ' </td></p>' . ' </tr>' . '</table>';
  21. How to do that for this specific table and not all the others?
  22. Finally find out how to remove the space change the code to $products_name = '<table border="0" cellspacing="0" cellpadding="0" style="border:0px;padding:0.5px;margin:0px;">' . now just need to move the text to the right
  23. I like this part of the text to show on the right side. And the rest of the below code on the left. Also like to remove the space on 3mm between each line. '<strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong>'; <table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php for ($i=0, $n=sizeof($products); $i<$n; $i++) { echo ' <tr>'; $products_name = '<table border="0" cellspacing="0" cellpadding="0">' . ' <tr>' . ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']); if (STOCK_CHECK == 'true') { $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']); if (tep_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= ' ' . '' . $products[$i][$option]['products_options_values_name'] . ' '; $products_name .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><strong>' . $products[$i]['name'] . '</strong></a>' . ' ' . ' <strong>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</strong>'; } } $products_name .= ' </td>' . ' </tr>' . '</table>'; echo ' <td valign="top">' . $products_name . '</td>' . ' </tr>'; } ?> </table>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.