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