Post by cashfile » Fri Jun 17, 2011 2:39 am

Please help me - add attribute options and add to cart to products in related field of product.tpl.
I haven't do functionally this buttons. They are viewed but not working.

OCart v1.5
This is current code releated part

Code: Select all

<form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="product">
              <?php if ($options) { ?>
              <div style="">
                <table style="width: 100%;">
                  <?php foreach ($options as $option) { ?>
                  <tr>
                    <td><?php echo $option['name']; ?>:</td>
                    <td>
                      <select style="width:100%;" name="option[<?php echo $option['option_id']; ?>]">
                        <?php foreach ($option['option_value'] as $option_value) { ?>
                        <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
                        <?php if ($option_value['price']) { ?>
                        <?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
                        <?php } ?>
                        </option>
                        <?php } ?>
                      </select></td>
                  </tr>
                  <?php } ?>
                </table>
              </div>
              <?php } ?>
              <?php if ($display_price) { ?>
              <?php if ($discounts) { ?>
              <b><?php echo $text_discount; ?></b><br />
              <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
                <table style="width: 100%;">
                  <tr>
                    <td style="text-align: right;"><b><?php echo $text_order_quantity; ?></b></td>
                    <td style="text-align: right;"><b><?php echo $text_price_per_item; ?></b></td>
                  </tr>
                  <?php foreach ($discounts as $discount) { ?>
                  <tr>
                    <td style="text-align: right;"><?php echo $discount['quantity']; ?></td>
                    <td style="text-align: right;"><?php echo $discount['price']; ?></td>
                  </tr>
                  <?php } ?>
                </table>
              </div>
              <?php } ?>
              <?php } ?>
              <div class="">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
               <tr>
                <td><?php echo $text_qty; ?>
                <input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" /></td>
                <td><a class="prod_buy1" onclick="$('#product').submit();" id="add_to_cart" title="<?php echo $button_add_to_cart; ?>">Добавить в корзину</a></td>
               </tr>
              </table>
              </div>
                <?php if ($minimum > 1) { ?><br/><small><?php echo $text_minimum; ?></small><?php } ?>
              <div>
                <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
                <input type="hidden" name="redirect" value="<?php echo str_replace('&', '&', $redirect); ?>" />                
              </div>
            </form>
SITE FOR EXAMPLE

Newbie

Posts

Joined
Fri Jan 22, 2010 6:39 am

Post by cashfile » Tue Jun 21, 2011 3:25 am

Anyboby can help me ?? ???

Newbie

Posts

Joined
Fri Jan 22, 2010 6:39 am
Who is online

Users browsing this forum: Semrush [Bot] and 53 guests