MrBaseball34 Posted September 9, 2010 Share Posted September 9, 2010 How would I know if a product was downloadable in the $products object in paypal/redirect.tpl?In order to not have any shipping addresses for downloadable products, you need to add this hidden form field <input type="hidden" name="no_shipping" value="1" /> Link to comment Share on other sites More sharing options...
rocky Posted September 10, 2010 Share Posted September 10, 2010 You could use $cart->isVirtualCart() in modules/paypal/redirect.php to check whether there are any downloadable products in the cart. To check whether an individual product is a downloadable product, use the following: ProductDownload::getIdFromIdProduct($id_product); If it returns false, then you know it isn't a downloadable product. If it returns an ID, then you know the product is a downloadable product. You could add a new array element to the $products array with a true or false value so you can check in redirect.tpl whether the product is downloadable. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 10, 2010 Author Share Posted September 10, 2010 Just wondering, I think I have it now, thanks.I'm adding more and more functionality that should have been included... ;-P Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 10, 2010 Author Share Posted September 10, 2010 So, rocky, is this the way? (Note: all my products are downloads) {if $cart->isVirtualCart()} <input type="hidden" name="no_shipping" value="1" /> {else} <input type="hidden" name="shipping_1" value="{$shipping}" /> {/if} Link to comment Share on other sites More sharing options...
rocky Posted September 11, 2010 Share Posted September 11, 2010 I'm not sure. If $cart is a global variable, then it should work. If it isn't, then it won't. You should add the following to the list of $smarty->assigns in modules/paypal/redirect.php to pass in the value: $isVirtualCart => $cart->isVirtualCart(), then you can use the following in redirect.tpl: {if $isVirtualCart} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now