Jump to content
Sign in to follow this  
Falcosha777

Фильтр продуктов в категории, подправить

Recommended Posts

Скажите пожалуйста, как сделать списком что бы выводилось в коде, что ниже я разместил, я его уже правил, списком выводится, только вот когда жмёшь допустим BMW, выводит товар который и нужен, а жмёшь потом на Acura, выводит товар с фильтра BMW и с Acura. - Модуль я ниже разместил ссылку, называется Фильтр товара в категории.

<div class="box-content">
	<form id="filters">
	  <?php foreach ($category_options as $category_option) { ?>
		<b><?php echo $category_option['name']; ?></b>
		<div class="filter-item">
		<select>  
		<?php if ($category_option['values']) { ?>
		  <?php foreach ($category_option['values'] as $value) { ?>
			<?php if (in_array($value['value_id'], $filter_values_id)) { ?>
			  <option value="values" onclick="window.location='<?php echo $value['href']; ?>'" ><a href="<?php echo $value['href']; ?>"><?php echo $value['name']; ?></a></option>
			<?php } else { ?>
			  <?php if ($value['products']) { ?>
				 <option value="values" onclick="window.location='<?php echo $value['href']; ?>'"><a href="<?php echo $value['href']; ?>"><?php echo $value['name']; ?></a> (<?php echo $value['products']; ?>)</option>
			  <?php } else { ?>
				<option value="values" disabled="disabled"><span class="grey"><?php echo $value['name']; ?> (<?php echo $value['products']; ?>)</span></option>
			  <?php } ?>
			<?php } ?>
		  <?php } ?>
		<?php } ?>
		</select>
		</div>
	  <?php } ?>
	</form>
  </div>

Вот оригинальный код, без моей правки:

<div class="box-content">
    <form id="filters">
	  <?php foreach ($category_options as $category_option) { ?>
	    <b><?php echo $category_option['name']; ?></b>
	    <div class="filter-item">
	    <?php if ($category_option['values']) { ?>
		  <?php foreach ($category_option['values'] as $value) { ?>
		    <?php if (in_array($value['value_id'], $filter_values_id)) { ?>
			  <label class="active"><input type="checkbox" onclick="window.location='<?php echo $value['href']; ?>'" checked="checked"><a href="<?php echo $value['href']; ?>"><?php echo $value['name']; ?></a></label>
		    <?php } else { ?>
			  <?php if ($value['products']) { ?>
			    <label><input type="checkbox" onclick="window.location='<?php echo $value['href']; ?>'"><a href="<?php echo $value['href']; ?>"><?php echo $value['name']; ?></a> (<?php echo $value['products']; ?>)</label>
			  <?php } else { ?>
			    <label><input type="checkbox" disabled="disabled"><span class="grey"><?php echo $value['name']; ?> (<?php echo $value['products']; ?>)</span></label>
			  <?php } ?>
		    <?php } ?>
		  <?php } ?>
	    <?php } ?>
	    </div>
	  <?php } ?>
    </form>
  </div>

Помогите пожалуйста.

Сам модуль:

http://opencartforum...&attach_id=2133

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.