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,25 @@
<?php
class stTrustedShopsFrontendActions extends stActions {
public function executeAjaxBasketUpdate() {
$this->getUser()->setAttribute('ts_buyer_protection', $this->getRequestParameter('ts_checked', false) == "checked" ? true : false, 'soteshop/stTrustedShopsPlugin');
$basket = stBasket::getInstance($this->getUser());
$basket_params = array('basket' => $basket);
if(stTheme::is_responsive()){
$this->responseUpdateElement('shopping-cart-summary', array('module' => 'stDeliveryFrontend','component'=> 'basketSummary', 'params' => $basket_params));
}else{
$this->responseUpdateElement('st_basket-summary', array('module' => 'stDeliveryFrontend','component'=> 'basketSummary', 'params' => $basket_params));
}
return $this->renderResponse();
}
}

View File

@@ -0,0 +1,119 @@
<?php
class stTrustedShopsFrontendComponents extends sfComponents {
public function executeShowExcellenceBuyerProtection() {
$this->smarty = new stSmarty('stTrustedShopsFrontend');
$cert = TrustedShopsPeer::retrieveByCulture($this->getUser()->getCulture());
if (is_object($cert) && $cert->getType() == 'Excellence' && $cert->isActive()) {
$this->certificate = $cert->getCertificate();
$stBasket = stBasket::getInstance($this->getUser());
$stDelivery = stDeliveryFrontend::getInstance($stBasket);
$stCurrency = stCurrency::getInstance($this->getContext());
$c = new Criteria();
$c->add(TrustedShopsProtectionProductsPeer::TRUSTED_SHOPS_ID, $cert->getId());
$c->add(TrustedShopsProtectionProductsPeer::CURRENCY, $stCurrency->get()->getShortcut());
$c->add(TrustedShopsProtectionProductsPeer::AMOUNT, $stBasket->getTotalAmount(true,true) + $stDelivery->getTotalDeliveryCost(true,true), Criteria::GREATER_EQUAL);
$c->addAscendingOrderByColumn(TrustedShopsProtectionProductsPeer::AMOUNT);
$tspp = TrustedShopsProtectionProductsPeer::doSelectOne($c);
$connector = new stTrustedShopsConnector();
if (is_object($tspp) && $connector->checkLogin($cert->getCertificate(), $cert->getUsername(), $cert->getPassword()) == 1) {
$this->amount = $tspp->getAmount();
$this->price = $tspp->getGross();
$this->currency = $tspp->getCurrency();
$this->getUser()->setAttribute('ts_buyer_protection_id', $tspp->getId(), 'soteshop/stTrustedShopsPlugin');
$this->checked = $this->getUser()->getAttribute('ts_buyer_protection', false, 'soteshop/stTrustedShopsPlugin');
} else return sfView::NONE;
} else return sfView::NONE;
}
public function executeShowClassicBuyerProtection() {
$r = $this->getRequest();
if ($r->hasParameter('id') && $r->hasParameter('hash_code')) {
$this->smarty = new stSmarty('stTrustedShopsFrontend');
$cert = TrustedShopsPeer::retrieveByCulture($this->getUser()->getCulture());
if (is_object($cert) && $cert->getType() == 'Classic' && $cert->isActive()) {
$order = OrderPeer::retrieveByIdAndHashCode($r->getParameter('id'), $r->getParameter('hash_code'));
$this->certificate = $cert->getCertificate();
$this->email = $order->getGuardUser()->getUsername();
$this->userId = $order->getGuardUser()->getId();
$this->orderId = $order->getNumber();
$this->orderAmount = number_format($order->getTotalAmountWithDelivery(true, true), 2, '.', '');
$this->currency = $order->getOrderCurrency()->getShortcut();
$c = new Criteria();
$c->add(TrustedShopsHasPaymentTypePeer::TRUSTED_SHOPS_ID, $cert->getId());
$c->add(TrustedShopsHasPaymentTypePeer::PAYMENT_TYPE_ID, $order->getOrderPayment()->getPaymentTypeId());
$payment = TrustedShopsHasPaymentTypePeer::doSelectOne($c);
if (is_object($payment)) {
$this->paymentType = $payment->getMethod();
} else {
$this->paymentType = 'OTHER';
}
} else return sfView::NONE;
} else return sfView::NONE;
}
public function executeShowTrustbadge() {
$certificate = TrustedShopsPeer::retrieveByCulture($this->getUser()->getCulture());
if (!is_object($certificate))
return sfView::NONE;
$this->code = $certificate->getTrustbadgeCode();
}
public function executeShowRatingWidget() {
$this->smarty = new stSmarty('stTrustedShopsFrontend');
$certificate = TrustedShopsPeer::retrieveByCulture($this->getUser()->getCulture());
if (is_object($certificate) && $certificate->getRatingWidget()) {
$this->certificate = $certificate->getCertificate();
} else
return sfView::NONE;
}
public function executeOrderSummary() {
$this->smarty = new stSmarty('stTrustedShopsFrontend');
if ($this->getRequest()->hasParameter('id') && $this->getRequest()->hasParameter('hash_code')) {
$certificate = TrustedShopsPeer::retrieveByCulture($this->getUser()->getCulture());
if (!is_object($certificate))
return sfView::NONE;
$id = $this->getRequestParameter('id');
$hashCode = $this->getRequestParameter('hash_code');
$order = OrderPeer::retrieveByIdAndHashCode($id, $hashCode);
if (!is_object($order))
return sfView::NONE;
$c = new Criteria();
$c->add(OrderHasPaymentPeer::ORDER_ID, $order->getId());
$c->addJoin(OrderHasPaymentPeer::PAYMENT_ID, PaymentPeer::ID);
$c->add(PaymentPeer::GIFT_CARD_ID, null, Criteria::ISNULL);
$orderHasPayment = OrderHasPaymentPeer::doSelectOne($c);
if (!is_object($orderHasPayment))
return sfView::NONE;
$this->email = $order->getGuardUser()->getUsername();
$this->number = $order->getNumber();
$this->amount = number_format($order->getTotalAmountWithDelivery(true, true), 2, '.', '');
$this->currency = $order->getOrderCurrency()->getShortcut();
$this->payment = $orderHasPayment->getPayment()->getPaymentType()->getName();
}
}
}

View File

@@ -0,0 +1,12 @@
<?php
$smarty->assign('number', $number);
$smarty->assign('email', $email);
$smarty->assign('amount', $amount);
$smarty->assign('currency', $currency);
$smarty->assign('payment', $payment);
$smarty->display("order.html");
?>

View File

@@ -0,0 +1,13 @@
<?php
st_theme_use_stylesheet('stTrustedShopsPlugin.css');
$smarty->assign('certificate', $certificate);
$smarty->assign('form', form_tag('https://www.trustedshops.com/shop/protection.php', array('id' => 'trustedShopsForm', 'target' => '_blank')));
$smarty->assign('charset', input_hidden_tag('charset', 'UTF-8'));
$smarty->assign('shopId', input_hidden_tag('shop_id', $certificate));
$smarty->assign('email', input_hidden_tag('email', $email));
$smarty->assign('amount', input_hidden_tag('amount', $orderAmount));
$smarty->assign('curr', input_hidden_tag('curr', $currency));
$smarty->assign('paymentType', input_hidden_tag('paymentType', $paymentType));
$smarty->assign('kdnr', input_hidden_tag('kdnr', $userId));
$smarty->assign('ordernr', input_hidden_tag('ordernr', $orderId));
$smarty->display("trusted_shops_buyer_protection_classic.html");

View File

@@ -0,0 +1,8 @@
<?php
st_theme_use_stylesheet('stTrustedShopsPlugin.css');
$smarty->assign('certificate', $certificate);
$smarty->assign('amount', $amount);
$smarty->assign('price', $price);
$smarty->assign('currency', $currency);
$smarty->assign('checkbox', checkbox_tag('trusted_shops', '1', $checked, array('id' => 'trustedShopsCheckbox' ,'onClick' => "jQuery(function($){stDelivery.executeAjaxUpdate($(stDelivery.deliveryPaymentChecked),'".url_for('stTrustedShopsFrontend/ajaxBasketUpdate')."', {ts_checked:$('#trustedShopsCheckbox').attr('checked')})})")));
$smarty->display("trusted_shops_buyer_protection_excellence.html");

View File

@@ -0,0 +1,4 @@
<?php
st_theme_use_stylesheet('stTrustedShopsPlugin.css');
$smarty->assign('certificate', $certificate);
$smarty->display('trusted_shops_show_rating_widget.html');

View File

@@ -0,0 +1,21 @@
<div class="st_application" id="trusted_shops_classic_summary">
<div id="trusted_shop_classic_summary_logo">
<a href="https://www.trustedshops.com/shop/certificate.php?shop_id={$certificate}" target="_blank" />
<img id="st_home" src="/images/frontend/theme/default/stTrustedShopsPlugin/logo.png" alt="" title="{__ text="Znak Jakości Trusted Shops tu możesz sprawdzić ważność!"}"/>
</a>
</div>
<div id="trusted_shop_classic_summary_content">
{__ text="Jako dodatkowy serwis oferujemy Ochronę Kupującego Trusted Shops. Przejmujemy pełny koszt tej gwarancji, wystarczy się tylko zarejestrować, aby z niej skorzystać."}
{$form}
{$charset}
{$shopId}
{$email}
{$amount}
{$curr}
{$paymentType}
{$kdnr}
{$ordernr}
<a href="#" onClick="document.getElementById('trustedShopsForm').submit();">{__ text="Zgłoszenie do Ochrony Kupującego Trusted Shops"}</a>
</form>
</div>
</div>

View File

@@ -0,0 +1,20 @@
<div id="trusted_shops">
<h5 class="st_title">{__ text="Ochrona Kupującego Trusted Shops"}</h5>
<div id="trusted_shops_logo">
<a href="https://www.trustedshops.com/shop/certificate.php?shop_id={$certificate}" target="_blank">
<img id="st_home" src="/images/frontend/theme/default/stTrustedShopsPlugin/logo.png" alt=""/>
</a>
</div>
<div id="trusted_shops_content">
<div id="trusted_shops_checkbox">
{$checkbox}{__ text="Ochrona Kupującego do"} {$amount} {$currency} ({$price} {$currency} {__ text="z VAT"})
</div>
{__ text="Ochrona Kupującego Trusted Shops zabezpiecza Twoje zakupy internetowe. Wyrażam zgodę na przekazywanie i"}
<a href="https://www.trustedshops.com/shop/data_privacy.php?shop_id={$certificate}" target="_blank">{__ text="zapisywanie"}</a>
{__ text="mojego adresu e-mail przez Trusted Shops w celu realizacji usługi Ochrony Kupującego."}
<a href="https://www.trustedshops.com/shop/protection_conditions.php?shop_id={$certificate}" target="_blank">{__ text="Warunki gwarancji"}</a>
{__ text="dla Ochrony Kupującego."}
</div>
<div id="test"></div>
<div class="st_clear_all"></div>
</div>

View File

@@ -0,0 +1,3 @@
<div style="font-size:12px; padding-top: 15px;">
<a target="_blank" href="https://www.trustedshops.com/evaluation/evaluer_{$certificate}.html{$params}">{__ text="Kliknij tu"}</a> {__ text="aby dodać ocenę sklepu."}
</div>

View File

@@ -0,0 +1 @@
{__ text="Wejdź na stronę"} https://www.trustedshops.com/evaluation/evaluer_{$certificate}.html {__ text="aby dodać ocenę sklepu."}

View File

@@ -0,0 +1,3 @@
<a target="_blank" href="https://www.trustedshops.com/buyerrating/info_{$certificate}.html" title="{__ text="Zobacz opinie klientów sklepu"} {$shopName}">
<img alt="{__ text="Opinie klientów sklepu"} {$shopName}" border="0" style="width: 180px; padding-top: 10px;" src="https://www.trustedshops.com/bewertung/widget/widgets/{$certificate}.gif"/>
</a>

View File

@@ -0,0 +1,15 @@
<div id="trusted_shops_sealbox">
<div class="trusted_shops_sealbox_top_small"></div>
<div class="trusted_shops_sealbox_middle">
{$form}
{$shopId}
<img src="/images/frontend/theme/default/stTrustedShopsPlugin/logo.png" alt="" title="{__ text="Znak Jakości Trusted Shops tu możesz sprawdzić ważność!"}" onClick="document.getElementById('trustedShopsSealboxForm').submit();"/>
</form>
<div class="trusted_shops_sealbox_txt">
<a href="http://www.trustedshops.com/profile/{$urlShopName}_{$certificate}.html" title="{__ text="Więcej informacji o"} {$shopName}" target="_blank">
{$shopName} {__ text="to sklep internetowy z Certyfikatem i Ochroną Kupującego, certyfikowany przez Trusted Shops. Zobacz więcej..."}
</a>
</div>
</div>
<div class="trusted_shops_sealbox_bottom"></div>
</div>

View File

@@ -0,0 +1,20 @@
<div id="basket-trusted-shops" class="roundies box_form">
<h3>{__ text="Ochrona Kupującego Trusted Shops"}</h3>
<div class="st_clear_all"></div>
<div id="trusted-shops-excellence-logo">
<a href="https://www.trustedshops.com/shop/certificate.php?shop_id={$certificate}" target="_blank">
<img id="st_home" src="/images/frontend/theme/default2/stTrustedShopsPlugin/logo.png" alt=""/>
</a>
</div>
<div id="trusted-shops-excellence-content">
<div id="trusted-shops-excellence-checkbox">
{$checkbox}{__ text="Ochrona Kupującego do"} {$amount} {$currency} ({$price} {$currency} {__ text="z VAT"})
</div>
{__ text="Ochrona Kupującego Trusted Shops zabezpiecza Twoje zakupy internetowe. Wyrażam zgodę na przekazywanie i"}
<a href="https://www.trustedshops.com/shop/data_privacy.php?shop_id={$certificate}" target="_blank">{__ text="zapisywanie"}</a>
{__ text="mojego adresu e-mail przez Trusted Shops w celu realizacji usługi Ochrony Kupującego."}
<a href="https://www.trustedshops.com/shop/protection_conditions.php?shop_id={$certificate}" target="_blank">{__ text="Warunki gwarancji"}</a>
{__ text="dla Ochrony Kupującego."}
</div>
<div class="st_clear_all"></div>
</div>

View File

@@ -0,0 +1,4 @@
<div style="font-size:12px; padding-top: 15px;">
{__ text="Czy jesteś zadowolony z naszych usług?"}
<a target="_blank" href="{__ text="https://www.trustedshops.pl/opinia/ocen_"}{$certificate}.html{$params}">{__ text="Napisz komentarz i wystaw nam ocenę."}</a>
</div>

View File

@@ -0,0 +1 @@
{__ text="Czy jesteś zadowolony z naszych usług?"} {__ text="Napisz komentarz i wystaw nam ocenę."} - {__ text="https://www.trustedshops.pl/opinia/ocen_"}{$certificate}.html

View File

@@ -0,0 +1,3 @@
<a href="{__ text="https://www.trustedshops.pl/opinia/info_"}{$certificate}.html" title="{__ text="Przeczytaj opinie klientów"}" target="_blank">
<img alt="{__ text="Przeczytaj opinie klientów"}" border="0" style="width: 183px;" src="//widgets.trustedshops.com/reviews/widgets/{$certificate}.gif"/>
</a>

View File

@@ -0,0 +1,8 @@
<div id="trustedShopsCheckout" style="display: none;">
<span id="tsCheckoutOrderNr">{$number}</span>
<span id="tsCheckoutBuyerEmail">{$email}</span>
<span id="tsCheckoutOrderAmount">{$amount}</span>
<span id="tsCheckoutOrderCurrency">{$currency}</span>
<span id="tsCheckoutOrderPaymentType">{$payment}</span>
{slot name="trusted-shops-order" hidden="true"}{/slot}
</div>

View File

@@ -0,0 +1,31 @@
<div class="panel panel-default" id="basket-login-user">
<div class="panel-heading">{__ text="Ochrona Kupującego Trusted Shops"}</div>
<div class="panel-body">
<div class="checkbox">
<label>
{$checkbox} {if $big_amount == 1}{__ text="Ochrona Kupującego powyżej"}{else}{__ text="Ochrona Kupującego do"}{/if} {$amount} {$currency} ({$price} {$currency} {__ text="z VAT"})
</label>
</div>
<div id="trusted-shops-excellence-logo" class="pull-left" style="margin:10px;">
<a href="https://www.trustedshops.com/shop/certificate.php?shop_id={$certificate}" target="_blank">
<img id="st_home" src="/images/frontend/theme/default2/stTrustedShopsPlugin/logo.png" alt=""/>
</a>
</div>
<div id="trusted-shops-excellence-content" style="margin:10px;">
{__ text="Ochrona Kupującego Trusted Shops zabezpiecza Twoje zakupy internetowe. Wyrażam zgodę na przekazywanie i"}
<a href="https://www.trustedshops.com/shop/data_privacy.php?shop_id={$certificate}" target="_blank">{__ text="zapisywanie"}</a>
{__ text="mojego adresu e-mail przez Trusted Shops w celu realizacji usługi Ochrony Kupującego."}
<a href="https://www.trustedshops.com/shop/protection_conditions.php?shop_id={$certificate}" target="_blank">{__ text="Warunki gwarancji"}</a>
{__ text="dla Ochrony Kupującego."}
</div>
</div>
</div>

View File

@@ -0,0 +1,7 @@
<div class="panel panel-default">
<div class="panel-body text-center">
<a href="{__ text="https://www.trustedshops.pl/opinia/info_"}{$certificate}.html" title="{__ text="Przeczytaj opinie klientów"}" target="_blank">
<img alt="{__ text="Przeczytaj opinie klientów"}" border="0" src="//widgets.trustedshops.com/reviews/widgets/{$certificate}.gif"/>
</a>
</div>
</div>