close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Creating a discount that supersedes another discount

Thread began 12/19/2011 8:49 pm by mora398588 | Last modified 12/22/2011 8:29 pm by mora398588 | 1328 views | 6 replies |

mora398588

Creating a discount that supersedes another discount

I would like to create a discount for my users that will supersede a discount they receive when they are in session.

Currently, my users (members) are broken up into userLevels 1, 2 and 3. Each userLevel receives a discount based on their Membership level. For example, userLevel 1 gets a 25% discount, userLevel 2 gets a 20%, and so on.

My company is looking to market webinars for a modest price. However, I would like to extend our webinars to our members at no cost.

The best way I can think of, at the moment, is to create a member discount based on a session variable value (e.g., userLevels) and calculate the discount at 100% - thus charging the member nothing. For non-members or guests, they would have to pay the fee.

However, I am uncertain how to put together the discount. I am concerned that since our members already receive a discount off when they are logged in, that the 100% discount will be added onto their current discount or cancel the discounts altogether. I have never done anything like this before.

Ideally, I would like a discount that takes 100% off the cost of a webinar, and just the webinar, when a member is logged in. For example, if a member is logged and enrolls in a webinar and also purchases an unrelated product off our website, I would like eCart to calculate the discount for the webinar separately from the unrelated product.

Lastly, I have created a "discountable" column in my webinars database so that eCart and differentiate between the webinar from any other products we currently sell.

I have also attached a copy of files for your review. Thank you.

Attached Files
webinar_Detail.zip
webinar_registration.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you need to have a column in your cart to mark items as webinars or not.

for example sake, lets say we call this column "category". In the add to cart buttons for webinrars, set the value of this column to "webinars", in the add to cart buttons for other products use another value.


in the triggers for the webinar discounts, use the trigger:
"Number of items with a specific column value"
If the number of items where "category" has a value of "webinars" is "> " a value of "0"

AND:
Session "userLevel" is set

then for the calculation use "Based on items with a specific value"
Total of "TotalPrice" where "category" has a value of "webinar" "plus" "0"

Sign in to reply to this post

mora398588

Thank you, Jason.

It appears that the discounts are working. I have one other question...

Since the discounts are leaving a balance due of $0.00, PayPal Standard (which is my primary merchant account) will not accept the transaction. PayPal returns an error.

Is there a way to process the transaction while redirecting the user to a webpage other than PayPal when there is nothing to pay for?

Thanks again for all your help!

Sign in to reply to this post

Jason ByrnesWebAssist

on the confirm page, add an if statement around the form tag that sends the transaction to paypal so it will only go to paypal if the cart grand total is greater than 0:

php:
<?php if($eCart1->GrandTotal() > 0) { ?>
<form name="checkout_PP_LI_Hid"  action="https://www.PayPal.com/cgi-bin/webscr" method="post">
<?php } else { ?>
<form name="checkout_PP_LI_Hid"  action="checkout_success.php" method="post">
<?php ?>
Sign in to reply to this post

mora398588

The form tag has a lot of code (lines 595 to 655). Where do I insert your recommended code?

Attached Files
confirm.zip
Sign in to reply to this post

Jason ByrnesWebAssist

at line 596:

php:
<form name="checkout_PP_LI_Hid"  action="https://www.PayPal.com/cgi-bin/webscr" method="post">



change that to:

php:
<?php if($eCart1->GrandTotal() > 0) { ?>

<form name="checkout_PP_LI_Hid"  action="https://www.PayPal.com/cgi-bin/webscr" method="post">
<?php } else { ?>
<form name="checkout_PP_LI_Hid"  action="checkout_success.php" method="post">
<?php ?>
Sign in to reply to this post

mora398588

Jason,

When I tested the checkout process, your code redirected me to the checkout success page just fine...thank you for your suggestion.

However, when I decided to test the new code to see if the checkout process would direct me to PayPal with both a webinar course (no charge) and a seminar course (with 25% discount applied), the checkout process did direct me to PayPal, the confirm page appeared not to pass the modified price (taking into account the discounts) for the webinar and the seminar course. It appeared that PayPal took the Grand Total of the order and divided up amongst both courses.

Is this common? Is there a way for PayPal to show the total of each item, as well as the discounts being applied to the order?

If I was a customer, I would be a bit confused. I would want to see that the correct prices were being passed through accurately.

Thank you in advance for any assistance you can offer.

Sign in to reply to this post

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