23 $this->_aViewData[
'edit'] = $oArticle =
oxNew(
'oxarticle' );
26 if ( $soxId !=
"-1" && isset( $soxId ) ) {
35 if ( $oArticle->oxarticles__oxparentid->value) {
36 $oParentArticle =
oxNew(
"oxarticle");
37 $oParentArticle->load( $oArticle->oxarticles__oxparentid->value);
38 $this->_aViewData[
"parentarticle"] = $oParentArticle;
39 $this->_aViewData[
"oxparentid"] = $oArticle->oxarticles__oxparentid->value;
43 $sSelect =
"select sum(oxamount) from oxorderarticles ";
44 $sSelect .=
"where oxartid=".$oDB->quote( $soxId );
45 $this->_aViewData[
"totalordercnt"] = $iTotalOrderCnt = (float) $oDB->getOne( $sSelect);
48 $sSelect =
"select sum(oxorderarticles.oxamount) from oxorderarticles, oxorder ";
49 $sSelect .=
"where (oxorder.oxpaid>0 or oxorder.oxsenddate > 0) and oxorderarticles.oxstorno != '1' and oxorderarticles.oxartid=".$oDB->quote( $soxId );
50 $sSelect .=
"and oxorder.oxid =oxorderarticles.oxorderid";
51 $this->_aViewData[
"soldcnt"] = $iSoldCnt = (float) $oDB->getOne( $sSelect);;
54 $sSelect =
"select sum(oxamount) from oxorderarticles where oxstorno = '1' and oxartid=".$oDB->quote( $soxId );
55 $this->_aViewData[
"canceledcnt"] = $iCanceledCnt = (float) $oDB->getOne( $sSelect);
58 $this->_aViewData[
"leftordercnt"] = $iTotalOrderCnt - $iSoldCnt - $iCanceledCnt;
61 $sSelect =
"select oxartid,sum(oxamount) as cnt from oxorderarticles group by oxartid order by cnt desc";
63 $rs = $oDB->execute( $sSelect );
66 if ( $rs !=
false && $rs->recordCount() > 0) {
69 if( $rs->fields[0] == $soxId)
75 $this->_aViewData[
"postopten"] = $iTopPos;
76 $this->_aViewData[
"toptentotal"] = $iPos;
79 $this->_aViewData[
"afolder"] =
$myConfig->getConfigParam(
'aProductfolder' );
80 $this->_aViewData[
"aSubclass"] =
$myConfig->getConfigParam(
'aArticleClasses' );
82 return "article_overview.tpl";