WordPress e-Commerce. Problems with counting items

  • Unknown's avatar

    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_productmeta WHERE product_id = ‘”.$_GET[‘deleteid’].”‘ AND meta_key IN (‘url_name’)”);
    $wpdb->query(“UPDATE ".$wpdb->prefix."product_list SET active = ‘0’ WHERE id='”.$_GET[‘deleteid’].”‘ LIMIT 1″);
    }

    Function of counting items in category to show it on page:

    $count_sql = “SELECT count(*) FROM ".$wpdb->prefix."item_category_associations WHERE category_id = ‘”.$option[‘id’].”‘”;
    $count = $wpdb->get_var($count_sql);
    $addCount = ” [“.$count.”]”;

    Hope to get some help

    Sorry for my english

    Best regards,
    Konstantin.

  • Unknown's avatar

    Unfortunately it is not the right place: this is wp.COM, you must be at wp.ORG.

    http://wordpress.org/support/

  • The topic ‘WordPress e-Commerce. Problems with counting items’ is closed to new replies.