[Resolved] Gift Certificates / Paypal minimum amount


  • Default avatar
    slowflow    
     13 years ago
    0

    I am creating a gift certificate. Once created, I came into my store and buy the product, enter the code, and proceed to checkout. At this time paypal page appears and asks me to "enter an amount greater than zero." How I can avoid the gift certificate referred me to the Paypal site and change the order directly to the "confirmed" status? This is my Payment Method but in this case I have this problem. I can manually turn the order status to "confirmed" but it is not a valid option.

    Otherwise, thanks for your wonderful software!

    Regards.
  • Your avatar
    seyi    
     13 years ago
    0

    Hi, it is a rounding issue. Please read through this forum post for more information:
    https://awodev.com/forum/awocoupon/help-section/coupon-value-exceeds-total-order
  • Default avatar
    slowflow    
     13 years ago
    0

    mmm, not working on my virtuemart 1.1.5. Also, I need this function also working on downloadable products. It does not work, nor with physical products, nor with downloadable products. At the end of the process ever I'm referred back to the paypal page.

    Here is the piece of code which is in my installation:

    if ($count <= 1 && $cc_payments==false) {
                    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], false, false ),"");
                }
                elseif( isset($order_total) && $order_total <= 0.00 ) {
                    // In case the order total is less than or equal zero, we don't need a payment method
                    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], false, false),"");
                }


    Any idea? Thanks in advance.
  • Your avatar
    seyi    
     13 years ago
    0

    did you try the solution posted here:
    https://awodev.com/forum/awocoupon/help-section/coupon-value-exceeds-total-order#comment-335

    I do not see a round($order_total,2) in your code.
  • Default avatar
    slowflow    
     13 years ago
    0

    Here is the code with the patch, but does not work. A syntax error in the code?
    Thanks in advance


            if ($count <= 1 && $cc_payments==false) {
                    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], false, false ),"");
                }
                elseif( isset($order_total) && round($order_total,2) <= 0.00 ) {
                    // In case the order total is less than or equal zero, we don't need a payment method
                    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], false, false),"");
                }
  • Your avatar
    seyi    
     13 years ago
    0

    what version of awocoupon and virtuemart are you working on? you can pm me with credentials to take a look at your site.
  • Default avatar
    slowflow    
     13 years ago
    0

    Dear Seyi,

    I have send to you a pm with the info. Any idea? Thank you.
  • Your avatar
    seyi    
     13 years ago
    0

    Upon further investigation, we found out that there is a problem with the total being 0 when you have only 1 payment method. Below is the current logic in www/administrator/components/com_virtuemart/classes/ps_checkout.php. Around line 860 within the list_payment_methods function should be this logic:

    <?php
    if ($count <= && $cc_payments==false) {
        
    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], falsefalse ),"");
    }
    //elseif( isset($order_total) && $order_total <= 0.00 ) {
    elseif( isset($order_total) && round($order_total,2) <= 0.00 ) {
        
    // In case the order total is less than or equal zero, we don't need a payment method
        
    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], falsefalse),"");
    }
    ?>

    The first "if" statement checks to see if you have only one payment processor. And if you do automatically select it instead of bringing up the payment method page. The second "if" checks to see if the order total is 0 if so skip the selection of payment method. The second "if" should come before the first logically. So first check if the order total is 0, if so skip everything, otherwise see if it is just 1 payment processor, if so go to confirm page, choosing it. Here is the original code reworked:

    <?php
    if( isset($order_total) && round($order_total,2) <= 0.00 ) {
        
    // In case the order total is less than or equal zero, we don't need a payment method
        
    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], falsefalse),"");
    }
    elseif (
    $count <= && $cc_payments==false) {
        
    vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], falsefalse ),"");
    }
    ?>