Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

price code


njtermite

Recommended Posts

Hello,

I'm trying to modify my price so that all I need to do is enter the retail cost then select the manufacturers discount, and my mark-up to get my default price. For some reason its not inserting the default price into the database that my formula creates. Does anyone see anything wrong with my code?

 

categories.php

<td class="main"><?php echo 'Product Retail Price'; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_default_price', $pInfo->products_default_price); ?></td>
	  </tr>



<tr>

		<td class="main">
		<?php echo 'Manufacturer\'s Discount'; ?>
		<br><br></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?>
		<select size="1" name="manufacturer_discount">
					<option selected><?php echo $product['manufacturer_discount'] ?></option>
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
<option>32</option>
<option>33</option>
<option>34</option>
<option>35</option>
<option>36</option>
<option>37</option>
<option>38</option>
<option>39</option>
<option>40</option>
<option>41</option>
<option>42</option>
<option>43</option>
<option>44</option>
<option>45</option>
<option>46</option>
<option>47</option>
<option>48</option>
<option>49</option>
<option>50</option>
<option>51</option>
<option>52</option>
<option>53</option>
<option>54</option>
<option>55</option>
<option>56</option>
<option>57</option>
<option>58</option>
<option>59</option>
<option>60</option>
<option>61</option>
<option>62</option>
<option>63</option>
<option>64</option>
<option>65</option>
<option>66</option>
<option>67</option>
<option>68</option>
<option>69</option>
<option>70</option>
<option>71</option>
<option>72</option>
<option>73</option>
<option>74</option>
<option>75</option>
<option>76</option>
<option>77</option>
<option>78</option>
<option>79</option>
<option>80</option>
<option>81</option>
<option>82</option>
<option>83</option>
<option>84</option>
<option>85</option>
<option>86</option>
<option>87</option>
<option>88</option>
<option>89</option>
<option>90</option>
<option>91</option>
<option>92</option>
<option>93</option>
<option>94</option>
<option>95</option>
<option>96</option>
<option>97</option>
<option>98</option>
<option>99</option>
<option>100</option>
 </select>


		</td>
	  </tr>


<tr>
		<td class="main"><?php echo 'Product Cost'; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('product_cost', $pInfo->product_cost); ?></td>
	  </tr>


<tr>
		<td class="main"><?php echo 'the Dental Dimension Mark-Up'; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?>
		<select size="1" name="dd_markup">
		<option selected><?php echo $product['dd_markup'] ?></option>
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
<option>32</option>
<option>33</option>
<option>34</option>
<option>35</option>
<option>36</option>
<option>37</option>
<option>38</option>
<option>39</option>
<option>40</option>
<option>41</option>
<option>42</option>
<option>43</option>
<option>44</option>
<option>45</option>
<option>46</option>
<option>47</option>
<option>48</option>
<option>49</option>
<option>50</option>
<option>51</option>
<option>52</option>
<option>53</option>
<option>54</option>
<option>55</option>
<option>56</option>
<option>57</option>
<option>58</option>
<option>59</option>
<option>60</option>
<option>61</option>
<option>62</option>
<option>63</option>
<option>64</option>
<option>65</option>
<option>66</option>
<option>67</option>
<option>68</option>
<option>69</option>
<option>70</option>
<option>71</option>
<option>72</option>
<option>73</option>
<option>74</option>
<option>75</option>
<option>76</option>
<option>77</option>
<option>78</option>
<option>79</option>
<option>80</option>
<option>81</option>
<option>82</option>
<option>83</option>
<option>84</option>
<option>85</option>
<option>86</option>
<option>87</option>
<option>88</option>
<option>89</option>
<option>90</option>
<option>91</option>
<option>92</option>
<option>93</option>
<option>94</option>
<option>95</option>
<option>96</option>
<option>97</option>
<option>98</option>
<option>99</option>
<option>100</option>
 </select>


		</td>
	  </tr>


<tr><td>
<?php
$products_default_price = $products_default_price;
echo 'defualt: ' . $products_default_price;
$retail_price = $products_default_price;
$off_retail = '.' . $manufacturer_discount;

$markup = '.' . $dd_markup;
echo 'markup: ' . $markup;
echo 'retail price: ' . $retail_price . '<br>';

$total1 = $retail_price * $off_retail;
$our_cost = $retail_price - $total1;
echo 'our cost: ' . $our_cost . '<br>';

$total2 = $our_cost * $markup;
$offer_price = $our_cost + $total2;
$products_price = $offer_price;
echo 'offer price: ' . $offer_price;
?>
</tr>
</td>

	   <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>

	  <tr bgcolor="#ebebff">
		<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>

	  </tr>
<tr bgcolor="#ebebff">
		<td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>
	  </tr>
<?php
		  $products_price = $offer_price;
	  ?>
	  <tr bgcolor="#ebebff">
		<td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>
	  </tr>
	  <tr>





		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
<script language="javascript"><!--
updateGross();
//--></script>

 

Thanks,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...