PDA

View Full Version : Discounts query


NickD
02-Aug-2003, 09:58 AM
With Catalog 6.1.3, does anyone know a way of applying the discount feature only if customers enter a code? eg most people pay standard prices, but if those in the know type in "kjh256fdr" or some such secret code, the discounts kick in?

Nick

NormanRouxel
02-Aug-2003, 11:14 AM
Here's an idea that might be worth developing.

Say you have product reference XYZ123. You could create a hidden product in the same section reference XYZ123-kjh256fdr priced at the discounted rate and add some Javascript to the original product that displays a textfield for the code and then emulates a submit button with the code appended to the submitted product reference. If the customer gets it wrong the product is "not found".

You could also verify the code within the Javascript but some Jascript hackers might be able to infer the code by looking at the source unless you obfuscate it somewhat.

Norman

NormanRouxel
02-Aug-2003, 04:29 PM
Attached are some notes on making a secret code buy a discounted product.

Norman

BSO
30-Aug-2003, 07:07 PM
Hi There,
I think this is great idea.
I have tried it with 6.1.3 but unfortunately I cannot get it to work.

Has anyone managed it or got any suggestions.

When I try to order using the secret code there is an error and it adds the full priced item to the basket.

Any help appreciated.

Simon

BSO
07-Sep-2003, 08:58 PM
can anyone help with this please?

Like I say there seems to be a script error and then it adds the full priced item to the cart.

Very close, would like to get it working.

Thanks

Simon

NormanRouxel
08-Sep-2003, 09:53 AM
Have you a URL so we can see the error and peek at the code>

Norman

BSO
08-Sep-2003, 10:29 AM
Hi there,
Here is a link to a test section I have made for you guys:
http://www.bargain-shop-online.co.uk/acatalog/for_test_only.html

Only one item in there, self expalined. good luck

Thanks

Simon

NormanRouxel
08-Sep-2003, 01:21 PM
Just another typo, sorry. I made the variable names more meaningful just before I posted this and in doing so I gave two things the same name.

Here's a replacement Readme.

Norman

BSO
08-Sep-2003, 03:19 PM
Thanks Norman, will give it a go and let you know how I get on.

All the best

Simon

BSO
08-Sep-2003, 03:33 PM
Thanks Norman, that did the trick, its working perfectly now.

One last thing:
Do you think it would be possible to change the script to allow multiple secret codes that would all work.
E.g
xyzzy
xyzzy1
xyzzy2
xyzzy3 etc

Different codes for different people, not to allow different prices but so that you could stop say xyzzy2 from getting the discount (by removing that from the list) but still allow the others without issuing a new code.

NormanRouxel
09-Sep-2003, 12:33 AM
Here's a rewrite that allows several secret discount codes and also uses an unrelated suffix for the discounted product reference. This makes it harder for someone to crack the code as it's no longer visible as part the product reference.

Notes:-

Only tested with IE6.

Will only work on simple products with no attributes or prompts.

There are bound to be ways of getting round this but the customer would need some knowledge of Actinic and JavaScript.

Norman

BSO
09-Sep-2003, 02:17 AM
Thanks Norman,
Its got to be said, you are amazing.

Script works brilliantly.
For your info I'm currently using 6.1.3 with IE6

Thanks for taking the time to develop this.

Simon

NormanRouxel
09-Sep-2003, 09:30 AM
Please check with some alternative browsers as you won't want to annoy Netscape and Opera users (they're out there and they're usually quite vocal).

Norman

NormanRouxel
10-Sep-2003, 11:25 AM
Here's an update that allows for Prompts, Attributes, Components and also optionally displays the discounted price.

There are a few things it can't do but I think it will cover most types of products.

Norman

NormanRouxel
10-Sep-2003, 12:26 PM
Ignore the prior posting. I tidied the code a bit and this is the final version (for now).

Here's an update that allows for Prompts, Attributes, Components and also optionally displays the discounted price.

There are a few things it can't do but I think it will cover most types of products.

Norman

BSO
10-Sep-2003, 12:45 PM
Thanks Norman,
I am successfully using your previous version which does by the way also work with netscape, mozzila and opera.

Will try this new version a.s.a.p

All the best

Simon

P.S Just a quick note that the suffix to the invisible product does actually show in the cart and anywhere else that the product item number is usually shown.
Not a problem as such I just named it something shorter and less obvious.

NormanRouxel
10-Sep-2003, 02:43 PM
Thanks for the testing, Simon. I'm on holiday in Turkey with only IE6 on my laptop so no deep debugging here.

Please let me know if the most recent update works OK.

Norman

BSO
10-Sep-2003, 04:02 PM
Norman your latest version works a treat, you can test it out for yourself if you like HERE (http://www.bargain-shop-online.co.uk/cgi-bin/ss000001.pl?PRODREF=SOFTGAMEARMAG&NOLOGIN=1)

You can use my distributed code: xv67hh4

Was it intentional or is it the way these scripts automatically work that the code is actually case sensitive, this is a good feature.

I Like the touch of including the discount price, saves adding it manually like I started to do.
I have tested everything I could think of and I have had no problems what so ever.

I wish I was able to create a script so quickly and accurately as you do, trouble is I have no experiance of the commands and do most things through trial and error.

The update to include use of components etc is a real bonus (also works fine), can use the script for pretty much every situation I will need.

I hope your having a good holiday and not spending too much developing scripts for us thick gits.

I personally think Actinic (although they do an excellent job) should call you in to help out with there next version.

All the best

Simon

NormanRouxel
10-Sep-2003, 04:30 PM
Nice to see it in use. You may want to add something like "SPECIAL OFFER" to the hidden product name so that it stands out on the Cart and paperwork.


Norman

PS Your cart is busted when viewed from here. I'm getting missing images and no JavaScript includes. I see "<BASE HREF="http://community.actinic.com/acatalog/">" in the script generated pages. I hope that's just a bug due to following a link from the Forum to a script generated page.

BSO
10-Sep-2003, 05:17 PM
Your right Norman it does need something for it to stand out a bit in the cart etc.
I do still need to adjust a few things to match my current setup but It is almost there.

As for the cart being busted and the problem you mentioned, I am sure this is a problem due to linking from the forum.

I had this problem before when linking from an ad in Ebay. I could only solve the problem by purging session files.

I do not have any links to the community board on my site otherwise.

Hope its nice there,

All the best

Simon

smiffy
19-Nov-2003, 10:04 AM
I've just tried to see this working at you site, but the product is no longer found..

Any chance of a current code so I can see this in action?

waxbox.co.uk
21-Aug-2004, 10:13 PM
I have recently build a site, and it is up and running. I have read the txt file supplied on the forum(and the was a lot of help(thanks) :) My promotional code works for 1 item. After i tried installing the promotional code offer on the second product, it work but when a test them both togather, it didn t work.

The problem is i can add the first item with the discounted price and when i add the second product, it kicks the first product out of the cart.

CAN ANYONE HELP.

PLEASE CONTACT ME

NormanRouxel
21-Aug-2004, 10:58 PM
You'll have to post a URL and the code so we can see this happening.

Norman

waxbox.co.uk
22-Aug-2004, 11:08 AM
Thanks for a reply

My website URL is http://www.waxbox.co.uk/acatalog/Swix.html

There are 2 products with a promotional codes called

CH4 green Bulk
CH6 Bulk

My promotional codes is xyzzy at the moment.

Thanks

NormanRouxel
22-Aug-2004, 12:12 PM
You aren't using the latest version of this patch. It's best to read these threads from the end back and use the latest attachment.

I've attached the latest version here.

Norman

waxbox.co.uk
22-Aug-2004, 12:24 PM
I will try that version now

Thanks

waxbox.co.uk
22-Aug-2004, 03:24 PM
I have tried the code re-entering it over and over again. Would someone be able to let me have a look at there website and give me a product code please.

Again i can get one product with a discount working, but when i try get the second to work, i am stuck because it all gets confusing wit the codes and codes it will except and the codes it dosen t, and to make it even more complicated, you have secretsuffixes

I have the following codes setup

var secretsuffix = '-nhr';
var secretcode = ['codexyz', 'abcpqr', 'wowza123'];

I have left the codes as the default codes for now.

So far i have done the following

1st product
(ch4 bulk)(ref:10)(Ref:10-nhr)

2nd product
(ch6)(Ref:16)(Ref:16-nhs)

Could you tell me what the discount codes should be and why i can t get it to work.

Is it because i am using version: 6.0.2.0.0.0. with ie6

URL:http://www.waxbox.co.uk/acatalog/Swix.html

The page might need refreshing

NormanRouxel
22-Aug-2004, 04:36 PM
Two things to try.

1) Are you sure you're following this bit of the readme where you create a duplicate of the product immediately after the secret code one. I can see no sign of you doint this on your generated page.

Now create your usual product at the full price.
Use SecretCode_ProductLine.html as it's template.
Set its product reference to (e.g.) ABC101.

Duplicate that product and place the duplicate immediately below the main one.
Set the price to be your discounted one (you can also set any components to discounted prices as well).
Set its product reference to be the same as the one above but with the secretsuffix added (e.g.) ABC101-nhr
Optionally append something like "(Promotion)" to it's Short Description.
Use Invisible_ProductLine.html as it's template.

2) Try using product references that are alphabetic and not numeric for these products. E.g. XYZ for the main product and XYZ-nhr for the duplicate cheaper one.

Norman