View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

trying to run a sale

Thread began 12/07/2009 12:50 pm by barbara224891 | Last modified 12/10/2009 5:01 pm by barbara224891 | 771 views | 4 replies

barbara224891

I'm having trouble following your directions. I edited the calculations as follows:

//start node
function ResetCalculations($itmObj) {
$itmObj->TotalWeight = $itmObj->Weight * $itmObj->Quantity;//w
$itmObj->TotalPrice = 7.5* $itmObj->Quantity;//c
$itmObj->FullDetails = $itmObj->Quantity . ' ' . $itmObj->Name . ' (' . $itmObj->ID . ')';//t
$itmObj->TotalQuantity = $itmObj->Quantity;//n
$itmObj->holidayPrice = 7.5;//c
return $itmObj;
}
//end node

This sets the price for every item to the unit price if there is no discount, $7.50. This part is showing up properly in my cart now.

Next, I redid the tiers to calculate a discount based on how many total items are in the cart. These have the effect of lowering the cart title by the discount in unit price times the total quantity of all items in the cart. This is how they look:

//Discounts
$this->Discounts[] = new WA_eCart_Rule(urldecode("tier1"), true, "WAEC_WA_eCart1_tier1");
$this->Discounts[] = new WA_eCart_Rule(urldecode("tier2"), true, "WAEC_WA_eCart1_tier2");
$this->Discounts[] = new WA_eCart_Rule(urldecode("tier3"), true, "WAEC_WA_eCart1_tier3");
//Charges
//Tax
//Shipping
$this->Shipping[] = new WA_eCart_Rule(urldecode("base"), false, "WAEC_WA_eCart1_base");
$this->Shipping[] = new WA_eCart_Rule(urldecode("increment"), false, "WAEC_WA_eCart1_increment");
}
//end node
//start node
//eCart Rule
function WAEC_WA_eCart1_tier1() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) >= 5) && (sizeof($this->Items) < 10))) {
$totalDiscount += ($this->TotalColumn("TotalQuantity") * .5);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_WA_eCart1_tier2() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) >= 10) && (sizeof($this->Items) != 20))) {
$totalDiscount += ($this->TotalColumn("TotalQuantity") * 1.0);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_WA_eCart1_tier3() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 20))) {
$totalDiscount += ($this->TotalColumn("TotalQuantity") * 1.5);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Finally, I add a line in the cart to display the discount, using this binding: <?php echo $WA_eCart1->GetDiscounts(); ?>.

However, the discount does not show up and the total is not affected. I have the tier rules selected as active, but obviously, they are not.

Help, please?

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