Zen Cart Logo
Forums / All Other Contributions/Addons / Hidden Wholesale

Hidden Wholesale

Views: 23,314

Results 21 to 40 of 65
2 Apr 2010, 1:42 PM
#21
jsmith1611 avatar

jsmith1611

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Hidden Wholesale

My client's site is using Zen Cart version 1.3.8 and has all products priced by attributes. He really, really wants to have wholesale pricing available, but only visible to the wholesalers. From what I have read, it looks like this mod will not work properly with products that are priced by attributes because the base price is 0, causing them to become hidden from the retail customers.

Is there any reason why the hide function had to use the price field? Couldn't another field be added to products to determine whether or not they are wholesale products or retail products and hide based on that field?

I am not super skilled in php yet, but it seems like this would be easy enough to do. Anyone else have products priced by attributes that is using this mod? Have you found a workaround?

Any help would be Greatly appreciated.

Thanks,

Josh

2 Apr 2010, 3:03 PM
#22
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Hidden Wholesale

Hi Josh

The approach that you describe is close to what I do, and the reason why I revised this mod (version 2) to centralise the setting of the filter condition to allow users to get around the zero-price restriction (which to be fair the original author recognised as a bit of a hack too).

One approach would be to add one or more extra fields to the products table and then use tweak the init_customer_auth override to use these fields for filtering.

You'd also need to a way for your client to be able to set these fields. The normal way would be to add support for them to the admin/includes/modules files any product type that you clients uses. Though the alternative that I prefer is to customise the Quick Updates mod thus allowing many of them to be changed at once.

2 Apr 2010, 3:58 PM
#23
jsmith1611 avatar

jsmith1611

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Re: Hidden Wholesale

Kuroi, thanks for the reply. You said that the approach I described is close to what you do. Does version 2 already give a way to avoid the issue with the attribute priced products? If not, would you be available to customize the product for a fee?

Thanks,

Josh

2 Apr 2010, 5:28 PM
#24
jsmith1611 avatar

jsmith1611

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Re: Hidden Wholesale

Kuroi, in a previous post for a Zenner that was trying to use Free Products, you suggested:

  $custom_restriction= ' AND (p.products_price > 0 OR p.products_type = 3) ';

Wouldn't it be possible to use the product type for the attribute products to ensure that they aren't hidden as well?

Thanks,

Josh

7 Apr 2010, 9:40 PM
#25
damiendlskinsolution avatar

damiendlskinsolution

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Hidden Wholesale

jackie.taferner:

(...)

$show_categories= false;

if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0') {
$show_categories= true;
} else {
$show_categories= false;
}

if ($show_categories == true) {

> 
> And then add a final closing tag on the end:
> 
> ```php
}

Please note, this is only for those users who have installed Dual Pricing as well as Hidden Wholesale and want ALL categories to be hidden until user is upgraded to level 1 pricing or higher.

Jackie,

Any chance you could help me figure how to hide a particular category instead of all of them?
I've search the Forum as well as Google, but do not see anything about hidding a specific category to non-wholesale customers, only its products.

Any help would be greatly appreciated.

Damien

8 Apr 2010, 1:23 AM
#26
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Hidden Wholesale

damien,

That would be a bit more complex than the code i displayed earlier, because you'll need to specify category ID numbers, etc etc.

But.. this module might help you out: http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=391

I have not used it before, and not sure if it works in conjunction with the wholesale module, but it should be a great start.

My guess is it will block specific categories altogether (whether user logged in or not). If that's the case, we'll fandangle a little extra code to make the module only work if user is logged in.

Backup your files and database first, give the module a whirl, and let me know what the results are.

8 Apr 2010, 2:51 PM
#27
damiendlskinsolution avatar

damiendlskinsolution

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Hidden Wholesale

Jackie,

Thanks for the reply and the tip about the hideCategoriest Mod.
I do have that mod installed already. I never thought about using it combined with a $_SESSION['customer_whole'].

I will look into it and post if I can get something to work.

Thanks again for your time,

Damien

14 Apr 2010, 6:19 AM
#28
mwcourtney avatar

mwcourtney

New Zenner

Join Date:
May 2009
Posts:
1
Plugin Contributions:
0

Re: Hidden Wholesale

Hi, thanks for the module. I have noticed a problem, when "also purchased products" is enabled non-wholesale customers can see the wholesale products and add them to the cart at a $0.00 amount. Not sure if this has been addressed, I did not see a mention of this within this tread or readme file. For now setting the Min and Max to 0 for "also purchased products" disables this display. Any ideas would be of great help, it's a nice feature for customers to see related purchases.

14 Apr 2010, 3:10 PM
#29
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Hidden Wholesale

mwcourtney,

You can hide this in a similar way as the code I have posted above.

Go to /includes/templates/YOURTEMPLATE/templates/tpl_product_info_display.php and find the place where your related products module is. Put the following code around that module's code:

if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0') { 

// Here's where your module code goes

}
26 Apr 2010, 11:59 AM
#30
kezza avatar

kezza

New Zenner

Join Date:
Mar 2010
Location:
The other side where the grass IS greener
Posts:
30
Plugin Contributions:
0

Re: Hidden Wholesale

immortalitea:

If you have a product that is priced by attributes. You must leave the Product Price field blank (otherwise the product price is added to the attribute price). But when the Product Price is left blank, the mod assumes it is a wholesale item and the product is no longer visible to retail customers.

I got round this by making the price 0.0001, this way its not $0 and the product still shows, but it's to small an amount to be added to the attribute price.

27 Apr 2010, 12:08 PM
#31
kezza avatar

kezza

New Zenner

Join Date:
Mar 2010
Location:
The other side where the grass IS greener
Posts:
30
Plugin Contributions:
0

Re: Hidden Wholesale

jackie.taferner:

damien,

That would be a bit more complex than the code i displayed earlier, because you'll need to specify category ID numbers, etc etc.

But.. this module might help you out: http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=391

I have not used it before, and not sure if it works in conjunction with the wholesale module, but it should be a great start.

My guess is it will block specific categories altogether (whether user logged in or not). If that's the case, we'll fandangle a little extra code to make the module only work if user is logged in.

Backup your files and database first, give the module a whirl, and let me know what the results are.

DamienDLSkinSolution:

Jackie,

Thanks for the reply and the tip about the hideCategoriest Mod.
I do have that mod installed already. I never thought about using it combined with a $_SESSION['customer_whole'].

I will look into it and post if I can get something to work.

Thanks again for your time,

Damien

did you get this to work?

27 Apr 2010, 12:57 PM
#32
kezza avatar

kezza

New Zenner

Join Date:
Mar 2010
Location:
The other side where the grass IS greener
Posts:
30
Plugin Contributions:
0

Re: Hidden Wholesale

after installing hideCategories
open includes -> templates -> your template -> sideboxes -> tpl_categories.php

find

//  Begin hideCategories code
    list($nada, $mycpath)= split('=', $box_categories_array[$i]['path']);
    $mycid = split('_', $mycpath);
    $categories_id = array_pop($mycid);
    $hide_status = $db->Execute("select visibility_status 
    				FROM " . TABLE_HIDE_CATEGORIES . "
    				WHERE categories_id = " . $categories_id . "
    				LIMIT 1");
    if ($hide_status->fields['visibility_status'] < 1) {
//  End hideCategories code

replace with

//  Begin hideCategories code
    if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0') {
    } else {
    list($nada, $mycpath)= split('=', $box_categories_array[$i]['path']);
    $mycid = split('_', $mycpath);
    $categories_id = array_pop($mycid);
    $hide_status = $db->Execute("select visibility_status 
    				FROM " . TABLE_HIDE_CATEGORIES . "
    				WHERE categories_id = " . $categories_id . "
    				LIMIT 1");
    				}
    if ($hide_status->fields['visibility_status'] < 1) {
//  End hideCategories code

Kezza

27 Apr 2010, 1:05 PM
#33
damiendlskinsolution avatar

damiendlskinsolution

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Hidden Wholesale

Nope, sorry... My php skills are very limited and I couldn't figure how to call for a category by its ID number (e.g. call for category #10).

The easy way out, at least for what I am looking to achieve, is using the Multi Site add-on.
Both sites would be identical, except for their catalog.

If anyone feels like shedding some lights on hiding an entire category and not just its products, that would be awesome.

27 Apr 2010, 1:16 PM
#34
damiendlskinsolution avatar

damiendlskinsolution

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Hidden Wholesale

@Kezza:
And right when I post this, you got us a solution! :clap:
I'm gonna give it a try right away.

Thank you!!!

27 Apr 2010, 2:24 PM
#35
damiendlskinsolution avatar

damiendlskinsolution

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Hidden Wholesale

@Kezza:
Again, thank you for your help. I tried your code and it works but something bugs me:

It works in the way that it hides the category from the average customer and the wholesale customers can see the category in the Category Side Box.
BUT
as a wholesale customer, once you click on that category link, the all content of the Category Sidebox goes blank. (it's actually "categoriesContent" that goes blank. "categoriesHeading" still shows)
That means as long as you are within this category, it is difficult to navigate to another part of the website.

That's a great start though. Gotta figure that detail and we are golden! :bigups:

27 Apr 2010, 9:31 PM
#36
kezza avatar

kezza

New Zenner

Join Date:
Mar 2010
Location:
The other side where the grass IS greener
Posts:
30
Plugin Contributions:
0

Re: Hidden Wholesale

for now the easy cheats fix is to make sure the hidden cat has a sub cat with the products in it

27 Apr 2010, 9:46 PM
#37
kezza avatar

kezza

New Zenner

Join Date:
Mar 2010
Location:
The other side where the grass IS greener
Posts:
30
Plugin Contributions:
0

Re: Hidden Wholesale

scratch that last post

open includes -> modules -> your template -> product_listing.php

find

//  Begin hideCategories code
$listing_sql = str_replace('WHERE', 'LEFT JOIN ' . TABLE_HIDE_CATEGORIES . ' h ON (p.master_categories_id = h.categories_id) WHERE (h.visibility_status < 2 OR h.visibility_status IS NULL) AND', $listing_sql);
//  End hideCategories code

and replace with

//  Begin hideCategories code
    if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0') {
    } else {
$listing_sql = str_replace('WHERE', 'LEFT JOIN ' . TABLE_HIDE_CATEGORIES . ' h ON (p.master_categories_id = h.categories_id) WHERE (h.visibility_status < 2 OR h.visibility_status IS NULL) AND', $listing_sql);
}
//  End hideCategories code

Kezza

24 May 2010, 7:03 PM
#38
virtbiz_guy avatar

virtbiz_guy

New Zenner

Join Date:
Jun 2009
Posts:
16
Plugin Contributions:
0

Re: Hidden Wholesale

I am using both the dual pricing and the hidden wholesale modules (the later as modified by kuroi). GREAT mods and thank you.

But....when I enter the retail price as 0, as suggested in the readme, no price shows at all when the wholesale customer selects the product. What do I need to do to change this?

Thank you...

25 May 2010, 5:48 PM
#39
virtbiz_guy avatar

virtbiz_guy

New Zenner

Join Date:
Jun 2009
Posts:
16
Plugin Contributions:
0

Re: Hidden Wholesale

Well, my "problem" was my own. I thought I was logged in as the test wholesale customer, but I was not. Logging in as a wholesale customer enables the price to show, just as it should.

Does anyone know of a way to make the words "Retail Price" NOT appear on wholesale products? Even though they are followed by no price, it would be good that those words not appear.

25 May 2010, 6:00 PM
#40
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Hidden Wholesale

This can probably be fixed in a language definitions file.

Go to Tools > Developer Toolkit

and search for the term Retail Price. It will tell you what file it's located in, then you can change the text to a blank space.