close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

trying to clear a coupon session

Thread began 2/09/2015 5:31 am by Jamie | Last modified 2/10/2015 12:07 pm by Jason Byrnes | 647 views | 14 replies |

Jamie

trying to clear a coupon session

Hey Jason

In an ecart install I have set up the coupons system (as per the coupon series in the tutorial area). I want to clear the coupon code when the buyer returns to one of 2 pages (invoice_thanks.php and checkout_success.php). I have added <?php if(isset($_SESSION['PromoCode'])) unset($_SESSION['PromoCode']); ?> to both these pages below </html> but it isnt clearing the session and keeps adding the coupon discount if you go back into buy something.

Cheers

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

where did you add that code on those pages? at line 1?

Make sure to start the session also:
<?php
@session_start();
if(isset($_SESSION['PromoCode'])) unset($_SESSION['PromoCode']);
?>

Sign in to reply to this post

Jamie

no, I added it at the bottom of each page below </html>

so should I move it to line 1 and adjust it with the above?

Sign in to reply to this post

Jason ByrnesWebAssist

It should be ok at the bottom, but you will probably still need to include the session start line.

Sign in to reply to this post

Jamie

hmmmm just tried it and still not clearing the session.... have attached the 2 files in case i have missed something obvious

Sign in to reply to this post

Jamie

if it helps with context, these 2 files can be found in the root of the site I just gave you ftp deets for

Sign in to reply to this post

Jason ByrnesWebAssist

are you sure PromoCode is the right session name?

add the following code to write the session contents:

<pre><?php var_dump($_SESISON); ?></pre>

this should show the correct name for the session.

if you need further assistance, I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

Jamie

i'm getting NULL whuch would explain why it isnt clearing - so begs the question, if PromoCode is being used to set the coupon, what have i not done that is not bringung the session to the thanks pages?

if you want to take a look, ftp details are attached

Sign in to reply to this post

Jason ByrnesWebAssist

Hhat is the full URL when at the cart display page where you enter the session?

What is the full URL when you get to the page where you are trying to clear the session?

Sign in to reply to this post

Jamie

see pm

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...