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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Best eCart practice recommendation

Thread began 10/14/2014 8:27 pm by Steve | Last modified 10/15/2014 4:16 pm by Steve | 358 views | 17 replies

Steve

So close

Hello,
My rule works perfectly when outside the loop looking for intersection candidates. But also using the loop can bypass a valid hit and carry on to a non intersection as the final record in the loop which by passes the rule being true.

Solution: Move to a loop that stops whenever finding a valid intersection.

But this does not work for some reason:

<?php // envoke if more than 1 Item in cart
if (sizeof($eCart1->Items)>1) { ?>

<?php
// setting up base variables
$startDate = $eCart1->DisplayInfo("startDate");
$endDate = $eCart1->DisplayInfo("endDate");
?>







<?php // loop available items for comparison
$rule = 0;
while (!$eCart1->EOF() && $rule == 0 ) {
?>
<?php
$targetStartDate = $eCart1->DisplayInfo("startDate");
$targetEndDate = $eCart1->DisplayInfo("endDate");

// rule check
if ($targetEndDate >= $startDate && $targetStartDate <= $endDate) {
$rule = 1;
break; }
?>

<?php
$eCart1->MoveNext();
}
$eCart1->MoveFirst();
?>




<?php if ($rule == 1) { ?>
<div class="errorGroup"><strong>Potential Problem in your Order </strong><br>
Please confirm that you are not purchasing items with overlapping date ranges.
</div>

<?php } ?>

<?php // close conditional if >1 items in cart
} ?>



The rule check always returns a true (1) even when the available candidates do not meet the requirements to fire the rule.

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