first commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
{use_stylesheet src="appProductAttributesPlugin.css"}
|
||||
|
||||
<div id="pa_attributes">
|
||||
<h3>{$label}</h3>
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
{foreach from=$attributes key=id item=attribute}
|
||||
{if $attribute.type != 'B' && (!isset($variants[$id]) || empty($variants[$id]))}
|
||||
{php}continue{/php}
|
||||
{/if}
|
||||
<tr>
|
||||
<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="pa_color" title="{$variant.name}">
|
||||
<span style="{if $variant.type == 'C'}background-color: #{$variant.value}{else}background-image: url(/{$variant.value}){/if}"></span>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
{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,105 @@
|
||||
{use_stylesheet src="appProductAttributesPlugin.css"}
|
||||
|
||||
<div id="pa_product_filter" class="box roundies">
|
||||
<form action="{$filter_url}" method="post">
|
||||
<ul>
|
||||
{foreach from=$attributes key=id item=attribute}
|
||||
{if !isset($variants[$id]) || empty($variants[$id])}
|
||||
{php}continue{/php}
|
||||
{/if}
|
||||
<li class="pa_filter pa_filter_{$attribute.type}">
|
||||
<div class="pa_title">{$attribute.name}</div>
|
||||
|
||||
<div class="pa_variants">
|
||||
<ul>
|
||||
{if $attribute.type == 'B'}
|
||||
{foreach from=`$variants[$id]` key=vid item=variant}
|
||||
<li>
|
||||
<input type="checkbox" id="app_product_filter_{$id}_{$vid}" name="app_product_filter[{$id}][{$vid}]" value="{$vid}"{if isset($selected[$vid])} checked="checked"{/if} />
|
||||
<label for="app_product_filter_{$id}_{$vid}">{__ text="Tak"}</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
{elseif $attribute.type == 'C'}
|
||||
{foreach from=`$variants[$id]` key=vid item=variant}
|
||||
<li title="{$variant.name}" class="pa_color{if isset($selected[$vid])} pa_selected{/if}">
|
||||
<button style="{if $variant.type == 'C'}background-color: #{$variant.value}{else}background-image: url(/{$variant.value}){/if}" value="{$id}:{$vid}" type="button"></button>
|
||||
{if isset($selected[$vid])}
|
||||
<input type="hidden" name="app_product_filter[{$id}][{$vid}]" value="{$vid}" />
|
||||
{/if}
|
||||
</li>
|
||||
{/foreach}
|
||||
{else}
|
||||
{foreach from=`$variants[$id]` key=vid item=variant}
|
||||
<li>
|
||||
<input type="checkbox" id="app_product_filter_{$id}_{$vid}" name="app_product_filter[{$id}][{$vid}]" value="{$vid}"{if isset($selected[$vid])} checked="checked"{/if} />
|
||||
<label for="app_product_filter_{$id}_{$vid}">{$variant.value}</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</ul>
|
||||
{if $attribute.type == 'C'}
|
||||
<div class="clear"></div>
|
||||
{/if}
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{if !empty($selected)}
|
||||
<div class="pa_clear"><a href="{$reset_url}?filter=attr">{__ text="wyczyść"}</a></div>
|
||||
{/if}
|
||||
</form>
|
||||
<div class="tooltip roundies"></div>
|
||||
</div>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(function($) {
|
||||
var form = $('#pa_product_filter > form');
|
||||
|
||||
form.find('.pa_color').tooltip({
|
||||
tip: '#pa_product_filter .tooltip',
|
||||
position: 'center right',
|
||||
offset: [0, 8],
|
||||
delay: 0
|
||||
});
|
||||
|
||||
function preload() {
|
||||
{/literal}
|
||||
var image = '{image_path image="loading.gif"}';
|
||||
{literal}
|
||||
var height = form.height();
|
||||
|
||||
var width = form.width() - 1;
|
||||
|
||||
form.before('<div id="pa_product_filter_preloader" style="height: '+height+'px; width: '+width+'px; background-image: url('+image+')"></div>');
|
||||
}
|
||||
|
||||
form.find('.pa_variants button').click(function() {
|
||||
var button = $(this);
|
||||
|
||||
var parent = button.parent();
|
||||
|
||||
parent.toggleClass('pa_selected');
|
||||
|
||||
if (parent.hasClass('pa_selected')) {
|
||||
var value = button.attr('value').split(':');
|
||||
button.after('<input type="hidden" value="'+value[1]+'" name="app_product_filter['+value[0]+']['+value[1]+']" />');
|
||||
} else {
|
||||
button.next('input').remove();
|
||||
}
|
||||
|
||||
form.submit();
|
||||
});
|
||||
|
||||
form.find('.pa_variants input').click(function() {
|
||||
form.submit();
|
||||
});
|
||||
|
||||
form.submit(preload);
|
||||
|
||||
form.find('.pa_clear a').click(preload);
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -0,0 +1,42 @@
|
||||
{use_stylesheet src="appProductAttributesPlugin.css"}
|
||||
<div id="pa_attributes">
|
||||
<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="pa_color" title="{$variant.name}" style="{if $variant.type == 'C'}background-color: #{$variant.value}{else}background-image: url(/{$variant.value}){/if}"></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,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