first commit
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
{use_stylesheet src="appProductAttributesPlugin.css"}
|
||||
|
||||
<div id="pa_attributes">
|
||||
<h3>{$label}</h3>
|
||||
<table class="table table-striped">
|
||||
{foreach from=$attributes key=id item=attribute}
|
||||
{if $attribute.type != 'B' && (!isset($variants[$id]) || empty($variants[$id]))}
|
||||
{php}continue{/php}
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="label_td">{$attribute.name}:</td>
|
||||
<td>
|
||||
{if $attribute.type == 'B'}
|
||||
{if isset($variants[$id])}{__ text="Tak"}{else}{__ text="Nie"}{/if}
|
||||
{elseif $attribute.type == 'C'}
|
||||
<ul class="pa_variants">
|
||||
{foreach from=`$variants[$id]` item=variant}
|
||||
<li class="colors-filter">
|
||||
<button title="{$variant.name}" style="{if $variant.type == 'C'}background-color: #{$variant.value}{else}background-image: url(/{$variant.value}){/if}" data-color="hex-#{$variant.value}"></button>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
{pa_text_variants variants=$variants[$id]}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
<div class="tooltip roundies"></div>
|
||||
</div>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(function($) {
|
||||
$('#pa_attributes .pa_color').tooltip({
|
||||
tip: '#pa_attributes .tooltip',
|
||||
position: 'center right',
|
||||
offset: [0, 8],
|
||||
delay: 0
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -0,0 +1,73 @@
|
||||
<form class="product-attribute-filter-container filter-left" action="{urlfor internal='@stProduct?action=filter'}?category_id={$category->getId()}" method="post">
|
||||
<input type="hidden" name="type" value="attr" />
|
||||
{foreach from=$attributes key=id item=attribute}
|
||||
{if !isset($variants[$id]) || empty($variants[$id])}
|
||||
{php}continue{/php}
|
||||
{/if}
|
||||
<div class="filter-title">{$attribute.name}</div>
|
||||
|
||||
{if $attribute.type == 'B'}
|
||||
{foreach from=`$variants[$id]` key=vid item=variant}
|
||||
<div class="form-group boolean-filter">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="app_product_filter[{$id}][{$vid}]" value="{$vid}" {if isset($selected[$vid])}checked{/if} />
|
||||
{__ text="Tak"}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{elseif $attribute.type == 'C'}
|
||||
<div class="form-group colors-filter clearfix">
|
||||
{foreach from=`$variants[$id]` key=vid item=variant}
|
||||
<span class="colors-filter-item">
|
||||
<button class="btn btn-default{if isset($selected[$vid])} active{/if}" style="{if $variant.type == 'C'}background-color: #{$variant.value}{else}background-image: url(/{$variant.value}){/if}"type="button" data-color="hex-#{$variant.value}"></button>
|
||||
<input class="sr-only" type="checkbox" name="app_product_filter[{$id}][{$vid}]" value="{$vid}" {if isset($selected[$vid])}checked{/if} />
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
{else}
|
||||
{foreach from=`$variants[$id]` key=vid item=variant}
|
||||
<div class="form-group text-filter">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="app_product_filter[{$id}][{$vid}]" value="{$vid}" {if isset($selected[$vid])}checked{/if} />
|
||||
{$variant.value}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{if $filters[$id]}
|
||||
<div class="clearfix"><a href="{$reset_url}?filter={$id}" class="pull-right reset">{__ text="wyczyść"} <span class="clear-value"></span></a></div>
|
||||
{/if}
|
||||
|
||||
{/foreach}
|
||||
</form>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(function($) {
|
||||
$(document).ready(function() {
|
||||
$('.product-attribute-filter-container').each(function() {
|
||||
var $this = $(this);
|
||||
|
||||
if (!$this.data('initialized')) {
|
||||
$this.data('initialized', true);
|
||||
$this.on('click', '.colors-filter button', function() {
|
||||
var btn = $(this);
|
||||
btn.toggleClass('active').next().click();
|
||||
})
|
||||
.on('change', 'input', function() {
|
||||
$(this).closest('form').submit();
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
{/literal}
|
||||
Reference in New Issue
Block a user