Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Discount Per Quantity vs Customer Groups


Daffodil

Recommended Posts

I want a discount of 10% to be calculated on an entire order when someone buys 2 or more products. I added the Discount Per Quantity sort order contribution (thanks!) and it works fine.

 

However, I have 3 customer groups set up - retail, wholesale and dropship. I want the discount not to be applied for wholesale and dropship customers. Is it possible to put in some code to effectively 'hide' the quantity discount for those groups?

 

Any help or advice would be very much appreciated! Thanks :)

Edited by Daffodil
Link to comment
Share on other sites

I need something extra that will discount order total based on the quantity of products ordered by one customer group only.
I think there is often something like a check on whether a order total module is enabled or not. Like in ot_total.php:

	function ot_total() {
  $this->code = 'ot_total';
  $this->title = MODULE_ORDER_TOTAL_TOTAL_TITLE;
  $this->description = MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION;
  $this->enabled = ((MODULE_ORDER_TOTAL_TOTAL_STATUS == 'true') ? true : false);

Can't you use that to disable that module based on $_SESSION['sppc_customer_group_id'] (0 for retail) ?

Link to comment
Share on other sites

I think there is often something like a check on whether a order total module is enabled or not. Like in ot_total.php:

	function ot_total() {
  $this->code = 'ot_total';
  $this->title = MODULE_ORDER_TOTAL_TOTAL_TITLE;
  $this->description = MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION;
  $this->enabled = ((MODULE_ORDER_TOTAL_TOTAL_STATUS == 'true') ? true : false);

Can't you use that to disable that module based on $_SESSION['sppc_customer_group_id'] (0 for retail) ?

 

Thanks Jan. I see what you are saying and have found the relevant bit of code in the mod I installed but have no idea how to do what you suggest (not a coder :( )

 

Thanks for your help, I really appreciate it :)

Link to comment
Share on other sites

I see what you are saying and have found the relevant bit of code in the mod I installed but have no idea how to do what you suggest

How about:

// BOF Separate Pricing Per Customer 
  global $sppc_customer_group_id;
  if(!tep_session_is_registered('sppc_customer_group_id')) { 
	$this->cg_id = '0';
	  } else {
	$this->cg_id = $sppc_customer_group_id;
 }
// EOF Separate Pricing Per Customer

 $this->enabled = ((MODULE_ORDER_TOTAL_TOTAL_STATUS == 'true' && ($this->cg_id == '0')) ? true : false);

Link to comment
Share on other sites

How about:

// BOF Separate Pricing Per Customer 
  global $sppc_customer_group_id;
  if(!tep_session_is_registered('sppc_customer_group_id')) { 
	$this->cg_id = '0';
	  } else {
	$this->cg_id = $sppc_customer_group_id;
 }
// EOF Separate Pricing Per Customer

 $this->enabled = ((MODULE_ORDER_TOTAL_TOTAL_STATUS == 'true' && ($this->cg_id == '0')) ? true : false);

 

Thank you so much for that Jan. I have it working now and really appreciate your help! :D

Edited by Daffodil
Link to comment
Share on other sites

  • 3 months later...

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...