close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Member Discount In Power Store

Thread began 7/03/2009 5:21 pm by sales320648 | Last modified 2/11/2010 11:11 am by iggymak198560 | 7725 views | 16 replies |

sales320648

Member Discount In Power Store

After copying and pasting the appropriate member discount snippet in dreamweaver (windows>snipets>recipes>ecartt>member discount) to ecart object. Then created the appropriate sever behavior from the bindings panel, I later proceeded to apply under the following merchant rule:

//WA eCart Merchandizing Show Start
//ecart="WA_Store_Cart"
if ($WA_Store_Cart->GetDiscounts() > 0) {
?>
<tr>
<td class="eC_SummaryLabel">Discounts</td>
<td>-<?php echo WA_eCart_DisplayMoney($WA_Store_Cart, $WA_Store_Cart->GetDiscounts()); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End


//ecart="WA_Store_Cart"
}
?>
<?php

I Added the following merchant rule:


//WA eCart Merchandizing Show Start
//ecart="WA_Store_Cart"
if ($WA_Store_Cart->MemberPrice() > 0) {
?>
<tr>
<td class="eC_SummaryLabel">Member Discount</td>
<td>-<?php echo WA_eCart_DisplayMoney($WA_Store_Cart, $WA_Store_Cart->GetMemberPrice()); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End
//ecart="WA_Store_Cart"
}
?>
<?php


does anyone know if this the appropriate code to apply the member discount for users who have logged in to powerstore? Any flaws in the above code?

Sign in to reply to this post

Ray BorduinWebAssist

I don't see a flaw.

To get member discounts to work you just need to store a session variable on the login page to identify members.

Then create a discount rule that validates that session variable exists as the condition.

Sign in to reply to this post
Did this help? Tips are appreciated...

sales320648

Thanks Ray,

In Powerstore solution pack to add member discount, do I need to create shopping Cart Calculations and Column? That is, define two new calculations in the WAeCart Shopping Cart object, one that sets the current price to either the standard or member price and another that figures the total discount? Would have to also add a MemberPrice column to the shopping cart? (unless these two additional columns already exist in Powerstore?)

Or is it more feasible to just add the following merchant rule in WAeCart ( WA_Store_Cart_PHP.php) folder.

//WA eCart Merchandizing Show Start
//ecart="WA_Store_Cart"
if ($WA_Store_Cart->MemberPrice() > 0) {
?>
<tr>
<td class="eC_SummaryLabel">Member Discount</td>
<td>-<?php echo WA_eCart_DisplayMoney($WA_Store_Cart, $WA_Store_Cart->GetMemberPrice()); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End
//ecart="WA_Store_Cart"
}
?>
<?php


than create and store a session variable on the login page to identify members?

Sign in to reply to this post

Ray BorduinWebAssist

If that is how you want to do it then that would work.

Hold both prices as separate fields. Use a calculation to find the total discount for that row by multiplying the difference by the quantity, and in the cart and then create a discount rule using that calculation.

Sign in to reply to this post
Did this help? Tips are appreciated...

sales320648

Member Discoutn In PowerStore

Thanks Ray,

By the way, can you give me a few tips how you would go about incorporating a member discount rule (flate rate of say, %10) in powerstore by basing the rule on the presence of a session variable? That is, by making the session variable UserID. If it is set then the user is logged in?

Sign in to reply to this post

Ray BorduinWebAssist

The problem with making the session variable UserID in the PowerStore scenario is that it has complex logic on the checkout page so that it automatically registers and/or logs in a new user when they checkout... so by the time they hit the confirm page everyone has registered by filling out the checkout form.

If you wanted to treat the registration form differently than the checkout form then you would need to set an additional session variable on the login page... maybe RegUserID or something.

Then you would just create a discount rule:
Condition: Based on the existance of Session Variable
Amount: Based on Subtotal ( * 0.1 )

Sign in to reply to this post
Did this help? Tips are appreciated...

sales320648

Hi Ray,
It seems like making session variable UserID(for member discount) in Powerstore is indeed a little more complex like you said. I'm looking for the less complex way to achieve a result where user logs in order to receive the discount. Can I achieve this like you pointed out by setting the session variable on the login page using RegUserID? Then just create the user discount rule, Condition and Amounts ?

In either case scenario way (complex or not) do I (this might be an absurd question) to still create(add) two new columns in powerstore? ( like for MemberPrice, Current Price) . what's your tip?

Sign in to reply to this post

Ray BorduinWebAssist

Yes, the additional session variable technique should work.

If you can't do it based on a percentage or math formula you would have to do it in two columns.

Sign in to reply to this post
Did this help? Tips are appreciated...

sales320648

Member Discount In PowerStore

Hi Ray,

It seems like there is no need to add additional columns or calculations to the cart when using PowerStore (thus the name solution pack yes?, LOL). In this case it seems like I will only need to modify the discounts rules for the cart. Since I only need the UserID session variable and its already setup when a user logs in PowerStore, how do I check for it's presence in the discount rule?

To give you a heads up, this is what I've tried to do so far to solve the problem:

step 1: clicked on the eCart panel object
step 2: clicked on the discount tab
step 3: in the setting fields I entered: Member Discount
step 4: under trigger, I set the "separator :condition" to: If session variable exist

Where I'm stuck:

After the above steps, in the separator : condition field, it requires me to give the "session variable name". In order to find the "session variable name" in PowerStore, I did the following using Dreamweaver file panel and going to code view:

In Powerstore, instead of the cart.php page, I opened "WA_Store_Cart_PHP.php" ( WA_eCart -> WA_Store_Cart_PHP.php) I found the following:

}
if (isset($_POST[$this->CartName."_ID_".$n])) {
$itemID = floatval($_POST[$this->CartName."_ID_".$n]);
}
if (isset($_POST[$this->CartName."_ID_check_".$n])) {
$itemID = floatval($_POST[$this->CartName."_ID_check_".$n]);
}

If I am on the right track, where is the "session variable name" above that I need? Even better, do I need to copy and paste the whole code into the "separator:condition" field?

I now know that after accomplishing the above the rest will be a breeze by just setting the calculation tab in the eCart object by selecting "based on subtotal of the cart, and times 0.10. This would yield 10% off of the purchase for the logged in user.

Thanks again in advance.

Sign in to reply to this post

Ray BorduinWebAssist

UserID is the session variable name I think. Look on the login page to be sure it matches the session variable name set at login.

Sign in to reply to this post
Did this help? Tips are appreciated...
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...