Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

Hi there i've got a problem with SPPC in combination with Quick Group Discount module for SPPC (http://www.oscommerce.com/community/contributions,5569).

 

I try to change Quick Group Discount module for SPPC so I can also have discounts for customer group specific prices.

The default way is to edit the price for a group and after that you can add a discount. But when you change the price again the discount is gone. That's what I want to change.

 

Therefore it's nessccensary to alter the products_groups table but when I do, I get a failure when I want to change discount values for a customer group:

1136 - Column count doesn't match value count at row 1

 

insert into products_groups select '1' as customers_group_id, ( 0.5 * p.products_price) as customers_group_discount_price, p.products_id from products p

 

[TEP STOP]

I have nothing changed. Only the table was altered.

The new entry is the same one as customers_group_price (I just renamed the new one into customers_group_discount_price).

 

Can someone help me please?

Share this post


Link to post
Share on other sites

The code line within customer_group_discounts.php (or whem I'm finished in customers_groups.php) is as followes:

//My new line:
		tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_discount_price, p.products_id from products p");
// The original one:
//			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_price, p.products_id from products p");

 

But both are not working.

Share this post


Link to post
Share on other sites
I try to change Quick Group Discount module for SPPC so I can also have discounts for customer group specific prices.

The default way is to edit the price for a group and after that you can add a discount. But when you change the price again the discount is gone. That's what I want to change.

I'm afraid I lost you there.

 

Therefore it's nessccensary to alter the products_groups table but when I do, I get a failure when I want to change discount values for a customer group:

 

I have nothing changed. Only the table was altered.

The new entry is the same one as customers_group_price (I just renamed the new one into customers_group_discount_price).

No change but the table was altered...??

 

The way the Quick Group Discount module works is that it first deletes all the prices for a customer group in the table products_groups, then re-inserts them for all products using the discount you enter.

So every time you use that, all your changes in your new column are gone.

It looks as if you added another column instead of renaming the one for customers_group_price. When you do an insert like that you have to use all columns in the statement.

Share this post


Link to post
Share on other sites

Hello!

 

Is this MOD compatible with

 

Product attributes option type v2.02

 

or would the various attribute types interfere with calculation?

I actually haven't looked into yet, but if anyone already know I would be grateful for an answer as it would save me a lot of time if integration is not possible.

 

thanks!

Share this post


Link to post
Share on other sites

I have this application running beautifully on all of my sites and I consider it an absolute must for any OSCommerce user out there.

 

I do however have a problem. I am trying to implement the "Product Attributes Sort Order" combined with the "AJAX Attribute Manager" but need to rewrite a portion of the SPPC code to properly implement it.

 

The SPPC code string I need to alter is what now replaces this in the original source:

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

so that it will have the functionality of this :

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");

 

Unfortunately I am not a good enough coder to understand the exact construction of the SPPC modules so I am hoping that somebody here can help me make this work as I seem to be only able to break it :(

Share this post


Link to post
Share on other sites
Is this MOD compatible with

 

Product attributes option type v2.02

 

or would the various attribute types interfere with calculation?

In principle yes. I tried it once and it was a pain in the butt. The code in the class shopping_cart was not updated to the osC update of a few years ago (might have changed in the mean time, I posted my version not so long ago in this thread). I never finished product_info.php which looked to be long and tedious because option type has a lot of code in there.

But in principle the mods are compatible.

Share this post


Link to post
Share on other sites
I am trying to implement the "Product Attributes Sort Order" combined with the "AJAX Attribute Manager" but need to rewrite a portion of the SPPC code to properly implement it.

 

The SPPC code string I need to alter is what now replaces this in the original source:

Adding order by pa.attribute_sort to the end of the query will not break the SPPC logic.

Share this post


Link to post
Share on other sites

I have manually installed this contribution (newish install and also has AusPOST contribution), and it *appears* to be working fine in all forms, etc.

 

However, when I try to run sppc_v42_install.sql, I get the following error:

Error

 

SQL query:

 

ALTER TABLE `customers` ADD customers_group_id smallint UNSIGNED NOT NULL default '0',

ADD customers_group_ra enum( '0', '1' ) NOT NULL ,

ADD customers_payment_allowed varchar( 255 ) NOT NULL default '',

ADD customers_shipment_allowed varchar( 255 ) NOT NULL default '',

ADD customers_specific_taxes_exempt varchar( 255 ) NOT NULL default '',

ADD entry_company_tax_id VARCHAR( 32 ) DEFAULT NULL ;

 

MySQL said:

#1060 - Duplicate column name 'customers_group_id'

 

When I test the SPPC and log in as a wholesale customer, it ignores the wholesale price and uses the retail price. I assume this error I am receiving is mostly to blame as MySQL does not have a table listing for wholesale price.

 

Any ideas would be gratefully received!

 

Thanks you.

Share this post


Link to post
Share on other sites
I'm afraid I lost you there.

Ok, the way you have to use Quick Group Discount Module now is on a seperate site (on the admin panel called Customers > Group Discounts). I want to integrate the options you can edit there into the normal group edit site from sppc. So you have a field called group discount in every group and you can delete the site Group Discounts. I'm almost finished with that.

 

No change but the table was altered...??

The only change I did was altering the table for a new price field (the one for the discount price) so the original sppc price field is untouched.

That worked. But when I try to use Quick Group Discount Module now I get the mentioned failure notice. I'm sure there is something wrong with the mentioned sql statement but I dont know what.

 

 

The way my Quick Group Discount Module should work is as followes:

I have the original product price (stored in products > products_price) called for now "PRODUCT PRICE". I also have the special groups prices (stored in products_groups > customers_group_price) called for now "SPPC PRICE" and I want to have a third field just for the new prices build with Quick Group Discount Module (should be stored in products_groups > customers_group_discount_price) called for now "DISCOUNT PRICE".

 

Everytime I change the discount amount DISCOUNT PRICE will be generated out of the discount amount and the sppc price. Also everytime when I change a sppc price the new SPPC PRICE will be stored and if the discount in percent is not zero (I added a new database entry called customers_group_discount within customers_groups to store the entered discount amount) the DISCOUNT PRICE will also be generated new.

 

Within products_info.php I check if the price is a specials price (done by default after osc installation), a SPPC PRICE (done by befault after sppc installation) or a DISCOUNT PRICE (I have written the new code).

I've done that before so I can output the price in a xtc style way: If it's a DISCOUNT PRICE for example the PRODUCT PRICE is lined out, the new price is underneath and both have a surfix like that:

MSRP $ 30.00

Your price $15.00

You save 50.00%

Because of that first I needed the new entry called customers_group_discount (mentioned before).

 

The way the Quick Group Discount module works is that it first deletes all the prices for a customer group in the table products_groups, then re-inserts them for all products using the discount you enter.

So every time you use that, all your changes in your new column are gone.

It looks as if you added another column instead of renaming the one for customers_group_price. When you do an insert like that you have to use all columns in the statement.

Yeah I know. And my new version will use the new generated DISCOUNT PRICE instead of the SPPC PRICE that is used now.

 

 

But coming back to my problem:

To checkout if my modified code is wrong I used a clean osc 2.2rc2a installation merged with a clean sppc 4.2.0 installation in combination of a clean Quick Group Discount Module for SPPC installation. Everything works fine. But when I alter the table (and do nothing else) afterwards I get these failure. So I think the sql statement included in catalog/admin/customer_group_discounts.php (supplied by Quick Group Discount Module for SPPC) must be wrong now beause everything is still the same. There is just a new (additional) entry in the products_groups table that is not used.

And I don't know what I should do to correct the line:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_price, p.products_id from products p");

 

Sorry for my bad and difficult to understand english but I'm not a native english speaker.

Share this post


Link to post
Share on other sites
I have manually installed this contribution (newish install and also has AusPOST contribution), and it *appears* to be working fine in all forms, etc.

 

However, when I try to run sppc_v42_install.sql, I get the following error:

Error

 

SQL query:

 

ALTER TABLE `customers` ADD customers_group_id smallint UNSIGNED NOT NULL default '0',

ADD customers_group_ra enum( '0', '1' ) NOT NULL ,

ADD customers_payment_allowed varchar( 255 ) NOT NULL default '',

ADD customers_shipment_allowed varchar( 255 ) NOT NULL default '',

ADD customers_specific_taxes_exempt varchar( 255 ) NOT NULL default '',

ADD entry_company_tax_id VARCHAR( 32 ) DEFAULT NULL ;

 

MySQL said:

#1060 - Duplicate column name 'customers_group_id'

 

When I test the SPPC and log in as a wholesale customer, it ignores the wholesale price and uses the retail price. I assume this error I am receiving is mostly to blame as MySQL does not have a table listing for wholesale price.

Did you check the structure of the table customers in phpMyAdmin (or whatever you use for managing your MySQL tables) to see if the structure is already changed. Running the install sql is one of the first things you are supposed to do when adding this contribution and if you didn't you would see errors all over the place.

Perhaps you already run it but simply forgot about it (it is a rather lengthy install ;) )

Share this post


Link to post
Share on other sites
There is just a new (additional) entry in the products_groups table that is not used.

But can't be ignored in the sql statement on an insert.

 

From your description it looks like you need something like this:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_price, p.products_id, " . 100 * (1-$p) . " as customers_group_discount from products p");

So if $p = 0.8 your client group gets a (1 - 0.8 ) * 100% = 0.2 * 100% = 20% discount. You don't use it, but you can't leave it out of your sql statement.

Personally, I would have preferred to calculate the discount saving from the known retail price and the customer group price. Less work.

I'm not a native english speaker.

Then that makes two of us.

Share this post


Link to post
Share on other sites
Did you check the structure of the table customers in phpMyAdmin (or whatever you use for managing your MySQL tables) to see if the structure is already changed. Running the install sql is one of the first things you are supposed to do when adding this contribution and if you didn't you would see errors all over the place.

Perhaps you already run it but simply forgot about it (it is a rather lengthy install ;) )

 

 

Thanks for your reply Jan, I think you may be right. I think I already installed the sql file. I was a bit tired when trying to do it! Thank you :-)

Share this post


Link to post
Share on other sites
But can't be ignored in the sql statement on an insert.

 

From your description it looks like you need something like this:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_price, p.products_id, " . 100 * (1-$p) . " as customers_group_discount from products p");

So if $p = 0.8 your client group gets a (1 - 0.8 ) * 100% = 0.2 * 100% = 20% discount. You don't use it, but you can't leave it out of your sql statement.

Personally, I would have preferred to calculate the discount saving from the known retail price and the customer group price. Less work.

 

Then that makes two of us.

Omg, sorry but that's not what I need. I already have a table entry (in customers_groups) where I can store the discount in percent.

I just want to replace products_groups > customers_group_price with another entry (for example let's call it customers_group_discount_price) where I can store the new sppc price including the given discount (for example: 10% * $5.99) without losing the sppc price (stored in products_groups > customers_group_price.

 

Maybe someting like this:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_discount_price, p.products_id, customers_group_price as customers_group_price from products p");

But that's not working.

Share this post


Link to post
Share on other sites
Omg, sorry but that's not what I need. I already have a table entry (in customers_groups) where I can store the discount in percent.

I just want to replace products_groups > customers_group_price with another entry (for example let's call it customers_group_discount_price) where I can store the new sppc price including the given discount (for example: 10% * $5.99) without losing the sppc price (stored in products_groups > customers_group_price.

I can't follow you.

 

Do you want this (then you store twice the same information...)

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_discount_price, p.products_id, ( " . $p . " * p.products_price) as customers_group_price from products p");

Share this post


Link to post
Share on other sites
In principle yes. I tried it once and it was a pain in the butt. The code in the class shopping_cart was not updated to the osC update of a few years ago (might have changed in the mean time, I posted my version not so long ago in this thread). I never finished product_info.php which looked to be long and tedious because option type has a lot of code in there.

But in principle the mods are compatible.

 

Thanks for info. Sounds like I shouldn't even try right now, as time is ticking....

Anyone know of any alternative was to have both mods' functions? Basically I must have text product attributes only in addition to the built in drop downs, but need seperate pricing for retail/wholesale.....

 

thanks again/brgds

Share this post


Link to post
Share on other sites
I can't follow you.

Normaly Quick Discount Module For SPPC creates the discount price based on the product price.

 

I want to change that. So Quick Discounts Module For SPPC creates the discount price only based on the product price if there is no customer group based product price for the choosen customer group. If there is a customer group based product price Quick Discount Module For SPPC should create the discount price based on the customer group based product price.

 

Do you want this (then you store twice the same information...)

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " select '". $sppc['customers_group_id'] ."' as customers_group_id, ( " . $p . " * p.products_price) as customers_group_discount_price, p.products_id, ( " . $p . " * p.products_price) as customers_group_price from products p");

No that also doesn't fit my needs. I don't want to overwrite the customers_products_price with an discount value. I want a new entry for prices with given discount.

 

But I figured out what I need:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * p.products_price), p.products_id from products p");

Sadly this doesn't help me because when I have a product without sppc price (but with a discount) the sppc price is automaticaly set to 0.000. So I created another table called products_groups_discounts (its almost the same table like products_groups).

 

My problem is now: I need a function that goes through the sql entrys and checks if there is a sppc price (products_groups > customers_group_price) or not (just products > products_price) and switches between two insert statements:

If there is no sppc price:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS_DISCOUNTS . " (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * p.products_price), p.products_id from products p where p.products_id=[the actual product id]");

and if there is a sppc price aviable:

			tep_db_query ("insert into " . TABLE_PRODUCTS_GROUPS_DISCOUNTS . " (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * pg.customers_group_price), p.products_id from products_groups pg, products p where p.products_id=[the actual product id]");

 

I already started creating the function:

$products_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p");
$products = tep_db_fetch_array($products_query);

for ($count = 1; $count <= count($products); $count++) {
 if ($products_groups['customers_group_id'] == $sppc['customers_group_id']) { //only use the selected customer group
if ($products_groups['customers_group_price'] == '') { //no customer group price defined
	tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * p.products_price), p.products_id from products p where p.products_id=".$count);
} else if ($products_groups['customers_group_price'] > '0') { //customer group price defined
	tep_db_query ("insert into products_groups_discounts (customers_group_id, customers_group_discount_price, products_id) select ". $sppc['customers_group_id'] .", (" . $p . " * pg.customers_group_price), p.products_id from products_groups pg, products p where p.products_id=".$count." and pg.customers_group_id=". $sppc['customers_group_id']");
}
 }	 
}

But there are some failures within:

1. The customer group check is not working (at the moment the result is always false but meybee I dont need the check).

If I disable these statement:

2. The for statement doesnt work. the result is always only the first product from products table.

3. If I try to generate a discount price for a customer group without a customer price for that product but with a customer price for another group for this product the discount isn't created.

4. When I change the for statement (ending statement = 8) and the first group has a sppc price all products have the same price.

 

So what might be wrong:

1. I dont know but maybe I don't need it.

2. I also doesn't know why. It seems as if the ending statement ($count = count($products)) is wrong.

3. I don't know why.

4. Don't know.

Edited by Grinse

Share this post


Link to post
Share on other sites
Has anyone tried with RC2 yet? I just made SPPC work with it, there is a few changes since instead of javascript they use mysql indexes. I have been checking it and using my calculator and everything seems to be working great. If anyone wants i can upload it and u can compare and see what i did. Maybe you can find any bugs so we can fix it and get a nice RC2 stable version.

 

I have RC2a and i wont install the sppc... they are changes on de database?


Instalación: ADSL VOIP Centralitas Telefónicas.

Tienda: Teléfonos Adaptadores Routers Voz IP

Share this post


Link to post
Share on other sites

Dear Jan, Hi All,

 

Only a small thing, but:

 

SPPC + QPBPP:

User is not logged in and filling up his cart with products which have qty_blocks = 1 in group 0, but > 1 in the group, he belongs to.

After pressing CHECKOUT, he logs in and proceeds to checkout_shipping.

The cart should be updated according to the setting of qty_blocks in his group, but it isn't.

 

Can you please give me a hint?

Thanks!

Share this post


Link to post
Share on other sites

Hello. I'm sure this is an easy thing to do and I'll kick myself once I know how...

 

From the login page, I would like retail customers to be redirected to page_a.php and wholesale customers to be redirected to page_b.php.

 

Where and how do I best go about this?

 

Many TIA!

Share this post


Link to post
Share on other sites
Only a small thing, but:

 

SPPC + QPBPP:

User is not logged in and filling up his cart with products which have qty_blocks = 1 in group 0, but > 1 in the group, he belongs to.

After pressing CHECKOUT, he logs in and proceeds to checkout_shipping.

The cart should be updated according to the setting of qty_blocks in his group, but it isn't.

You are right. The adjust_qty is only called when adding a product to the cart. Not afterward. I needed several hours to get a fix for that. Problems with objects being re-set and still not recognizing the new data. I did this on an older SPPC installation that I added a register_globals contribution too. Had to change a couple of things to make that work.

 

Try this, login.php:

$_SESSION['customer_id'] = $customer_id;
//	   tep_session_register('customer_default_address_id');
$_SESSION['customer_default_address_id'] = $customer_default_address_id;
$_SESSION['customer_first_name'] = $customer_first_name;
//	   tep_session_register('customer_first_name');
// BOF Separate Pricing per Customer
$_SESSION['sppc_customer_group_id'] = $sppc_customer_group_id;
$_SESSION['sppc_customer_group_show_tax'] = $sppc_customer_group_show_tax;
$_SESSION['sppc_customer_group_tax_exempt'] = $sppc_customer_group_tax_exempt;
//	tep_session_register('sppc_customer_group_id');
//	tep_session_register('sppc_customer_group_show_tax');
//	tep_session_register('sppc_customer_group_tax_exempt');
// EOF Separate Pricing per Customer	
$_SESSION['customer_country_id'] = $customer_country_id;
//		tep_session_register('customer_country_id');
$_SESSION['customer_zone_id'] = $customer_zone_id;
//		tep_session_register('customer_zone_id');

	tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");

// restore cart contents
  if (is_object($pfs)) {
  unset($pfs); // now that a new customer_group_id might be set, we need to refill the PriceFormatterStore with the customer group prices
  $pfs = new PriceFormatterStore;
  }	   
	$cart->restore_contents();

class shopping_cart.php:

	function restore_contents() {
// BOF QPBPP for SPPC, adjust quantity according to group settings
  global $languages_id, $pfs, $pf; // $customer_id, 

//  if (!tep_session_is_registered('customer_id')) return false;
  if (!isset($_SESSION['customer_id'])) {   
  return false;
  } else {
  $customer_id = $_SESSION['customer_id'];
  }

// insert current cart contents in database
  if (is_array($this->contents)) {
	reset($this->contents);

	while (list($products_id, ) = each($this->contents)) {
  $qty = $this->contents[$products_id]['qty'];
  $pf = new PriceFormatter;
  $pf->loadProduct($products_id, $languages_id);
  $qty = $pf->adjustQty($qty);

// EOF QPBPP for SPPC, adjust quantity according to group settings

Share this post


Link to post
Share on other sites
Hello. I'm sure this is an easy thing to do and I'll kick myself once I know how...

 

From the login page, I would like retail customers to be redirected to page_a.php and wholesale customers to be redirected to page_b.php.

 

Where and how do I best go about this?

On login.php this is where it happens (so if you click on checkout and get redirected from checkout_shipping, you will be redirected to checkout_shipping after login with this code, sure you want to change that?):

// restore cart contents
	$cart->restore_contents();

	if (sizeof($navigation->snapshot) > 0) {
	  $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
	  $navigation->clear_snapshot();
	  tep_redirect($origin_href);
	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}

Share this post


Link to post
Share on other sites

I am trying to alter my store so that "free shipping if order total is more than $xxx" is only available to retail customers.

 

I am looking in catalog/includes/modules/order_total/ot_shipping.php at lines 29-39

 

if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
       switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
         case 'national':
           if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
         case 'international':
           if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
         case 'both':
           $pass = true; break;
         default:
           $pass = false; break;
       }

 

Would I be able to add an if that says something like: if customer_group != retail then $pass = false?

 

Any help would be appreciated. I understand the logic of PHP but do not have very much experience in writing scripts and syntax. Thanks!

Share this post


Link to post
Share on other sites
On login.php this is where it happens (so if you click on checkout and get redirected from checkout_shipping, you will be redirected to checkout_shipping after login with this code, sure you want to change that?):

// restore cart contents
	$cart->restore_contents();

	if (sizeof($navigation->snapshot) > 0) {
	  $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
	  $navigation->clear_snapshot();
	  tep_redirect($origin_href);
	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}

 

Hi Jan!

 

Thanks for your reply. You're right... I don't want to do that! I want to have a wholesale login page where wholesale users must login first to continue on to the products page. Any retail users inadvertently using the wholesale login page should be redirected back to retail product page. The wholesale and retail products page are very different in structure/style.

 

Does this make more sense? Apologies for not explaining myself more clearly.

Share this post


Link to post
Share on other sites
Thanks for your reply. You're right... I don't want to do that! I want to have a wholesale login page where wholesale users must login first to continue on to the products page. Any retail users inadvertently using the wholesale login page should be redirected back to retail product page. The wholesale and retail products page are very different in structure/style.

 

Does this make more sense? Apologies for not explaining myself more clearly.

If you want to use product_info.php for retail and say productinformation.php for wholesale, perhaps it would work to make an if/else statement in includes/filesnames.php: if isset session sppc_customer_group_id and is wholesale then define("FILENAME_PRODUCT_INFO = productinformation.php) else product_info.php.

Probably you would need to add a redirect somewhere in application top or the pages themselves that if the page asked is the product_info page redirect them to the other.

Haven't tried that...

Share this post


Link to post
Share on other sites
I am trying to alter my store so that "free shipping if order total is more than $xxx" is only available to retail customers.

 

I am looking in catalog/includes/modules/order_total/ot_shipping.php at lines 29-39

 

Would I be able to add an if that says something like: if customer_group != retail then $pass = false?

Provided the code is in there to determine the customer group id (like on product_info.php) then this would seem simpler:

 

if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true' && $customer_group_id == 0) {

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×