This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// fix product categories tree to display subcategory products in parent category | |
require dirname(__FILE__).'/config/config.inc.php'; | |
$limit = 100; | |
$offset = 0; | |
do { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Upgrade | |
apt-get update | |
apt-get -y upgrade | |
# Docker | |
apt-get remove docker docker-engine docker.io | |
apt-get --yes --force-yes install \ | |
apt-transport-https \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{if isset($features) && count($features)} | |
<ul> | |
{foreach from=$features item=f key=key} | |
{if $f.name !== 'xxx' && $f.name !== 'zzz'} | |
<li>{$f.name|escape:'html':'UTF-8'} - <b>{$f.value|escape:'html':'UTF-8'}</b></li> | |
{/if} | |
{/foreach} | |
</ul> | |
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export PrestaShop products with seo URLs (including category) | |
# id_lang = xxx, id_shop = yyy (default 1 if not multistore) | |
SELECT p.id_product, pl.name, CONCAT("https://example.com/", cl.link_rewrite, "/", p.id_product, "-", pl.link_rewrite, ".html") AS url, p.date_add, p.date_upd | |
FROM ps_product p | |
INNER JOIN ps_product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = 1 AND pl.id_shop = 1) | |
INNER JOIN ps_category_lang cl ON (p.id_category_default = cl.id_category AND cl.id_lang = 1 AND cl.id_shop = 1) | |
WHERE p.active = 1 | |
ORDER BY `p`.`id_product` DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function injectImages($images) | |
{ | |
foreach ($images as $imagePath => $imageUrl) { | |
$this->add('images', [['url' => $imageUrl]]); | |
} | |
// ten kod dodajemy | |
if (count($this->structure['images']) > 1) { | |
$tmp = $this->structure['images'][0]; | |
$this->structure['images'][0] = $this->structure['images'][1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p override/controllers/admin/templates/products | |
touch informations.tpl // Product informations tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AdminTranslationsController extends AdminTranslationsControllerCore | |
{ | |
public function postProcess() | |
{ | |
if (function_exists('opcache_reset')) { | |
opcache_reset(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} | |
} | |
/** | |
* Quantity update : skip | |
*/ | |
$fieldBuilder->removeField(AFField::FID_QTY); | |
// linia:1354, dodajemy: | |
$fieldBuilder->removeField(AFField::FID_TITLE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:1687 | |
// Common theme images | |
if ($allegroProduct->id_allegro_theme >= 0) { | |
// ... | |
} | |
// dodajemy ten kod | |
foreach (AFField::$FID_IMAGES as $i => $fieldId) { | |
// jesli slot na zdjecie pusty - dodajemy zdjecie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
public function getWidgetVariables($hookName = null, array $configuration = []) | |
{ | |
$category = new Category((int)Configuration::get('PS_HOME_CATEGORY'), $this->context->language->id); | |
if (Configuration::get('BLOCK_CATEG_ROOT_CATEGORY') && isset($this->context->cookie->last_visited_category) && $this->context->cookie->last_visited_category) { | |
$category = new Category($this->context->cookie->last_visited_category, $this->context->language->id); | |
if (Configuration::get('BLOCK_CATEG_ROOT_CATEGORY') == 2 && !$category->is_root_category && $category->id_parent) { | |
$category = new Category($category->id_parent, $this->context->language->id); |
NewerOlder