Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

WS5 Wholesale Addon


GLWalker

Recommended Posts

This is the support thread for WS5 Wholesale Addon, http://addons.oscommerce.com/info/9086

 

This addon is a very simple, yet an effective way to handle giving customers a wholesale price. It has been built as lightweight as possible, and more than likely will be best suited as a "starting point" for a shops wholesale needs.

 

 

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Hi.  Thank you for this contribution!  It works beautifully!  I am very excited to have it as it will cut down on a lot of extra work.  (My wholesale needs are very basic.)  The only area I'm running into a little difficulty is how to charge my wholesale clients shipping while I not charging my retail customers. Is this something you could add or am I really pushing my luck by asking?  :P  Of course, if I just complicated things tremendously or if you have to worry about all the other people who will now start asking "can you also add..." then just pretend you didn't see my inquiry.  I really do appreciate the contribution on its on merit! Truly. :)

Link to comment
Share on other sites

Thanks for your feedback.

 

I set a new weight option to help deal with different shipping cost. Having free for retail and a price for wholesale could be worked out a few different ways, a lot depends on how you currently are set up to offer the retail free price.

 

Using the wholesale session is the key though, if it exist - do this, if not then default action.

 

It does make me think that many selling in bulk may also not want to offer free shipping for orders over a set amount that retail orders enjoy, so that would be a fairly straightforward change in checkout_shipping, looking for a wholesale session.

 

Helpful snippets for varoius procedures that do not fall too far outside the boundaries of a default set up would be good to post here.

 

Leave more details about how you are currently setup and we'll see what can be done.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Thank you for replying! Currently I just have the Flat Rate shipping module set at $0 and Shipping in the Order Total module set "true" to "Allow Free Shipping".  (Seems rather redundant, how I've done that, now that I'm looking at it.)  My thought is a flat rate shipping charge for wholesale orders (my products are not heavy to ship) and no shipping charge for my retail orders.  Is that the information you need?

 

I appreciate your looking into this!

Link to comment
Share on other sites

Sorry for the delay.

 

Ive checked out how your setup on my local, and this is what I came up with.

 

Set up your flat rate shipping quote for any price you want (in fact I think you could also switch to table or any other method in the future)

 

Next - set up your free shipping order_total module to allow free shipping for 0.00 in your case.

 

Now open checkout_shipping.php; around line 101 find:

// process the selected shipping method
  if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken) ) {

Above that add:

  /* WS5 Wholesale - skip free shipping */  
  if (tep_session_is_registered('wholesale_customers_id')) {
	$free_shipping = false;
  } else {
    $free_shipping = true;
  }
  /* end WS5 Wholesale */

Next open includes/modules/order_total/shipping.php and around line 40 find:

        if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
          $order->info['total'] -= $order->info['shipping_cost'];
          $order->info['shipping_cost'] = 0;
        }

Replace with this:

  /* WS5 Wholesale - skip free shipping */  
	if (!tep_session_is_registered('wholesale_customers_id')) {

        if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
          $order->info['total'] -= $order->info['shipping_cost'];
          $order->info['shipping_cost'] = 0;
        }
      }
  /* end WS5 Wholesale */

The change in  checkout_shipping.php file will set the free shipping quotes to false if logged in as a wholesale customer.

The order_total module change will keep the free shipping quote from triggering on the checkout confirmation page.

 

 

This should work for any store that does not want to give out free shipping VIA order_total module.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

The above code has a small flaw.

 

in checkout_shipping.php :

/* WS5 Wholesale - skip free shipping */  
  if (tep_session_is_registered('wholesale_customers_id')) {
	$free_shipping = false;
  } else {
    $free_shipping = true;
  }
  /* end WS5 Wholesale */

Should be:

/* WS5 Wholesale - skip free shipping */  
  if (tep_session_is_registered('wholesale_customers_id')) {
	$free_shipping = false;
  }
  /* end WS5 Wholesale */

In case of @@xChrysalisx set up, it would work as it was, but if one wants to charge shipping to retail customers, then they need to use the updated snippet above. Otherwise the free shipping will always be triggered for retail.

 

@@xChrysalisx I still recommend changing yours to the above snippet in case you start charging retail shipping in the future. Its too easy to forget making small changes then wondering why something doesn't work later :)

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

  • 3 weeks later...

I find this contribution extremely useful and first of all, i want to say thanks to you.

 

But i have a problem.

 

After 3 unsuccesfull installations i end up to the same results. I cannot install the module. So, i have 2 questions :

 

 

1) Why the original catalog-logoff.php file included in the vanilla oscommerce 2.3.3.4 is different than the one provided with this package ? There are not only the new lines of code, but is alltogether different

 

2) I cannot follow the following directions

 

Activate Module

Navigate to your admin's Modules->Content.
Click "Install Module" button.
Choose "Wholesale Login Form".
Click "Install Module" button.
Configure options and save.
This will also build 2 new tables in your database, customers_to_wholesale & products_to_wholesale

Next remove your existing Login Form.

 

 

since in my admin - modules menu i dont see any "Content" choice and if i go to admin- catalog - wholesale the result is offcourse the following error message

 

1146 - Table 'oscommerce.products_to_wholesale' doesn't exist

select count(*) as total from products p, products_to_wholesale w, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = w.products_id

[TEP STOP]

 

 

I would appreciate any help,

 

Regards George

Link to comment
Share on other sites

I must apologise.

 

The problem was that my hard drive died and seems it was malfuctioning for some time now. And because i am working on a local installation with xampp+oscommerce 2.3.4 many files in both of them were corrupted. So I ll try again tomorrow fresh.

 

Please ignore my previous post.

Link to comment
Share on other sites

@@29gk

As Gary mentioned, it is written for 2.3.4. It sounds like your going to reinstall 2.3.4 do you shouldn't have any issues on a fresh install. Please post if you do.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

  • 3 weeks later...

@@29gk

As Gary mentioned, it is written for 2.3.4. It sounds like your going to reinstall 2.3.4 do you shouldn't have any issues on a fresh install. Please post if you do.

So we are saying that a major rewrite would be required to get this to work in 2.3.3.4?

Link to comment
Share on other sites

@@RMD27

Well its always good practice to go with the latest versions, as with osCommerce when there is a new version its not a bunch of fluff, but actually beneficial changes.

 

If you have too much put into your existing site and wish not to upgrade, the code that is located in the content module can be ported over without toooo much hassle. Its basically the check for a wholesale id. You can compare the content module code to the similar code inside login.php on 2.3.3.4 and see where the query should go. All other files that are modified are pretty much the same in any 2.3 version.

 

You will run into one other hickup with the database tables and module setting though. You could convert everything to a header_tag module and install that way, or create a new group in the configuration table and import the configuration values there, and then manually dump the 2 new tables as well.

 

Let me know which way you want to proceed so I can be of more help.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

@ - Thank you for taking the time but I think the changes are beyond me. My store is super heavily modified.

 

I compared my login.php to the login.php in 2.3.4 and its almost totally different.

 

I also had a look at includes/modules/content/login/create_account_link and it looks almost totally different also

Link to comment
Share on other sites

  • 4 weeks later...

Hello GL Walker,

Thank you for this contribution.

I have it installed, and my issue is that the wholesale prices are showing all the time.

I don't really want the general public to see the wholesale pricing, just the customers who are registered and only if I click the red button to green.

 

I am not very skilled at this, but I can follow directions.

 

My site is at wescosa-fl.com/catalog/index.php

 

Any thoughts?

 

Thanks,

Moose

Link to comment
Share on other sites

I would double check the code in product_info.php to be sure it is checking that the wholesale session is there. It sounds like it is bypassing it, or perhaps your browser has the session set and you are always seeing the wholesale price, so I would also check the loggoff file to be sure the code for unregestering the session is in place.

Edited by WebSource 5

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Just checked your site, you did not happen to use the specials form to add in your wholesale prices did you? :(

 

Every product I see has the specials markup around the source. If so let me know in PM - I can help you convert the tables so you don't have to go through all that data entry again, looks like over 6000 products.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Unless you modified the code in easy populate, there's no way it would have inserted the wholesale price into the wholesale table. I have not looked at easy populate in several years, but do believe it must be capable of inserting into the specials table.

 

If you look at your specials table and products_to_wholesale table in phpMyAdmin, I think you will find the products_to_wholesale table empty, and specials table populated instead.

 

If this is the case, then the data can still be ported from one table to the other, but will take some modifications.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Hey GL,

 

Just so you know, without your help I would still be scratching my head.

 

What I found was that every item in my cart was set up as a special, and there were two items in the wholesale table.

 

So, being the novice that I am, I backed up my database and then went to php myadmin and downloaded the specials as a csv.

 

Then I went to products to wholesale and downloaded that table.

 

I studied the top row in the products to wholesale and created a csv file to upload.

 

Then I deleted all of the specials via php my admin.

 

I think it's right now.

 

Let me know when you get anywhere near Daytona Beach Florida.

 

I'm buying you a lobster dinner!

 

Moose

 

Unrelated topic: I would like to use other contributions, but there are very few that are for v2.3.4

I really need to find a way to handle minimum order quantities per item.

And there are other contributions that look very useful but the version is wrong.

Is it possible that contributions might work despite the version, or is that a dream that will never come true?

Link to comment
Share on other sites

  • 1 month later...

Okay, so I installed this on 2.3.4.

 

An issue

 

On the login form I get 2 email & password boxes showing for the wholesale customers and no login box for normal customers.

 

If I go to the Admin > Content Modules and disable the normal login box I get one wholesale login box

 

And if I disable the wholesale box and activate the normal login box I still only get the wholesale box.

 

Basically it seems wholesale login box has taken over the normal login box as well

 

Could this be something to do with the javascript that is on the login.php page?

 

By box I mean the block that asks for email address and password

 

Do I have to disable the normal login box when I have installed WS5?

Edited by RMD27
Link to comment
Share on other sites

Without looking it almost sounds as if a key is not uninstalling from the configuration table, I'll double check my code when I get a couple minutes.

 

But to answer the question, only the wholesale login box should be installed - it will allow both retail and wholesale login. All it really does is set a session for wholesale user if the customers id exist in the wholesale customers table.

Edited by WebSource 5

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...