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 | |
function getPrestashopPresentedProduct(Context $context, array $product): ProductLazyArray | |
{ | |
$productPresenterFactory= new ProductPresenterFactory($context); | |
$productPresenter = $productPresenterFactory->getPresenter(); | |
$assembler = new ProductAssembler($context); | |
return $productPresenter->present( | |
$productPresenterFactory->getPresentationSettings(), |
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 | |
function seemoreFormatter(string $text, int $wordsLimit = 250):array{ | |
$textInfos = [ | |
'text' => $text, | |
'see_more' => null, | |
]; | |
$words = str_word_count($text, 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
<?php | |
require (dirname(__FILE__) . '/config/config.inc.php'); | |
$scriptKey = 'xjkhjiauuhgiu855wbgfb'; | |
if(Tools::getValue('scriptKey') != $scriptKey){ | |
die('403'); | |
} |
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 | |
function checkIfProductHasPromo(int $idProduct, ?bool $checkValidity = true): bool{ | |
$productObject = new Product($idProduct); | |
if(!Validate::isLoadedObject($productObject)){ | |
return false; | |
} |
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 | |
require(dirname(__FILE__).'/config/config.inc.php'); | |
use PrestaShop\PrestaShop\Adapter\LegacyContext as Context; | |
$product_id = 2318; | |
$id_shop = 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
#!/bin/bash | |
sed -i -r 's/(^_TABLE_PREFIX_\w+)/DROP TABLE migration_database_name.\1 ; CREATE TABLE migration_database_name.\1 LIKE upgrade_database_name.\1; INSERT INTO migration_database_name.\1 SELECT * FROM upgrade_database_name.\1;/g' migration-file-csv.sql |
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/bash | |
FILES_TO_COMMIT=`git status -s | cut -c4-` | |
if [[ ! -z $FILES_TO_COMMIT ]]; then | |
for file in $FILES_TO_COMMIT; do | |
if [[ "$file" == *.php ]]; then | |
./vendor/bin/php-cs-fixer fix "$file" | |
fi | |
done |
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 | |
$access_token = 'oGN3YTBuPizLa5Pwgx8ICvoNn3OqFVFKBOxtwchjs2a8z8vOdEqcUiLWsvjfz5j'; // Change me please !!!! | |
$availables_ip = [ | |
'xx.xx.xx.xx', | |
'yy.yy.yy.yy', | |
]; | |
$log_file = './webhook.log'; | |
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 | |
require(dirname(__FILE__).'/config/config.inc.php'); | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
die('êtes vous sûre de réaliser cette action ?? Veuillez soovergarder votre base de données avant'); |
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/bash | |
git fetch --all | |
git reset --hard origin/develop | |
git pull origin develop:develop |
NewerOlder