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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Using PHP to toggle between quote, rental, and purchase

Thread began 12/15/2011 11:09 am by robert329616 | Last modified 12/17/2011 7:55 am by robert329616 | 1199 views | 2 replies

robert329616

Using PHP to toggle between quote, rental, and purchase

Hello.

I have 2 questions: Which page sends the confirm information (product, price etc) to WA_Universal_Email for mailing the receipt? I need to modify it somehow where if there is a quote only order, it doesn't send price or total, but does if there is an order for direct purchasing.

I have the site set up for three sections; Rental, Quote and Purchase. I have used PHP to hide the checkout button and show a reply form for the Rentals on the detail Page.

I did the same with quotes where the proceed for quote button shows with no pricing just quantity on the details page.

Purchase shows the check out button, pricing, etc for normal checkout on the details page.

I am running into an issue where, when I select a product to purchase and proceed to the cart page after selecting 1 as the quantity(from details), it shows 2 for the quantity on the cart page. I have narrowed it down to the 2 includes as the issue. Is there a way to combine with an if else statement or do it a different way?

Here is the code that I think is causing the conflict in the head:
<?php
$WAAddToCart = new WA_Include('../shopping_cart/add_to_cart.php');
require($WAAddToCart->BaseName);
$WAAddToCart->Initialize(true);
?>
<?php
$WAAddToCartP = new WA_Include('../shopping_cart/add_to_cart_p.php');
require($WAAddToCartP->BaseName);
$WAAddToCartP->Initialize(true);
?>

Here is the corresponding code in the body:
<?php if($row_WADAProducts["ProductPrice"] > 2) { ?>
<div class="addToCart"><?php echo($WAAddToCart->Body); ?></div>
<?php } ?>
<?php if($row_WADAProducts["ProductPrice"] == 1) { ?>
<div id="socialWrapperPurchase" class="wasocial">
<div class="icons"> <a name="fb_share" type="icon" href="#" onclick="window.open('http://www.facebook.com/sharer.php?u=<?php echo urlencode(((!empty($_SERVER["HTTPS"])) ? "https://" : "http://") . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>', 'Facebook', 'toolbar=0,status=0,width=626,height=436'); return false;" title="Facebook"> <img src="../../../webassist/social/icons/facebook.png" /> </a> </div>
<div class="icons">
<div id="custom-tweet-button"> <a href="https://twitter.com/share?url=<?php echo urlencode(((!empty($_SERVER["HTTPS"])) ? "https://" : "http://") . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>" target="_blank"><img src="../../../webassist/social/icons/twitter.png" alt="Twitter" border="0" title="Twitter" /></a> </div>
</div>
<div class="icons">
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="medium" count="false" href="<?php echo (((!empty($_SERVER["HTTPS"])) ? "https://" : "http://") . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>"></g:plusone>
<!-- Place this tag after the last plusone tag -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
<div class="icons">
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script>
<script type="in/share" data-url="<?php echo (((!empty($_SERVER["HTTPS"])) ? "https://" : "http://") . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>"></script>
</div>
<div class="icons"> <a href="mailto:?subject=I found this at Martab Medical's site&body=Checkout this link: <?php echo urlencode(((!empty($_SERVER["HTTPS"])) ? "https://" : "http://") . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>."><img src="../../../webassist/social/icons/mail.png" title="Mail" /></a> </div>
<div class="icons"> <a href="#"><img src="../../../webassist/social/icons/print.png" onclick="window.print()" title="Print" /></a> </div>
<div class="icons"> <a href="javascript:addBookmark(document.title, '<?php echo urlencode(((!empty($_SERVER["HTTPS"])) ? "https://" : "http://") . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); ?>')"><img src="../../../webassist/social/icons/favorites.png" title="Bookmarks" /></a> </div>
</div>
<div class="addToCart">
<?php echo($WAAddToCartP->Body); ?></div>
<?php } ?>

Thanks.
Rob

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