Da auf der Startseite die “Schnäppchen”-Liste nicht angezeigt wurde, habe ich den Ablauf debugged, und folgendes Problem festgestellt:
Die Abfrage der “Schnäppchen”-Liste wird im Shop mit folgendem SQL ausgeführt:
select
oxv_oxarticles_de.oxid
from
oxactions2article
left join
oxv_oxarticles_de on oxv_oxarticles_de.oxid = oxactions2article.oxartid
left join
oxactions on oxactions.oxid = oxactions2article.oxactionid
where
oxactions2article.oxshopid = 'oxbaseshop' and
oxactions2article.oxactionid = 'oxbargain' and
( OXV_OXACTIONS_DE.OXACTIVE = 1 or ( oxv_oxactions_de.oxactivefrom < '2011-10-09 06:10:38' and oxv_oxactions_de.oxactiveto > '2011-10-09 06:10:38' ) ) and
oxv_oxarticles_de.oxid is not null and
( OXV_OXARTICLES_DE.OXACTIVE = 1 and ( oxv_oxarticles_de.oxstockflag != 2 or ( oxv_oxarticles_de.oxstock + oxv_oxarticles_de.oxvarstock ) > 0 ) and
IF( oxv_oxarticles_de.oxvarcount = 0, 1, ( select 1 from oxv_oxarticles_de as art where art.oxparentid=oxv_oxarticles_de.oxid and ( art.oxactive = 1 ) and ( art.oxstockflag != 2 or art.oxstock > 0 ) limit 1 ) ) )
order by
oxactions2article.oxsort
Da im Code damit keine Liste entstand, habe ich das SQL mit PHPMyAdmin direkt auf die DB angewendet, und bekam folgende Fehlermeldung:
#1054 - Unknown column ‘oxv_oxactions_de.oxactive’ in ‘where clause’
In der DB-Struktur ist das Feld “oxactive” aber vorhanden!
die WHERE Klausel sagt quasi in [B]oxv_oxarticles_de[/B] zu suchen, obwohl es gar nicht da ist, da es nicht vom sql join “eingefügt” wurde. Ersetzt man “oxactions” durch “oxv_oxactions_de”, so müsste es funktionieren. Im 2. Schritt hat die Abfrage dnan wegen caps lock gemeckert.
So hat es dann bei mir funktioniert:
select
oxv_oxarticles_de.oxid
from
oxactions2article
left join
oxv_oxarticles_de on oxv_oxarticles_de.oxid = oxactions2article.oxartid
left join
oxv_oxactions_de on oxv_oxactions_de.oxid = oxactions2article.oxactionid
where
oxactions2article.oxshopid = 'oxbaseshop' and
oxactions2article.oxactionid = 'oxbargain' and
( oxv_oxactions_de.oxactive = 1 or ( oxv_oxactions_de.oxactivefrom < '2011-10-09 06:10:38' and oxv_oxactions_de.oxactiveto > '2011-10-09 06:10:38' ) ) and
oxv_oxarticles_de.oxid is not null and
( oxv_oxarticles_de.oxactive = 1 and ( oxv_oxarticles_de.oxstockflag != 2 or ( oxv_oxarticles_de.oxstock + oxv_oxarticles_de.oxvarstock ) > 0 ) and
IF( oxv_oxarticles_de.oxvarcount = 0, 1, ( select 1 from oxv_oxarticles_de as art where art.oxparentid=oxv_oxarticles_de.oxid and ( art.oxactive = 1 ) and ( art.oxstockflag != 2 or art.oxstock > 0 ) limit 1 ) ) )
order by
oxactions2article.oxsort
Da ich nun wirklich wenig Ahnung von SQL und Views habe, würde ich mich selbst auf meinen Lösungsansatz nicht verlassen. Vielleicht meldet sich ja jemand aus dem developer Team
die WHERE Klausel sagt quasi in [B]oxv_oxarticles_de[/B] zu suchen, obwohl es gar nicht da ist, da es nicht vom sql join “eingefügt” wurde. Ersetzt man “oxactions” durch “oxv_oxactions_de”, so müsste es funktionieren. Im 2. Schritt hat die Abfrage dnan wegen caps lock gemeckert.
So hat es dann bei mir funktioniert:
select
oxv_oxarticles_de.oxid
from
oxactions2article
left join
oxv_oxarticles_de on oxv_oxarticles_de.oxid = oxactions2article.oxartid
left join
oxv_oxactions_de on oxv_oxactions_de.oxid = oxactions2article.oxactionid
where
oxactions2article.oxshopid = 'oxbaseshop' and
oxactions2article.oxactionid = 'oxbargain' and
( oxv_oxactions_de.oxactive = 1 or ( oxv_oxactions_de.oxactivefrom < '2011-10-09 06:10:38' and oxv_oxactions_de.oxactiveto > '2011-10-09 06:10:38' ) ) and
oxv_oxarticles_de.oxid is not null and
( oxv_oxarticles_de.oxactive = 1 and ( oxv_oxarticles_de.oxstockflag != 2 or ( oxv_oxarticles_de.oxstock + oxv_oxarticles_de.oxvarstock ) > 0 ) and
IF( oxv_oxarticles_de.oxvarcount = 0, 1, ( select 1 from oxv_oxarticles_de as art where art.oxparentid=oxv_oxarticles_de.oxid and ( art.oxactive = 1 ) and ( art.oxstockflag != 2 or art.oxstock > 0 ) limit 1 ) ) )
order by
oxactions2article.oxsort
Da ich nun wirklich wenig Ahnung von SQL und Views habe, würde ich mich selbst auf meinen Lösungsansatz nicht verlassen. Vielleicht meldet sich ja jemand aus dem developer Team
Viele Grüße
und einen schönen Sonntag euch noch[/QUOTE]
Das macht doch schon mal sehr viel Sinn, und löst, so weit ich sehen kann, auch das Problem!