Skip to content

Instantly share code, notes, and snippets.

@kermie
Forked from proudcommerce/OXID eShop - MySQL Snippets
Last active August 28, 2015 07:14
Show Gist options
  • Save kermie/d67f57fb3b7c199ab205 to your computer and use it in GitHub Desktop.
Save kermie/d67f57fb3b7c199ab205 to your computer and use it in GitHub Desktop.
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
/*** KATEGORIEN / CATEGORIES ***/
/******************************************************/
/* kategorien finden, bei welchen keine seodaten (meta description) vorhanden sind [proudcommerce.com] */
SELECT * FROM oxcategories WHERE oxid NOT IN (SELECT oxobjectid FROM oxobject2seodata);
/* kategorien finden, bei welchen keine bechreibung (oxlongdesc) vorhanden ist [proudcommerce.com] */
SELECT * FROM oxcategories WHERE oxlongdesc = "" OR length(oxlongdesc) <= 10;
/*** HERSTELLER / MANUFACTURER ***/
/******************************************************/
/* hersteller finden, bei welchen keine seodaten (meta description) vorhanden sind [proudcommerce.com] */
SELECT * FROM oxmanufacturers WHERE oxid NOT IN (SELECT oxobjectid FROM oxobject2seodata);
/*** BENUTZERGRUPPEN / USER GROUPS ***/
/******************************************************/
/* benutzer finden, welche einer bestimmten gruppe zugeordnet sind [foxido.de] */
SELECT * FROM oxuser WHERE oxid IN (SELECT oxobjectid FROM oxobject2group WHERE oxgroupsid = '<YOUR-USERGROUP-OXID>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment