*

ishan

  • ****
  • 126 posts
Display Sold Items Count on User Profile
« on: December 24, 2017, 06:33:02 AM »
How to display total sold item counts on user profile and sidebar of item.php under user profile option.

*

MB Themes

Re: Display Sold Items Count on User Profile
« Reply #1 on: December 30, 2017, 10:48:08 AM »
@ishan
Theme does not have such feature. You need to query tables t_item, t_item_veronika, restrict results on logged in user and sum rows where i_sold = 1
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

ishan

  • ****
  • 126 posts
Re: Display Sold Items Count on User Profile
« Reply #2 on: December 30, 2017, 04:07:36 PM »
thanks for your reply,

but i dont know how to use these query so can you mention in detail the i will mention on my site.


*

ishan

  • ****
  • 126 posts
Re: Display Sold Items Count on User Profile
« Reply #3 on: January 01, 2018, 07:57:06 AM »
please give me code of below query, then i will use it

@ishan
Theme does not have such feature. You need to query tables t_item, t_item_veronika, restrict results on logged in user and sum rows where i_sold = 1

*

MB Themes

Re: Display Sold Items Count on User Profile
« Reply #4 on: January 01, 2018, 08:30:59 PM »
@ishan
If I would had it, I would post it there. You can start with:

Code: [Select]
select count(v.i_sold) from prefix_t_item i, prefix_t_item_veronika v where i.pk_i_id = v.fk_i_item_id and i.fk_i_user_id = ' . osc_logged_user_id() . '
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

ishan

  • ****
  • 126 posts
Re: Display Sold Items Count on User Profile
« Reply #5 on: January 02, 2018, 12:41:47 PM »
Quote
<?php $conn = getConnection(); $sold_items = $conn->osc_dbFetchresult("select count(v.i_sold) from prefix_t_item i, prefix_t_item_veronika v where i.pk_i_id = v.fk_i_item_id and i.fk_i_user_id = ' . osc_logged_user_id() . '", DB_TABLE_PREFIX, osc_logged_user_id()) ;?>
<?php echo $sold_items;?>


Can you tell me this code is  ok ?

*

MB Themes

Re: Display Sold Items Count on User Profile
« Reply #6 on: January 02, 2018, 01:07:14 PM »
@ishan

Code: [Select]
<?php 
  $conn 
getConnection(); 
  
$sold_items $conn->osc_dbFetchresult(sprintf('select count(v.i_sold) from %st_item i, %st_item_veronika v where i.pk_i_id = v.fk_i_item_id and i.fk_i_user_id = %d'DB_TABLE_PREFIXDB_TABLE_PREFIXosc_logged_user_id()));

  
print_r($sold_items);
?>



maybe this one
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

ishan

  • ****
  • 126 posts
Re: Display Sold Items Count on User Profile
« Reply #7 on: January 03, 2018, 10:03:02 AM »
@ishan

Code: [Select]
<?php 
  $conn 
getConnection(); 
  
$sold_items $conn->osc_dbFetchresult(sprintf('select count(v.i_sold) from %st_item i, %st_item_veronika v where i.pk_i_id = v.fk_i_item_id and i.fk_i_user_id = %d'DB_TABLE_PREFIXDB_TABLE_PREFIXosc_logged_user_id()));

  
print_r($sold_items);
?>



maybe this one

i tried above code in item.php . but i am facing below error. so please solve this error.

Quote
Array ([count(v.i_sold)] => 0)