Author Topic: private products for certain users  (Read 5133 times)

dimmer450

  • Beginner
  • *
  • Posts: 13
private products for certain users
« on: August 15, 2006, 10:45:33 am »
Hi All,

i have posted analog topic few weeks ago. i'm sorry.

i want have private products for certain users. It's mean that category must be visible only for certain users.

My idea was to customize shop.browse.php and add an interface to category  page in admin panel for select users which could see the category.

I have created a table jos_mv_users_category_xref for puting the user_id and category_id in.
I modyfly shop_browse_queries.php on several places up to select needed entries.

After i put some data in the table. I have try to select directly from mysql  using this code:
SELECT DISTINCT `product_name`,`products_per_row`,`category_browsepage`,`category_flypage`,`jos_vm_product`.`product_id`,`jos_vm_category`.`category_id`,`product_full_image`,`product_thumb_image`,`product_s_desc`,`product_parent_id`,`product_publish`,`product_in_stock`,`product_sku`
FROM (`jos_vm_product`, `jos_vm_category`, `jos_vm_product_category_xref`,`jos_vm_shopper_group`, `jos_vm_users_category_xref`)  # shop_browse_queries.php line 189

LEFT JOIN `jos_vm_product_price` ON `jos_vm_product`.`product_id` = `jos_vm_product_price`.`product_id`
WHERE `jos_vm_product_category_xref`.`category_id`=`jos_vm_category`.`category_id`
AND `jos_vm_product`.`product_id`=`jos_vm_product_category_xref`.`product_id`

AND `jos_vm_category`.`category_id` = `jos_vm_users_category_xref`.`category_id`
AND jos_vm_product.product_parent_id=0
AND `jos_vm_users_category_xref`.`user_id`=63

It works. I need of cource some categories to show all users, but for first it would be enogh for me.
My problem is now i could not put the query in the file back correctly couse of my inexperience in Joomla and Virtuemart.

Debugging means that there is unknow table os_vm_users_category_xref in where clause. 
I'm confusing and dont know to solve this problem. May be there is more complex changes needed?
File ps_category_category.php modufication?

I need to see through process building product lists, but have no intuitiveness where to start and which changes shall be done.

May be someone knows a simpler way?

I hope for help from experts and thanks for attention
 
Dimmer

waisign

  • Jr. Member
  • **
  • Posts: 54
Re: private products for certain users
« Reply #1 on: December 01, 2006, 09:30:50 am »
im interested in this. could u explain further ? thanks.
what im trying to do now is make a simple page where the index ionly shows the VM login. Nothing else.

only when the user logins, they are able to see the products.
The prob is, i already made a menu bar(image type) that resembles/points to the Category page. even without logging in, public users are able to click on the links in the menu. Is there a way where IF the user doesnt login, and he clicks into the links in the menu, we can have "you are not authorised etc..."

which one works best?

How does yours work? pls explain further. thanks :D

Tom

  • Beginner
  • *
  • Posts: 4
Re: private products for certain users
« Reply #2 on: April 16, 2008, 23:47:55 pm »
Is there somthing new for this?