ltsakiris Posted July 22, 2004 Posted July 22, 2004 I need to have the ability to have authorized users to log in and see wholesale pricining. Does this ability already exist or does anyone know how to do it? Cheers,
♥ecartz Posted July 22, 2004 Posted July 22, 2004 Seperate [sic] Pricing Per Customer and B2BSuite both do this. Hth, Matt Always back up before making changes.
ryanf Posted July 22, 2004 Posted July 22, 2004 I do that on my site, what I did is simple, go to includes/classes/currencies.php. Then in my display_price function I changed it to this: function display_price($products_price, $products_tax, $quantity = 1) { if (tep_session_is_registered('customer_id')) { if($products_price == '0') { return ''; } else { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } } else { if($products_price == '0') { return ''; } else { $products_price = $products_price * YOURMODIFIER; return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } //Master Products EOF } } Easy! Ryan If I was crafty, this would be a funny signature.
csanola Posted July 24, 2004 Posted July 24, 2004 OK ... I see where you set the conditions if (tep_session_is_registered('customer_id')) { But where do you differentiate between Wholesale and Retail customers?
♥ecartz Posted July 24, 2004 Posted July 24, 2004 Ryan's solution is for a Wholesale only site. The two contributions that I mentioned actually provide different prices for different groups. Hth, Matt Always back up before making changes.
Guest Posted July 24, 2004 Posted July 24, 2004 If I only have 3 "wholesale" accounts, could I use Ryan's solution to check if the user is one of these three? Something like (in PL/1) if (user='nkp1050')!(user='user450')!(user='acme products') THEN $products_price = $products_price * .60; This would allow me to bypass installing one of the user modifications.
♥ecartz Posted July 24, 2004 Posted July 24, 2004 if (tep_session_is_registered('customer_id') && (($customer_id == '450') || ($customer_id == '1050') || ($customer_id == '1500'))) { would work for three customers with IDs 450, 1050, and 1500 (remember to replace these with the actual values from the customers table) who get special pricing. Btw, I would write that code as follows function display_price($products_price, $products_tax, $quantity = 1) { if ($products_price == '0') { return ''; } if (tep_session_is_registered('customer_id')) { switch ($GLOBAL['customer_id']) { case '450': case '1050': case '1500': $products_price = $products_price * YOURMODIFIER; break; } return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); //Master Products EOF } } Hth, Matt Always back up before making changes.
Guest Posted July 24, 2004 Posted July 24, 2004 Thanks! I'll let you know how this works out. I appreciate your help.
Guest Posted July 25, 2004 Posted July 25, 2004 Oops! I ran into a slight problem.... I don't know the customer numbers of my customers. The admin panel allows me to display and edit the customers, but does not display their customer number (customer_ID). How can I find these numbers?
♥ecartz Posted July 25, 2004 Posted July 25, 2004 It's in the URL. Look for cID= and the following number is the customers_id. Note: you have to select that customer first. You can also get the info by looking directly in the database with a tool like phpMyAdmin. Hth, Matt Always back up before making changes.
Guest Posted July 25, 2004 Posted July 25, 2004 No matter what I tried, I could not get the price to change when interrogating the customer ID. I stripped the function down to a bare: function display_price($products_price, $products_tax, $quantity = 1) { if ($customer_id == '5') { $products_price = $products_price * .60; } return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } just to see if customer "5" would show the wholesale price, but it did not. So then I took out the test for customer ID altogether: function display_price($products_price, $products_tax, $quantity = 1) { $products_price = $products_price * .60; return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } And this works. All customers now show wholesale prices. I immediately removed this of course, but isn't $customer_ID available to this function? It seems like it is not. Are there any special commands that force this field to be globally accessible?
♥ecartz Posted July 25, 2004 Posted July 25, 2004 You need to either say global $customer_id; prior to use or use $GLOBAL['customer_id'] to access a global variable inside a function. Hth, Matt Always back up before making changes.
Guest Posted July 26, 2004 Posted July 26, 2004 Thank you. This works perfectly; it now shows "wholesale" prices to whichever users I choose; the rest get normal (retail) prices listed.
Guest Posted July 26, 2004 Posted July 26, 2004 Sorry, I spoke too soon! Although the products display with the correct (discounted) prices for selected dealers, the shopping cart adds them at the normal, non-discounted price. I suspect this change (multiply price by .60) has to be made in one or more other modules. Any ideas on which modules this might be?
♥ecartz Posted July 26, 2004 Posted July 26, 2004 The get_products function in includes/classes/shopping_cart.php or the cart function in includes/classes/order.php come to mind. I think the latter is more likely to cover without making it reduce twice. Hth, Matt Always back up before making changes.
Guest Posted August 5, 2004 Posted August 5, 2004 went to includes/classes/order.php anyone know which code to do next to fix the the problem that help to show the actual wholesale price when customer checking out...?
♥ecartz Posted August 6, 2004 Posted August 6, 2004 You could look at the changes in either the Seperate Pricing Per Customer or Quantity Price Break contributions to see which code needs to change. Hth, Matt Always back up before making changes.
Guest Posted August 12, 2004 Posted August 12, 2004 bob or michael, did you ever get this to work? I have MS1 still and want a wholesale pricing solution. neither of the two contribs say they work on MS1. anyway if you did get it working what did you add to the order.php file. Thanks Jeff
Guest Posted August 12, 2004 Posted August 12, 2004 No, this required more changes than I was able to do, so I abandoned the project. I may just have two separate stores, one with wholesale and one with retail prices.
Guest Posted August 12, 2004 Posted August 12, 2004 still working on this... whatever it turn out...i will kept you posted... hang on there... michael
Recommended Posts
Archived
This topic is now archived and is closed to further replies.