Archiwa tagu: ptag

[fix] WP e-Commerce 3.7.5.3 (ptag Warning: implode error)

Problem with tags which doesnt exist (returned 0 results)…
as You may see by search results from google its quite popular problem (almost 600 error pages)
Update: 1 month gone and google return already 1300 error pages ;P

Problem z tagami które nie istnieją (zwracają 0 wyników)…
jak możesz zauważyć po wynikach wyszukiwania w google, jest to dość popularny problem (prawie 600 stron z błędami)

Aktualizacja: minął 1 miesiąc i google zwraca 1300 stron z błędami ;P

Link: http://tinyurl.com/yfkyzcq

Error code:

Warning: implode() [function.implode]: Invalid arguments passed in /home/xxxxxx/public_html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc_query.php on line 1316

I solved this problem by adding one more „if” which checks „$product_ids” is null or not (in file wpsc_query.php around line 1316)… after this small modification tags working fine and there is any more errors 😉
Rozwiązałem ten problem poprzez dodanie jednego „if” które sprawdza czy „$product_ids” jest puste czy nie (w pliku wpsc_query.php około linii 1316)… po tej małej modyfikacji tagi działają poprawnie i nie ma więcej błędów 😉

Code below…
Kod poniżej…

Replace (around line 1316 in wpsc_query.php)
Zamień (około linii 1316 w wpsc_query.php)

$product_id = implode(",",$product_ids);
 
$sql = "SELECT * FROM ".WPSC_TABLE_PRODUCT_LIST." WHERE id IN (".$product_id.") AND publish IN('1') AND active IN('1')"; //Transom - added publish & active

With
Z

if($product_ids != null) {
$product_id = implode(",",$product_ids);
 
$sql = "SELECT * FROM ".WPSC_TABLE_PRODUCT_LIST." WHERE id IN (".$product_id.") AND publish IN('1') AND active IN('1')"; //Transom - added publish & active
}

If You know better solution, please let me know.
Jeśli znasz lepsze rozwiązanie, daj mi znać.

Update:
In version 3.7.6.x still exist this problem, the only one difference in this solution is changed line number to 1521.
W wersji 3.7.6.x wciąż istnieje ten problem, jedyna różnica w tym rozwiązaniu to zmieniony numer linii na 1521.

Bramka płatności DotPay do WP e-Commerce dostępna tutaj.