first commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
st_theme_use_stylesheet('stProductsComparePlugin.css');
|
||||
|
||||
$smarty->assign("compare_product", $compareProduct);
|
||||
if($compareProduct)
|
||||
{
|
||||
$smarty->assign("add_product_to_compare", content_tag('a', __("Dodaj produkt do porównania"), array('href' => '#', 'class' => 'compare_product_link add')));
|
||||
}
|
||||
else
|
||||
{
|
||||
$smarty->assign("delete_product_from_compare", content_tag('a', __("Usuń produkt z porównania"), array('href' => '#', 'class' => 'compare_product_link remove')));
|
||||
}
|
||||
|
||||
$smarty->assign("products_compare_array",$productsToCompareArray);
|
||||
|
||||
if($productsToCompareArray)
|
||||
{
|
||||
$smarty->assign("product_compare", link_to( __('Porównaj produkty', array()).' ('.count($productsToCompareArray).')', 'productsCompare', array() ));
|
||||
}
|
||||
$smarty->display("product_compare_button.html");
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(function($){
|
||||
$('.compare_product_link').click(function(event) {
|
||||
if ($(this).hasClass('add'))
|
||||
{
|
||||
$('#st_component-st_products_compare_plugin-product_compare').load('<?php echo url_for('productsCompare/addProductToCompare?id='.$productId) ?>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#st_component-st_products_compare_plugin-product_compare').load('<?php echo url_for('productsCompare/removeProductFromCompare?id='.$productId) ?>');
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$smarty->assign("compare_button_add",st_get_component('stProductsCompareFrontend', 'productCompareButton'));
|
||||
$smarty->display("product_compare_add_product.html");
|
||||
?>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
use_helper('stProductImage', 'stCurrency', 'stUrl');
|
||||
st_theme_use_stylesheet('stProductsComparePlugin.css');
|
||||
|
||||
$smarty->assign("products_compare", $productsWithoutTemplate);
|
||||
$smarty->assign("show_price", $showPrice);
|
||||
if($productsWithoutTemplateOn)
|
||||
{
|
||||
$results = array();
|
||||
foreach ($productsWithoutTemplate as $product)
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($product, 'thumb'), 'stProduct/show?id='.$product->getId());
|
||||
$row['delete'] = st_link_to(__('usuń'), 'productsCompare/removeProductInCompare?id='.$product->getId());
|
||||
$row['delete_link'] = st_url_for('productsCompare/removeProductInCompare?id='.$product->getId());
|
||||
$row['name'] = $product->getName();
|
||||
is_object($product->getProducer()) ? $row['producer'] = $product->getProducer()->getName() : $row['producer'] = '-';
|
||||
$row['price_netto'] = $product->getPriceNetto(true);
|
||||
$row['price_brutto'] = $product->getPriceBrutto(true);
|
||||
$row['hide_price'] = $product->getHidePrice();
|
||||
$row['vat'] = $product->getVat();
|
||||
$row['instance'] = $product;
|
||||
$results[] = $row;
|
||||
}
|
||||
$smarty->assign('results', $results);
|
||||
}
|
||||
$smarty->assign("hasLastViewedProduct", $hasLastViewedProduct);
|
||||
$smarty->assign("lastViewedProduct", st_link_to(__('Wróć do ostatnio oglądanego produktu'), $lastViewedProduct['link']));
|
||||
$smarty->assign("last_viewed_link", st_url_for($lastViewedProduct['link']));
|
||||
$smarty->display('product_compare_index.html');
|
||||
?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$smarty->assign("compare_button_remove",st_get_component('stProductsCompareFrontend', 'productCompareButton'));
|
||||
$smarty->display("product_compare_remove_product.html");
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
{$compare_button_add}
|
||||
@@ -0,0 +1,13 @@
|
||||
<div id="st_component-st_products_compare_plugin-product_compare">
|
||||
{if $compare_product}
|
||||
<div id="st_button-product_compare_add" style="overflow:hidden;">
|
||||
{$add_product_to_compare}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $products_compare_array}
|
||||
<div id="st_button-product_compare_run">
|
||||
{$product_compare}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,84 @@
|
||||
{if $products_compare}
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center" id="photo_first"></td>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td align="center" id="photo">
|
||||
<div id="box_photo">
|
||||
{$product.photo}
|
||||
</div>
|
||||
<div id="button_del">
|
||||
<div id="button_del_middle">
|
||||
<div id="button_del_right">
|
||||
{$product.delete}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr onmouseover="this.style.background='#f7f7f7'" onmouseout="this.style.background='#ffffff'">
|
||||
<td class="name">{__ text="Nazwa"}:</td>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value">
|
||||
{$product.name}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr onmouseover="this.style.background='#f7f7f7'" onmouseout="this.style.background='#ffffff'">
|
||||
<td class="name">{__ text="Producent"}:</td>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value">
|
||||
{$product.producer}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
{if $show_price}
|
||||
<tr onmouseover="this.style.background='#f7f7f7'" onmouseout="this.style.background='#ffffff'">
|
||||
<td class="name">{__ text="Cena netto"}:</td>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value">
|
||||
{if !$product.hide_price}
|
||||
{$product.price_netto}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr onmouseover="this.style.background='#f7f7f7'" onmouseout="this.style.background='#ffffff'">
|
||||
<td class="name">{__ text="Cena brutto"}:</td>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value">
|
||||
{if !$product.hide_price}
|
||||
{$product.price_brutto}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr onmouseover="this.style.background='#f7f7f7'" onmouseout="this.style.background='#ffffff'">
|
||||
<td class="name">{__ text="VAT"}:</td>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value">
|
||||
{if !$product.hide_price}
|
||||
{$product.vat}%
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
{else}
|
||||
<h2>{__ text="Brak produktów do porównania."}</h2>
|
||||
{if $hasLastViewedProduct}
|
||||
<div id="st_product_compare-back_button" class="st_button st_align-left">
|
||||
<div class="st_button-left">
|
||||
{$lastViewedProduct}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -0,0 +1 @@
|
||||
{$compare_button_remove}
|
||||
@@ -0,0 +1 @@
|
||||
{$compare_button_add}
|
||||
@@ -0,0 +1,13 @@
|
||||
<div id="st_component-st_products_compare_plugin-product_compare">
|
||||
{if $compare_product}
|
||||
<div id="st_button-product_compare_add" style="overflow:hidden;">
|
||||
{$add_product_to_compare}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $products_compare_array}
|
||||
<div id="st_button-product_compare_run">
|
||||
{$product_compare}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,145 @@
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
jQuery(function ($)
|
||||
{
|
||||
function equalHeight(group)
|
||||
{
|
||||
tallest = 0;
|
||||
group.each(function() {
|
||||
$(this).css("height","auto");
|
||||
thisHeight = $(this).height();
|
||||
if(thisHeight > tallest) {
|
||||
tallest = thisHeight+16;
|
||||
}
|
||||
});
|
||||
group.height(tallest);
|
||||
}
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_name"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_producer"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .tr_price_netto"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_price_brutto"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_vat"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
{set layout="one_column_layout"}
|
||||
<div id="product_compare_index" class="box roundies">
|
||||
<div class="title">
|
||||
<h2>{__ text="Porównaj produkty"}</h2>
|
||||
</div>
|
||||
{if $products_compare}
|
||||
<div id="products_compare_table_params">
|
||||
<table id="products_compare">
|
||||
<tr>
|
||||
<td id="photo_first"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_name">{__ text="Nazwa"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_producer">{__ text="Producent"}</td>
|
||||
</tr>
|
||||
{if $show_price}
|
||||
<tr>
|
||||
<td class="name tr_price_netto">{__ text="Cena netto"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_price_brutto">{__ text="Cena brutto"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_vat">{__ text="VAT"}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
<div id="products_compare_table_values">
|
||||
<table id="products_compare">
|
||||
<tr>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td align="center" id="photo">
|
||||
<div id="box_photo">
|
||||
<a class="delete_button" href="{$product.delete_link}"><img src="/images/frontend/theme/default2/stProductsComparePlugin/delete.gif" /></a>
|
||||
<div class="image">{$product.photo}</div>
|
||||
</div>
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_name">
|
||||
{$product.name}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_producer">
|
||||
{$product.producer}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
{if $show_price}
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value tr_price_netto">
|
||||
{if !$product.hide_price}
|
||||
{$product.price_netto}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_price_brutto">
|
||||
{if !$product.hide_price}
|
||||
{$product.price_brutto}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_vat">
|
||||
{if !$product.hide_price}
|
||||
{$product.vat}%
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
{else}
|
||||
<p>{__ text="Brak produktów do porównania."}</hp>
|
||||
{if $hasLastViewedProduct}
|
||||
<div id="st_product_compare-back_button" class="st_button st_align-left">
|
||||
<div class="st_button-left buttons">
|
||||
{$lastViewedProduct}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
{$compare_button_remove}
|
||||
@@ -0,0 +1 @@
|
||||
{$compare_button_add}
|
||||
@@ -0,0 +1,13 @@
|
||||
<div id="st_component-st_products_compare_plugin-product_compare">
|
||||
{if $compare_product}
|
||||
<div id="st_button-product_compare_add" style="overflow:hidden;">
|
||||
{$add_product_to_compare}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $products_compare_array}
|
||||
<div id="st_button-product_compare_run">
|
||||
{$product_compare}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,145 @@
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
jQuery(function ($)
|
||||
{
|
||||
function equalHeight(group)
|
||||
{
|
||||
tallest = 0;
|
||||
group.each(function() {
|
||||
$(this).css("height","auto");
|
||||
thisHeight = $(this).height();
|
||||
if(thisHeight > tallest) {
|
||||
tallest = thisHeight+16;
|
||||
}
|
||||
});
|
||||
group.height(tallest);
|
||||
}
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_name"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_producer"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .tr_price_netto"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_price_brutto"));
|
||||
});
|
||||
|
||||
$(window).load(function() {
|
||||
equalHeight($("#products_compare .td_vat"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
{set layout="one_column"}
|
||||
<div id="product_compare_index" class="box roundies">
|
||||
<div class="title">
|
||||
<h2>{__ text="Porównaj produkty"}</h2>
|
||||
</div>
|
||||
{if $products_compare}
|
||||
<div id="products_compare_table_params">
|
||||
<table id="products_compare">
|
||||
<tr>
|
||||
<td id="photo_first"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_name">{__ text="Nazwa"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_producer">{__ text="Producent"}</td>
|
||||
</tr>
|
||||
{if $show_price}
|
||||
<tr>
|
||||
<td class="name tr_price_netto">{__ text="Cena netto"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_price_brutto">{__ text="Cena brutto"}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name td_vat">{__ text="VAT"}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
<div id="products_compare_table_values">
|
||||
<table id="products_compare">
|
||||
<tr>
|
||||
{foreach key=row item=product from=$results}
|
||||
<td align="center" id="photo">
|
||||
<div id="box_photo">
|
||||
<a class="delete_button" href="{$product.delete_link}"><img src="/images/frontend/theme/default2/stProductsComparePlugin/delete.gif" /></a>
|
||||
<div class="image">{$product.photo}</div>
|
||||
</div>
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_name">
|
||||
{$product.name}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_producer">
|
||||
{$product.producer}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
{if $show_price}
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value tr_price_netto">
|
||||
{if !$product.hide_price}
|
||||
{$product.price_netto}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_price_brutto">
|
||||
{if !$product.hide_price}
|
||||
{$product.price_brutto}
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
<tr class="rowHover">
|
||||
{foreach key=row item=product from=$results}
|
||||
<td class="value td_vat">
|
||||
{if !$product.hide_price}
|
||||
{$product.vat}%
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
{else}
|
||||
<p>{__ text="Brak produktów do porównania."}</hp>
|
||||
{if $hasLastViewedProduct}
|
||||
<div id="st_product_compare-back_button" class="st_button st_align-left">
|
||||
<div class="st_button-left buttons">
|
||||
{$lastViewedProduct}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
{$compare_button_remove}
|
||||
Reference in New Issue
Block a user