Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-27-2009 10:11:42

slangster
Member
Registered: 04-27-2009
Posts: 4

Discount Code

Hi, I'm new at ClikcCart pro and slowly getting to grips with it.
My question is if it is possible to set an automatic discount so that the customer does not have to enter a code. i.e. some sort of automatic default discount code.
any help wouold be much appreciated.
many thanks.
Simon

Offline

 

#2 04-27-2009 10:20:59

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Discount Code

A custom sales method should be able to accomplish that for you.

Offline

 

#3 04-27-2009 11:18:43

slangster
Member
Registered: 04-27-2009
Posts: 4

Re: Discount Code

Hi Dave,

thanks for this.

Next question: Is it possible to exclude certain product categories from receving this discount code?

many thanks.

Simon

Offline

 

#4 04-27-2009 11:54:17

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Discount Code

Category information isn't carried with products since a product may be in multiple categories.  The custom sales method would need to do the determination whether or not to apply the discount based on the product IDs that are in the shopping cart.

Offline

 

#5 04-28-2009 03:59:16

slangster
Member
Registered: 04-27-2009
Posts: 4

Re: Discount Code

Thanks again, and my apologies...I made a mistake in my question.

What I meant was: is is possible to exclude certain products from receiving the discount, and if so, how do I do this? what coding what I have to insert and where?

many thanks in advance.

Simon

Offline

 

#6 04-28-2009 04:05:05

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Discount Code

The answer is the same, the custom sales method will have to handle excluding IDs if that is what you want.  I'd suggest getting your basic sales method working correctly first then add the exclusion part to it.

Offline

 

#7 04-28-2009 05:05:34

slangster
Member
Registered: 04-27-2009
Posts: 4

Re: Discount Code

Hi Dave,
thanks again.
I think the basic sales method is working fine. We've decided to offer a 30% sale off everything. But the problem is that we also accept donations on the store. We have the donations set up as a product.
So I'm trying to figure out how to do this. I have done a Custom Sales method like you suggested, and that works well - i have it deducting 30% off everything. But where and what do i add to get the product exclusion to this discount? It strikes me that this should be fairly straightforward, and that I am probably missing something here. Any more advice or answers would be muc happreciated.
many thanks.
Simon

Offline

 

#8 04-28-2009 05:17:56

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Discount Code

In the samples provided there's a foreach loop through the cartids variable which is retrieved early in the code.  One of the samples shows how to count the quantity of items in an order using $item['quantity'].  If you use print_r to print the details of the $cartids array you should see that one of the things in the array is the identifier for the product.  That array index is what you'll need to test to see if it is one of the identifiers that you do not want to discount.

Offline

 

#9 11-03-2010 11:15:48

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Discount Code

Where can you find a list of custom sale options?  For instance, this foreach thing.  I want to do something similar to what's mentioned here -- all products in a given category or with ids that begin with a certain string -- get different discount levels.  Can it be done?

Offline

 

#10 11-03-2010 12:36:58

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Discount Code

There are really no custom sale options, you just have what placed into the cart array for the items, as Dave said if you use the print_r statement you will see all there is to work with. If you enter this line in a custom sale method after the cartids is set you will see what is there, this will only print for a superuser account

Code:

$cartids = $this->globals('ecom.checkout_cartids');
$cosess  = $this->globals('ecom.checkout_cosess');

if ($this->globals('core_user.usergroup')=='superuser'){print_r($cartids);}

John

Last edited by dh783 (11-03-2010 12:37:27)

Offline

 

Board footer