Fehlermeldung Export: personal offers by customers status doesn't exist

Aus Wiki | modified eCommerce Shopsoftware
Zur Navigation springenZur Suche springen

Beim Export erhalte ich eine Fehlermeldung.

1146 - Table 'db******-****.personal_offers_by_customers_status_' doesn't exist 
SELECT * FROM personal_offers_by_customers_status_ WHERE products_id = '1'ORDER BY quantity


Antwort von Hendrik 02.2008


admin/includes/classes/import.php, Zeile 660

Wenn Kundenstatus neu angeleget wurden und gelöscht befinden sich Lücken in der ID-Folge. Damit kommt die Exportroutine nicht klar.

Original:

            for ($i = 0; $i < count($this->Groups) - 1; $i ++) {
                $price_query = "SELECT * FROM ".TABLE_PERSONAL_OFFERS_BY.$this->Groups[$i +1]['id']." WHERE products_id = '".$export_data['products_id']."'ORDER BY quantity";
                $price_query = xtc_db_query($price_query);
                $groupPrice = '';
                while ($price_data = xtc_db_fetch_array($price_query)) {
                    if ($price_data['personal_offer'] > 0) {
                        $groupPrice .= $price_data['quantity'].':'.$price_data['personal_offer'].'::';
                    }
                }
                $groupPrice .= ':';
                $groupPrice = str_replace(':::', '', $groupPrice);
                if ($groupPrice == ':')
                    $groupPrice = "";
                $line .= $this->TextSign.$groupPrice.$this->TextSign.$this->seperator;

            }

Bugfix:

            foreach($this->Groups as $i => $groups) {
                $price_query = "SELECT * FROM ".TABLE_PERSONAL_OFFERS_BY.$this->Groups[$i]['id']." WHERE products_id = '".$export_data['products_id']."'ORDER BY quantity";
                $price_query = xtc_db_query($price_query);
                $groupPrice = '';
                while ($price_data = xtc_db_fetch_array($price_query)) {
                    if ($price_data['personal_offer'] > 0) {
                        $groupPrice .= $price_data['quantity'].':'.$price_data['personal_offer'].'::';
                    }
                }
                $groupPrice .= ':';
                $groupPrice = str_replace(':::', '', $groupPrice);
                if ($groupPrice == ':')
                    $groupPrice = "";
                $line .= $this->TextSign.$groupPrice.$this->TextSign.$this->seperator;

            }