first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
/**
* SOTESHOP/stCrossellingPlugin
*
* Ten plik należy do aplikacji stCrossellingPlugin opartej na licencji (Professional License SOTE).
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stCrossellingPlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/sote (Professional License SOTE)
* @version $Id: actions.class.php 10 2009-08-24 09:32:18Z michal $
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Komponent stCrossellingFrontendComponents
*
* @package stCrossellingPlugin
* @subpackage actions
*/
class stCrossellingFrontendActions extends stActions {
public function executeShowInProductTab() {
$this->setLayout(false);
$this->smarty = new stSmarty($this->getModuleName());
if ($this->hasRequestParameter('id'))
$this->products = stCrosselling::getProducts(array($this->getRequestParameter('id')));
else
return sfView::NONE;
$this->config = stConfig::getInstance('stProduct');
$this->config_points = stConfig::getInstance('stPointsBackend');
$this->config_points->setCulture($this->getUser()->getCulture());
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* SOTESHOP/stCrossellingPlugin
*
* Ten plik należy do aplikacji stCrossellingPlugin opartej na licencji (Professional License SOTE).
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stCrossellingPlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/sote (Professional License SOTE)
* @version $Id: components.class.php 2904 2010-01-07 13:40:03Z bartek $
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Komponent stCrossellingFrontendComponents
*
* @package stCrossellingPlugin
* @subpackage actions
*/
class stCrossellingFrontendComponents extends sfComponents
{
/**
* Wyświetlanie produktów w koszyku
*/
public function executeShowProductsInBasket()
{
$this->smarty = new stSmarty('stCrossellingFrontend');
$this->productSmarty = new stSmarty('stProduct');
$context = sfContext::getInstance();
$products = stBasket::getInstance($context->getUser())->getItems();
$stCrosselling = new stCrosselling();
$this->productConfig = stConfig::getInstance($context, 'stProduct');
$productsIdArray = array();
foreach ($products as $product) $productsIdArray[] = $product->getProductId();
$c = new Criteria();
$c->add(ProductGroupPeer::PRODUCT_GROUP, 'BASKET');
$basketGroup = ProductGroupPeer::doSelectOneCached($c);
if (is_object($basketGroup) && ($basketGroup->getProductLimit())) $limit = $basketGroup->getProductLimit();
else $limit = 6;
$c = new Criteria();
$c->add(ProductPeer::ID, $stCrosselling->getProductsId($productsIdArray), Criteria::IN);
$c->addAscendingOrderByColumn('RAND()');
$this->pager = new sfPropelPager('Product', $limit);
$this->pager->setCriteria($c);
$this->pager->init();
$this->productSmarty->register_function('st_product_image_tag', 'st_product_smarty_image_tag');
}
}

View File

@@ -0,0 +1,5 @@
<?php
st_theme_use_stylesheet('stPromoteProductsInBasket.css');
$smarty->assign('products', get_partial("stProduct/listOther", array('product_pager' => $pager, 'smarty' => $productSmarty, 'config' => $productConfig)));
$smarty->display('crosselling_show_products_in_basket.html');
?>

View File

@@ -0,0 +1,87 @@
<?php
use_helper('stCurrency', 'stText', 'stProductImage', 'stUrl');
st_theme_use_stylesheet('stProduct.css');
$results = array();
$smarty->assign('show_name', $config->get('show_name_other'));
$smarty->assign('show_image', $config->get('show_image_other'));
$smarty->assign('show_price', $config->get('show_price_other'));
$smarty->assign('show_old_price', $config->get('show_old_price_other'));
$smarty->assign('show_discount', $config->get('show_discount_other'));
$smarty->assign('price_view', $config->get('price_view_other'));
$photo_max_height = st_asset_thumbnail_setting('height', 'thumb');
$photo_max_width = st_asset_thumbnail_setting('width', 'small');
$cut_name = $config->get('cut_name_other');
$max_name_length = $config->get('cut_name_num_other');
foreach ($products as $index => $product) {
$product_url = st_url_for('stProduct/show?url=' . $product->getFriendlyUrl());
$product_name = $product->getName();
$results[$index]['instance'] = $product;
if ($cut_name && st_check_strlen($product_name) > $max_name_length)
$results[$index]['name'] = '<span title="'.$product_name.'" class="hint">' . content_tag('a', st_truncate_text($product_name, $max_name_length, '...'), array('href' => $product_url, 'class' => 'product_name')) . "</span>";
else
$results[$index]['name'] = content_tag('a', $product_name, array('href' => $product_url, 'class' => 'product_name'));
$results[$index]['id'] = $product->getId();
$results[$index]['photo'] = content_tag('a', st_product_image_tag($product, 'thumb'), array('href' => $product_url));
$results[$index]['photo_small'] = content_tag('a', st_product_image_tag($product, 'small'), array('href' => $product_url));
$results[$index]['photo_max_height'] = $photo_max_height;
if ($product->isPriceVisible()) {
if ($config->get('show_uom_other') && $product->getUom())
$uom = " / ".$product->getUom();
else
$uom = "";
$results[$index]['price'] = st_currency_format($product->getPriceBrutto(true)).$uom;
$results[$index]['price_net'] = st_currency_format($product->getPriceNetto(true)).$uom;
$results[$index]['price_brutto_pure'] = $product->getPriceBrutto(true).$uom;
$results[$index]['price_netto_pure'] = $product->getPriceNetto(true).$uom;
$currency = stCurrency::getInstance(sfContext::getInstance());
if ($currency->getFrontSymbol())
$results[$index]['currency'] = $currency->getFrontSymbol();
else
$results[$index]['currency'] = $currency->getBackSymbol();
$old_price_brutto = $product->getOldPriceBrutto(true);
$results[$index]['check_old_price'] = $old_price_brutto != 0;
$results[$index]['old_price'] = st_currency_format($old_price_brutto);
$results[$index]['old_price_net'] = st_currency_format($product->getOldPriceNetto(true));
$results[$index]['discount'] = $product->getDiscountInPercent();
$results[$index]['basket'] = st_get_component('stBasket', 'add', array('product' => $product));
$results[$index]['check_price'] = false;
if ($config->get('show_basic_price_long') && $product->hasBasicPrice() && $product->getBasicPriceBrutto()!=0) {
$results[$index]['basic_price'] = array(
'netto' => st_currency_format($product->getBasicPriceNetto(true)),
'brutto' => st_currency_format($product->getBasicPriceBrutto(true)),
'quantity' => st_product_basic_price_quantity($product),
'for_quantity' => st_product_basic_price_for_quantity($product),
);
}
} else
$results[$index]['check_price'] = true;
$results[$index]['points_value'] = $product->getPointsValue();
$results[$index]['points_earn'] = $product->getPointsEarn();
$results[$index]['points_only'] = $product->getPointsOnly();
$results[$index]['name_without_link'] = $product_name;
$results[$index]['link'] = st_url_for('stProduct/show?url=' . $product->getFriendlyUrl());
}
$smarty->assign('points_system_is_active', stPoints::isPointsSystemActive());
$smarty->assign('show_points', $config_points->get('product_group_show_points'));
$smarty->assign('display_type', $config_points->get('product_group_display_type'));
$smarty->assign('points_shortcut', $config_points->get('points_shortcut', null, true));
$smarty->assign('config_points',$config_points);
$smarty->assign('results', $results);
$smarty->display('crosselling_show_in_product_tab.html');

View File

@@ -0,0 +1,16 @@
<div id="st_promote_products_in_basket_frame_images">
{foreach key=row item=product from=$results}
<div class="st_promote_products_in_basket_box_image">
<div class="st_promote_products_in_basket_name">
{$product.name}
</div>
<div class="st_promote_products_in_basket_image">
{$product.image}
</div>
<div class="st_promote_products_in_basket_price">
{$product.brutto}
</div>
</div>
{/foreach}
<br class="clear_all" />
</div>

View File

@@ -0,0 +1,8 @@
<h5 class="st_title">
{__ text="Klienci, którzy kupili te produkty, kupili również"}
</h5>
<div class="st_promote-products">
<div id="st_promote_products_in_basket_frame_images">
{$products}
</div>
</div>

View File

@@ -0,0 +1,4 @@
<h3>{__ text="Klienci, którzy kupili te produkty, kupili również"}</h3>
<div id="content_product_basket">
{$products}
</div>

View File

@@ -0,0 +1,66 @@
<section id="product-crosselling" class="full-list product-list">
<div class="row" data-equalizer>
{foreach key=row item=product from=$results}
<div class="product col-xs-4 col-sm-4 col-md-3 col-lg-3">
<div class="thumbnail clearfix view-img">
<div class="image" data-equalizer-watch="image">{if $show_image==1}{$product.photo_small}{/if}</div>
<div class="text-center caption clearfix" data-equalizer-watch="info">
<p class="name">{if $show_name==1}{$product.name}{/if}</p>
{if $show_price==1 && $product.check_price!=1 && $product.points_only!=1}
{if $price_view=='net_gross'}
<div class="double_price price">
{$product.price_net}
<div class="minor_price">({$product.price})</div>
</div>
{elseif $price_view=='only_gross'}
<div class="price">{$product.price}</div>
{elseif $price_view=='only_net'}
<div class="price">{$product.price_net}</div>
{elseif $price_view=='gross_net'}
<div class="double_price price">
{$product.price}
<div class="minor_price">({$product.price_net})</div>
</div>
{/if}
{if $product.basic_price}
<div class="text-muted basic_price text-center"><i>{$product.basic_price.quantity} ( {$product.basic_price.brutto} {__ text="za"} {$product.basic_price.for_quantity} )</i></div>
{/if}
{/if}
<div class="discount-old_price">
{if $show_discount==1 && $product.discount!=0 && $product.check_price!=1 && $product.points_only!=1}
<div class="discount">{__ text="Rabat"}: {$product.discount} %</div>
{elseif ($show_old_price==1 && $product.check_price!=1)}
{if $product.check_old_price==1}
<div class="old_price price">
{if ($price_view=='net_gross' || $price_view=='only_net')}
{$product.old_price_net}
{else}
{$product.old_price}
{/if}
</div>
{/if}
{/if}
</div>
</div>
</div>
</div>
{/foreach}
</div>
</section>
{literal}
<script type="text/javascript">
jQuery(function($) {
$(document).ready(function() {
$('#product-crosselling [data-equalizer]').equalizer({ use_tallest: true });
if($('#price-star-info').length ){
$('#product-crosselling .price').each(function() {
var price = $(this);
price.html(price.html() + ' *');
});
}
});
});
</script>
{/literal}

View File

@@ -0,0 +1,4 @@
<h3>{__ text="Klienci, którzy kupili te produkty, kupili również"}</h3>
<div id="content_product_basket">
{$products}
</div>