first commit

This commit is contained in:
2024-10-25 14:16:28 +02:00
commit 925276dbb2
33795 changed files with 4780077 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>sposoby_dostawy</name>
<displayName><![CDATA[Sposoby dostawy]]></displayName>
<version><![CDATA[1.0]]></version>
<description><![CDATA[Moduł wyświetlający wybrane sposoby dostawy na karcie produktu.]]></description>
<author><![CDATA[Dominik W&oacute;jcicki]]></author>
<tab><![CDATA[]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,210 @@
section.polecane-kategorie-na-stronie-glownej {
max-width: 100%;
width: 100%;
display: table;
padding-bottom: 6%;
}
section.polecane-kategorie-na-stronie-glownej span.category-description {
color: #7b7b7b;
text-align: justify;
max-width: 100%;
width: 100%;
display: table;
padding-top: 20px;
padding-bottom: 20px;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty {
padding: 0px;
display: table;
width: 100%;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li {
list-style-position: outside;
list-style-image: none;
list-style-type: none;
max-height: 360px;
height: 100%;
position: relative;
padding-bottom: 30px;
padding: 0px;
margin-right: -1px;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li:hover {
z-index: 600;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li div.product-container {
height: 360px;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li div.product-container .product-image-container {
max-width: 100%;
max-height: 265px;
line-height: 265px;
text-align: center;
background-color: #ffffff;
border: solid 1px #f3f2f2;
vertical-align: middle;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li div.product-container:hover .product-image-container {
border: solid 1px #2e3192;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li div.product-container .product-image-container img {
max-width: 243px;
width: 100%;
vertical-align: middle;
margin-left: auto;
margin-right: auto;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .new-box {
border: solid 2px #5cce00;
background-color: #5cce00;
position: absolute;
top: 18px;
left: 34px;
width: 70px;
height: 27px;
font-size: 10px;
line-height: 23px;
vertical-align: middle;
text-align: center;
color: #ffffff;
font-weight: 700;
text-transform: uppercase;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .discount-box {
position: absolute;
top: 18px;
right: 34px;
width: 70px;
height: 27px;
font-size: 10px;
line-height: 23px;
vertical-align: middle;
text-align: center;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .discount-box .discount-label {
border: solid 2px #f58220;
background-color: #ffffff;
display: block;
width: 70px;
height: 27px;
line-height: 23px;
font-size: 10px;
line-height: 23px;
vertical-align: middle;
text-align: center;
color: #f58220;
font-weight: 700;
text-transform: uppercase;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .discount-box .discount-value {
border: solid 2px #f58220;
background-color: #f58220;
display: block;
width: 70px;
height: 27px;
line-height: 23px;
font-size: 10px;
line-height: 23px;
vertical-align: middle;
text-align: center;
color: #ffffff;
font-weight: 700;
text-transform: uppercase;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .discount-box.red .discount-label {
border: solid 2px #dd0d0d;
background-color: #ffffff;
display: block;
width: 70px;
height: 27px;
line-height: 23px;
font-size: 10px;
line-height: 23px;
vertical-align: middle;
text-align: center;
color: #dd0d0d;
font-weight: 700;
text-transform: uppercase;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .discount-box.red .discount-value {
border: solid 2px #dd0d0d;
background-color: #dd0d0d;
display: block;
width: 70px;
height: 27px;
line-height: 23px;
font-size: 10px;
line-height: 23px;
vertical-align: middle;
text-align: center;
color: #ffffff;
font-weight: 700;
text-transform: uppercase;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .sale-box {
background-image: url(../img/label-sale.png);
background-repeat: no-repeat;
background-position: left 2px;
position: absolute;
top: 91px;
left: 0px;
width: 100px;
height: 22px;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .product-container H5.product-name {
font-family: 'Lato', sans-serif;
text-align: center;
padding: 0px;
padding-top: 10px;
margin: 0px;
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .product-container H5.product-name a {
color: #5d5d5d;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .product-container H5.product-name a:hover {
color: #f58220;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .product-container .content_price {
text-align: center;
font-size: 18px;
font-weight: 700;
padding-top: 10px;
padding-bottom: 10px;
color: #494949;
}
ul.blok-polecane-kategorie-na-stronie-glownej-produkty li .product-container .content_price .old-price.product-price {
font-size: 14px;
font-weight: 400;
text-decoration: line-through;
color: #5a5a5a;
}
a.polecane-kategorie-na-stronie-glownej-url {
font-size: 14px;
color: #333333;
background-color: transparent;
text-transform: lowercase;
padding: 0px;
font-weight: 600;
position: absolute;
z-index: 600;
left: 50%;
transform: translate(-50%, 0);
border: solid 1px #CCCCCC;
padding: 8px;
}
a.polecane-kategorie-na-stronie-glownej-url:hover {
background-color: transparent;
color: #f58220;
}
a.polecane-kategorie-na-stronie-glownej-url:before {
content: "\f105";
font-family: "FontAwesome";
padding-right: 8px;
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,31 @@
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
$(document).ready(function(){
$('li.products').slice(-4).hide();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

View File

@@ -0,0 +1,195 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
use PrestaShop\PrestaShop\Core\Module\WidgetInterface;
class sposoby_dostawy extends Module implements WidgetInterface
{
private $templateFile;
public function __construct()
{
$this->name = 'sposoby_dostawy';
$this->version = '1.0';
$this->author = 'Dominik Wójcicki';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->trans('Sposoby dostawy', array(), 'Modules.sposoby_dostawy.Admin');
$this->description = $this->trans('Moduł wyświetlający wybrane sposoby dostawy na karcie produktu.', array(), 'Modules.sposoby_dostawy.Admin');
$this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
$this->templateFile = 'module:sposoby_dostawy/sposoby_dostawy.tpl';
}
public function install()
{
return (parent::install() &&
$this->registerHook('displayHome') &&
$this->registerHook('actionObjectLanguageAddAfter') &&
$this->installFixtures() &&
$this->disableDevice(Context::DEVICE_MOBILE));
}
protected function installFixture($id_lang, $image = null)
{
$values['ID_SPOSOBU_DOSTAWY'][(int)$id_lang] = '';
Configuration::updateValue('ID_SPOSOBU_DOSTAWY', $values['ID_SPOSOBU_DOSTAWY']);
}
public function uninstall()
{
Configuration::deleteByName('ID_SPOSOBU_DOSTAWY');
return parent::uninstall();
}
public function postProcess()
{
if (Tools::isSubmit('submitStoreConf')) {
$languages = Language::getLanguages(false);
$values = array();
$update_images_values = false;
foreach ($languages as $lang) {
$values['ID_SPOSOBU_DOSTAWY'][$lang['id_lang']] = Tools::getValue('ID_SPOSOBU_DOSTAWY_'.$lang['id_lang']);
}
Configuration::updateValue('ID_SPOSOBU_DOSTAWY', $values['ID_SPOSOBU_DOSTAWY']);
$this->_clearCache($this->templateFile);
return $this->displayConfirmation($this->trans('The settings have been updated.', array(), 'Admin.Notifications.Success'));
}
return '';
}
public function getContent()
{
return $this->postProcess().$this->renderForm();
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->trans('Settings', array(), 'Admin.Global'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'text',
'lang' => true,
'label' => $this->trans('Id sposobów dostawy', array(), 'Modules.sposoby_dostawy.Admin'),
'name' => 'ID_SPOSOBU_DOSTAWY',
'desc' => $this->trans('Podaj numer Id sposobu dostawy. Możesz podać kilka Id rozdzielając je przecinkiem.', array(), 'Modules.sposoby_dostawy.Admin')
)
),
'submit' => array(
'title' => $this->trans('Save', array(), 'Admin.Actions')
)
),
);
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$helper->default_form_language = $lang->id;
$helper->module = $this;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitStoreConf';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->tpl_vars = array(
'uri' => $this->getPathUri(),
'fields_value' => $this->getConfigFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
return $helper->generateForm(array($fields_form));
}
public function getConfigFieldsValues()
{
$languages = Language::getLanguages(false);
$fields = array();
foreach ($languages as $lang) {
$fields['ID_SPOSOBU_DOSTAWY'][$lang['id_lang']] = Tools::getValue('ID_SPOSOBU_DOSTAWY_'.$lang['id_lang'], Configuration::get('ID_SPOSOBU_DOSTAWY', $lang['id_lang']));
}
return $fields;
}
public function renderWidget($hookName, array $params)
{
if (!$this->isCached($this->templateFile, $this->getCacheId('sposoby_dostawy'))) {
$this->smarty->assign($this->getWidgetVariables($hookName, $params));
}
return $this->fetch($this->templateFile, $this->getCacheId('sposoby_dostawy'));
}
public function hookdisplayProductTab($params)
{
return $this->display(__FILE__, 'sposoby_dostawy_product_tab_name.tpl');
}
public function getWidgetVariables($hookName, array $params) {
$id_sposobu_dostawy = Configuration::get('ID_SPOSOBU_DOSTAWY', $this->context->language->id);
$sql = "SELECT DISTINCT
ps_carrier.*,
ps_carrier_lang.delay,
ps_delivery.price,
ps_carrier_tax_rules_group_shop.id_tax_rules_group,
ps_tax_rules_group.id_tax_rules_group,
ps_tax_rules_group.name AS TaxName,
ps_tax_rule.id_tax_rules_group,
ps_tax_rule.id_tax,
ps_tax.id_tax,
ps_tax.rate
FROM
ps_carrier,
ps_carrier_lang,
ps_delivery,
ps_carrier_tax_rules_group_shop,
ps_tax_rules_group,
ps_tax_rule,
ps_tax
WHERE
ps_carrier.active = 1 AND
ps_carrier.deleted = 0 AND
ps_carrier.id_carrier IN (". $id_sposobu_dostawy .") AND
ps_carrier_lang.id_carrier = ps_carrier.id_carrier AND
ps_delivery.id_carrier = ps_carrier.id_carrier AND
ps_carrier_tax_rules_group_shop.id_carrier = ps_carrier.id_carrier AND
ps_delivery.id_carrier = ps_carrier_lang.id_carrier AND
ps_carrier_tax_rules_group_shop.id_tax_rules_group = ps_tax_rules_group.id_tax_rules_group AND
ps_tax_rules_group.id_tax_rules_group = ps_tax_rule.id_tax_rules_group AND
ps_tax_rule.id_tax = ps_tax.id_tax ORDER BY position ASC";
$results = Db::getInstance()->ExecuteS($sql);
$sposoby_dostawy = $results;
$this->smarty->assign('sposoby_dostawy', $sposoby_dostawy);
}
}

View File

@@ -0,0 +1,25 @@
<!-- MODULE sposoby_dostawy -->
<div class="tab-pane fade in" id="shipping-method" role="tabpanel" aria-expanded="false">
<section class="sposoby-dostawy">
{foreach from=$sposoby_dostawy item=carrier name=homeCategoriesProduct}
<div class="row delivery-option">
<div class="row">
<div class="col-md-2 col-xs-12">
<img src="/img/s/{$carrier.id_carrier}.jpg" alt="{$carrier.name}" class="img-fluid" />
</div>
<div class="col-md-8 col-xs-12">
<span class="h6 carrier-name">{$carrier.name}</span><br />
<span class="carrier-delay">{$carrier.delay}</span>
</div>
<div class="col-md-2 col-xs-12">
{assign var='TaxRate' value="1.{$carrier.rate}"}
<span class="carrier-price">{Tools::displayPrice($carrier.price * $TaxRate)}</span>
</div>
</div>
</div>
{/foreach}
</section>
</div>
<!-- /MODULE sposoby_dostawy -->

View File

@@ -0,0 +1,8 @@
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href="#shipping-method"
role="tab"
aria-controls="shipping-method">{l s='Sposoby dostawy' d='Shop.Theme.Catalog'}</a>
</li>