WordPress e-Commerce. Problems with counting items
-
Hi,
I am not sure if this is the right place to ask such a question, but I hope someone here had the same.
I have WordPress 2.6.5, patched from 2.6.3. When it was 2.6.3 – I set up e-Commerce 3.6.8
As I remember, there was no such problem.
When I add new item to eCommerce – the count of its category goes up like +1. But when I delete the item – count does not go down. As a result – the count of each category shows numbers like, but in fact there are no items in those categories.
Function of deleting item in display-item.php :
if(is_numeric($_GET[‘deleteid’])) {
$wpdb->query(“DELETE FROM".$wpdb->prefix."wpsc_productmetaWHEREproduct_id= ‘”.$_GET[‘deleteid’].”‘ ANDmeta_keyIN (‘url_name’)”);
$wpdb->query(“UPDATE".$wpdb->prefix."product_listSETactive= ‘0’ WHEREid='”.$_GET[‘deleteid’].”‘ LIMIT 1″);
}Function of counting items in category to show it on page:
$count_sql = “SELECT count(*) FROM
".$wpdb->prefix."item_category_associationsWHEREcategory_id= ‘”.$option[‘id’].”‘”;
$count = $wpdb->get_var($count_sql);
$addCount = ” [“.$count.”]”;Hope to get some help
Sorry for my english
Best regards,
Konstantin. -
Unfortunately it is not the right place: this is wp.COM, you must be at wp.ORG.
- The topic ‘WordPress e-Commerce. Problems with counting items’ is closed to new replies.