If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / Writing a mod to hide products and could do with a little help !

Writing a mod to hide products and could do with a little help !

Locked

Started by drgr33n on 5 Nov 2010, 11:50 AM · Views: 593

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
5 Nov 2010, 11:50 AM
#1
drgr33n avatar

drgr33n

New Zenner

Join Date:
Oct 2010
Posts:
84
Plugin Contributions:
0

Writing a mod to hide products and could do with a little help !

Hey Guys,

I'm currently updating an old mod and would like to hide products from some customers. Everything is in place except I cannot find where to add the code to hide the product after the check.

I've looked at a couple of mods in the contribution section but they use very different techniques and I'm sure it would be a lot simpler that modding like 15 files ?

I was thinking about hooking into something like the enable disable function in the store side and just using a simple if statement to disable the product ?

Any help would be much appreciated !! :P

5 Nov 2010, 3:10 PM
#2
drgr33n avatar

drgr33n

New Zenner

Join Date:
Oct 2010
Posts:
84
Plugin Contributions:
0

Re: Writing a mod to hide products and could do with a little help !

I think I've been a bit vague so I will explain more.

I want to hide products to wholesale customers. I've modded a contribution here called dual prices to do what I need to do except this and I haven't got a clue about what approach to take ?

I've basically added a radio button in the new product screen so you can switch on or off and added a db entry hide_retail to the products table.

Now I want to set to hide the product on the website. I know there's the backbone to hook into available but finding the right approach is another story.

I was thinking around the lines of

$hide_retail = $db->Execute("select product_hide_retail from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");

if ($hide_retail == 1) {
  hide price
} else {
  continue as normal
}

But where would be the best place to add this or is there a function already responsible for hiding products that I can manipulate ?

Help please lol :D