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,85 @@
<?php
class stRecentlyViewedProductsFrontendActions extends stActions
{
public function executeShowProducts()
{
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
$config_recently = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
if($config_recently->get('enabled')!=1){
if($config_recently->get('show_in_product')!=1){
return sfView::NONE;
}
}
if(stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts()){
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
$this->products = stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts();
}
}
public function executeShowProductsSidebar()
{
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
$config_recently = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
if($config_recently->get('enabled')!=1){
if($config_recently->get('show_in_sidebar')!=1){
return sfView::NONE;
}
}
$i18n = $this->getContext()->getI18n();
if(stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts()){
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
$this->products = stRecentlyViewedProductsPluginListener::getRecentlyViewedProducts();
}else{
return $this->renderText("<p>".$i18n->__('W tym miejscu pojawią się ostatnio oglądane produkty.')."</p>");
}
}
public function executeRemoveProduct()
{
$product_id = $this->getRequestParameter('product_id');
stRecentlyViewedProductsPluginListener::removeRecentlyViewedProduct($product_id);
//return sfView::NONE;
return $this->renderText("true");
}
public function executeRemoveAll()
{
stRecentlyViewedProductsPluginListener::removeAll();
//return sfView::NONE;
return $this->renderText("true");
}
}

View File

@@ -0,0 +1,42 @@
<?php
class stRecentlyViewedProductsFrontendComponents extends sfComponents
{
public function executeRecentlyViewedProducts()
{
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
$config = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
if($config->get('enabled') != 1){
return sfView::NONE;
}
if($config->get('show_in_product') != 1){
return sfView::NONE;
}
}
public function executeRecentlyViewedProductsSidebar()
{
$this->smarty = new stSmarty('stRecentlyViewedProductsFrontend');
$config = stConfig::getInstance(sfContext::getInstance(), 'stRecentlyViewedProductsBackend');
if($config->get('enabled') != 1){
return sfView::NONE;
}
if($config->get('show_in_sidebar') != 1){
return sfView::NONE;
}
}
}