Skip to content

Instantly share code, notes, and snippets.

View kermie's full-sized avatar

Marco Steinhaeuser kermie

View GitHub Profile
@kermie
kermie / oxcmp_user.php
Created July 1, 2016 21:22 — forked from suabo/oxcmp_user.php
oxcmp_user.php v.4.5.4 with Seccurity fix from 4.9.9
<?php
/**
* This file was modified to fix the security bulletin 2016-001!
*/
/**
* This file is part of OXID eShop Community Edition.
*
* OXID eShop Community Edition is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
<?php
// ===================================================
// = place this file in the root of your OXID eShop! =
// ===================================================
require_once 'bootstrap.php';
// CONFIG
$sTheme = 'azure';
$iLangId = 0; // German
@kermie
kermie / OXID eShop - MySQL Snippets
Last active August 28, 2015 07:14 — forked from proudcommerce/OXID eShop - MySQL Snippets
collection of useful and important mysql snippets for the oxid eshop
/*** 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
grep -R --include=*.tpl '\boxmultilang\b' tpl/ | sed -r "s/ident=([^$])/\\nident=\1/g" | grep ^ident= | sed -r 's/}.*$//' | tr "'" '"' | sort -u | while read LINE; do KEY=$(echo "$LINE" | awk -F'"' '{print$2}'); echo -e $LINE"\t"$KEY"\t"$(grep -Rl --include=*.php $KEY ./ | wc -l); done | grep 0$
@kermie
kermie / languages.tpl
Last active August 29, 2015 14:11
Changed languages.tpl (OXID eShop) for displaying language names instead of flags
[{oxscript include="js/widgets/oxflyoutbox.js" priority=10 }]
[{oxscript add="$( '#languageTrigger' ).oxFlyOutBox();"}]
[{if $oView->isLanguageLoaded()}]
<div class="topPopList">
[{capture name="languageList"}]
[{foreach from=$oxcmp_lang item=_lng}]
[{assign var="sLangImg" value="lang/"|cat:$_lng->abbr|cat:".png"}]
[{if $_lng->selected}]
[{capture name="languageSelected"}]
<a style="width:auto;" title="[{$_lng->name}]" href="[{$_lng->link|oxaddparams:$oView->getDynUrlParams()}]" hreflang="[{$_lng->abbr }]">[{$_lng->name}]</a>
<?php
//WARNING: this file deletes content from DB! be careful!
// Use this in a oxid e-sales shop 4.7.0 or higher
//if you understand, remove or comment the next line:
die('Please read the comments!');
include('bootstrap.php');
/**
* defines 'php model class' => 'database table'
*/
@kermie
kermie / gist:9597158
Created March 17, 2014 10:40
remove all product and category items at once
TRUNCATE TABLE `oxarticles`;
TRUNCATE TABLE `oxcategories`;
TRUNCATE TABLE `oxcategory2attribute`;
TRUNCATE TABLE `oxartextends`;
TRUNCATE TABLE `oxaccessoire2article`;
TRUNCATE TABLE `oxactions2article`;
TRUNCATE TABLE `oxobject2action`;
TRUNCATE TABLE `oxobject2article`;
TRUNCATE TABLE `oxobject2attribute`;
TRUNCATE TABLE `oxobject2category`;
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @copyright (c) Proud Sourcing GmbH | 2013
* @link https://gist.github.com/proudcommerce
* @version 1.0.0
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @copyright (c) Proud Sourcing GmbH | 2013
* @link https://gist.github.com/proudcommerce
* @version 1.0.0
@kermie
kermie / getprice.php
Created June 5, 2013 19:27
getPrice() method in OXID eShop 4.7.5
public function getNettoPrice()
{
if ( $this->_blNetPriceMode ) {
return oxRegistry::getUtils()->fRound($this->_dNetto);
} else {
return $this->getBruttoPrice() - $this->getVatValue();
}
}