Jump to content
Sign in to follow this  
jetlex

Выбор количества на главной странице

Recommended Posts

На главной странице выводится одна категория посредством данного модуля Категории на главной

Для выпадающего списка выбора количества использую это 

Помогите вывести выбор количества тут(catalog\view\theme\моя тема\template\module\модуль_категории на главной.tpl) 

<?php
if (isset($w_categories)) {
	foreach ($w_categories as $w_category) {
?>
<?php if (isset($w_category["products"])) { ?>
<div class="box">
  <div class="box-heading"><a href="<?php echo $w_category["href"]; ?>"><?php echo $w_category["heading_title"]; ?></a></div>
  <div class="box-content">
    <div class="box-product">
      <?php foreach ($w_category["products"] as $product) { ?>
      <div>
        <?php if ($product['thumb']) { ?>
        <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
        <?php } ?>
        <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></br></a><?php echo $product['selunit']; ?></div>
        <?php if ($product['price']) { ?>
        <div class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
          <?php } ?>
        </div>
        <?php } ?>
        <?php if ($product['rating']) { ?>
        <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
        <?php } ?>
		
		
        <div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
		</div>
      </div> 
      <?php } ?>
    </div>
  </div>
</div>
<?php } ?>

<?php
	} // foreach ($w_categories as $w_category) {
} // if (isset($w_categories)) {
?>

как рядом с корзиной вставить выбор количества всплывающим списком?

в product.tpl он выводится так

<div class="cart">
        <div><?php echo $text_qty; ?>
           <!-- Quantity Set -->
                <?php if($quantity_set) { ?>
                <?php sort($quantity_set); ?>
                <select name="quantity">
                <?php foreach ($quantity_set as $q) { ?>
                  <option value="<?php echo $q; ?>"><?php echo $q; ?></option>
                <?php } ?>
                </select>
                <?php } else { ?>
                <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
                <?php } ?>
                <!-- end QS -->
          <!-- <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" /> -->
          <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
           
          <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
          
        </div>
        <?php if ($minimum > 1) { ?>
        <div class="minimum"><?php echo $text_minimum; ?></div>
        <?php } ?>
      </div>
      <?php if ($review_status) { ?>
        <?php if ($minimum > 1) { ?>
          <div class="minimum"><?php echo $text_minimum; ?></div>
        <?php } ?>
        <?php if ($price) { ?>
      <div class="price-other"><?php //echo $text_price; ?>
     
        <?php if ($tax) { ?>
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
        <?php } ?>
        <?php if ($points) { ?>
        <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span><br />
        <?php } ?>

post-676777-0-61354400-1392811828_thumb.jpg

Share this post


Link to post
Share on other sites

Вопрос решен.  Если кому интересно, вот мой код

<div class="cart">
		<select value="1" class="item-<?php echo $product['product_id']; ?>"  <option value="<?php echo $minimum; ?>"><?php echo $minimum; ?></option>  <option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>		</select>
		
<input type="button" value="<?php echo $button_cart; ?>" onclick="addQtyToCart('<?php echo $product['product_id']; ?>');" class="button" />


		</div>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.