Skip to content

Instantly share code, notes, and snippets.

View proudcommerce's full-sized avatar

ProudCommerce proudcommerce

View GitHub Profile
@proudcommerce
proudcommerce / oxid-installmodulesconfig.sh
Last active July 12, 2023 20:54
oe:module:install-configuration for all modules in source/modules/ folder
View oxid-installmodulesconfig.sh
#!/bin/bash
pluginDirs=()
for dir in $(find source/modules/ -type d); do
if [[ -f "${dir}/metadata.php" ]]; then
pluginDirs+=("${dir}")
fi
done
@proudcommerce
proudcommerce / clockify.php
Last active July 11, 2023 06:48
Clockify Webhook Zeitreintrag bearbeiten
View clockify.php
<?php
$rawData = file_get_contents('php://input');
$jsonData = json_decode($rawData);
if(!empty($jsonData->description)) {
$timeEntryId = $jsonData->id;
$workspaceId = $jsonData->workspaceId;
$description = prepareDescription($jsonData->description);
$newTags = prepareTags($jsonData->tags);
}
@proudcommerce
proudcommerce / admin_header_links.tpl
Created July 17, 2020 09:27
Workaround for OXID Admin Logout / Session-Timeout
View admin_header_links.tpl
@proudcommerce
proudcommerce / pc-ide-helper.php
Last active July 11, 2020 06:38
Script to generate a .module-helper.php file for OXID eShop 6.x to resolve _parent classes for the IDE
View pc-ide-helper.php
moved: https://github.com/proudcommerce/oxid-ide-modulehelper
@proudcommerce
proudcommerce / OXID eShop - getLogger fix OXID 6.2
Created May 26, 2020 13:14
Fix for OXID 6.2 circular reference service problems
View OXID eShop - getLogger fix OXID 6.2
# thx to alfred (https://github.com/alfredbez) for sharing
# add to modules/functions.php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
function getLogger() {
@proudcommerce
proudcommerce / OXID eShop - config.inc.php configuration values
Last active March 10, 2020 06:54
Configuration values with default values
View OXID eShop - config.inc.php configuration values
iLangPerTable (8)
= definiert die mögliche Zahl an Sprachtabellen
sLangTableSuffix (_set)
= optionaler Suffix für Sprachtabellen
iPasswordLength (6)
= definiert die Mindestlänge des Kundenpasswortes
blSkipFormatConversion (false)
@proudcommerce
proudcommerce / OXID eShop - Switch oxvendor and oxmanufacturers
Last active July 4, 2020 07:43
Set oxvendor = oxmanufacturers and oxmanufacutrers = oxvendor
View OXID eShop - Switch oxvendor and oxmanufacturers
# 1. Export oxvendors table + data (eg. oxvendor.sql)
# 2. Export oxmanufacturers table + data (eg. oxmanufacturers.sql)
# 3. Clean up manufacturers
DELETE FROM oxmanufacturers;
# 4. Clean up vendors
DELETE FROM oxvendor;
# 5. Replace "oxvendor" with "oxmanufacturers" in oxvendor.sql
# 6. Import oxvendor.sql
# 7. Replace "oxmanufacturers" with "oxvendor" in oxmanufacturers.sql
# 8. Import oxmanufacturers.sql
@proudcommerce
proudcommerce / Rundeck Mattermost Webhook Notification
Created September 9, 2019 12:16
Get data from rundeck webhook notification and send to mattermost.
View Rundeck Mattermost Webhook Notification
<?php
/*
* ProudCommerce | 2019
* www.proudcommerce.com
*
* https://docs.mattermost.com/developer/webhooks-incoming.html
* https://github.com/ThibaudDauce/mattermost-php
*/
require __DIR__ . '/vendor/autoload.php';
@proudcommerce
proudcommerce / OXID eShop - MySQL Snippets
Last active August 2, 2023 12:19
collection of useful and important mysql snippets for the oxid eshop
View OXID eShop - MySQL Snippets
/*** ARTIKEL / ARTICLES ***/
/******************************************************/
/* artikelnamen aller artikel anzeigen, welcher einer bestimmten kategorie zugeordnet sind [proudcommerce.com] */
select oxarticles.oxtitle, oxarticles.OXVARSELECT as Variant, oxcategories.OXTITLE as Kategorie from oxarticles left join oxobject2category on oxarticles.OXID = oxobject2category.OXOBJECTID left join oxcategories on oxcategories.OXID = oxobject2category.OXCATNID where oxcategories.OXROOTID = '<YOUR-CATEGORY-OXID>';
/* variantenpreise (oxvarmin, oxvarmax) anhand der aktuellen artikel aktualisieren [foxido.de] */
UPDATE oxarticles B, (SELECT oxparentid,MIN( oxprice ) AS min ,MAX( oxprice ) AS max FROM oxarticles GROUP BY oxparentid) AS A SET oxvarminprice = A.min, oxvarmaxprice = A.max WHERE B.oxid = A.oxparentid
@proudcommerce
proudcommerce / OXID eShop - check if column exists
Created January 8, 2015 10:53
this function checks if a given column in a given database table exists. thanks to tim from shoptimax for this snippet.
View OXID eShop - check if column exists
protected function _dbColumnExist($sTable, $sColumn)
{
$sDbName = oxRegistry::getConfig()->getConfigParam('dbName');
$sSql = sprintf("SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s' "
. " AND COLUMN_NAME = '%s'",
$sDbName, $sTable, $sColumn);
return oxDb::getDb()->getOne($sSql);
}