Forum Replies Created

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter mig810

    (@mig810)

    Hello,
    I have already solved the problem had it with the template.
    Updating the template has been fixed.
    A greeting.
    Thank you

    Thread Starter mig810

    (@mig810)

    Hi Mike.
    I think I’ve got it.
    I think there was a problem with the format that sent the script of the gift card, he took several decimals, and took the form not good. And send the total amount after the $ var = round ($ var, 2) and it worked.
    Then I had the problem of the total amount less than the sum shipping and tax, but I solved it this way:
    $amount_1 comes with a negative sign, which is subtracted from $amount_2 and then give zero. Not very elegant, but it is effective. Me works.

    Then Shipping Cost:

    // Shipping Cost
    // No longer using shipping_1 Because
    // A) paypal ignore it if * any * shipping rules are Within paypal
    // B) paypal ignore anything over five digits, so is the max 999.99
    if (($ Order-> get_total_shipping () + $ Order-> get_shipping_tax ())> 0) {
    $paypal_args [‘item_name_2’] = $ this-> paypal_item_name (__ (‘Shipping via’ ‘WooCommerce’) ” ucwords ($ Order-> get_shipping_method ())..);
    $paypal_args [‘quantity_2’] = ‘1’;
    $paypal_args [‘amount_2’] = number_format ($ Order-> get_total_shipping () + $ Order-> get_shipping_tax (), 2, ” ‘.’);

    // (09/09/2015) If the value + shipping shipping rates are higher than the overall due, prevent the amount of articles is negative. It remains to calculate the overall shipping …

    if ($ paypal_args [‘amount_1’] <0.00) {
    $paypal_args [‘amount_2’] + = $paypal_args [‘amount_1’];
    $paypal_args [‘amount_1’] = “0.00”;
    }
    }

    So far it seems to work.
    I want to thank you because without your help I could not have fix. It was critical that will locate the code that I could be going the raw data. Thanks for your help and your interest.
    A greeting.
    Mike.-

    Thread Starter mig810

    (@mig810)

    Hello,
    I have come to the line 344 of class_wc_gateway_paypal

    // If prices include tax discounts or unavailable order, send the whole order as a single item

    and I checked the following:

    For example, if the total amount payable after applying prices, rates and discounts is $ 33.41.
    Shipping costs + shipping rates are $ 6.51
    We use a gift card (discount) $ 23.
    Total order is to pay $ 10.41

    $paypal_args [‘item_name_1’] is correct, sends the items.
    $paypal_args [‘amount_1’] sends with just a 3.9 does not draw decimal zero, and sometimes is a negative number (-3.9)

    $paypal_args [‘item_name_2’] Shipping and rates the correct item.
    $paypal_args [‘amount_2’] The amount of shipping costs + taxes sends it as 6.51

    These calculations are performed by the script. PayPal responds by sending to:
    “The link you used to access the system PayPal article contains an amount of malformed”.

    No you can do.
    amount_1 is formatted, changing the order of items is achieved that is positive and has only one decimal when it carries zero.

    If you can help me I would appreciate it.
    Thank you.
    A greeting

    Thread Starter mig810

    (@mig810)

    Hello,
    then there is no solution.
    How can you eliminate the possibility of payment with PayPal?
    placing this
    if (isset ($ giftcard_id)) {
    // As I can do to not charge the Possibility of payment by PayPal
    }
    in the script that loads the payment methods, and leave only credit cards and bank account.
    The other possibility is that they can not charge shipping + shipping rates, so no problem.
    OK
    Thank you.

    Thread Starter mig810

    (@mig810)

    Hello,
    I use a program that creates vouchers (gift cards).
    There is the option of paying by card shipping. So far no problems. And pay shipping charges, but if the option is chosen to shipping rates apply separates on one hand the amount of shipping (excluding taxes) and other shipping rates in WooCommerce settings.
    So far no problem.
    Now, when you apply the gift card and split the payment (for example: shipping and rates are 6.45 $ (4.58 + 1.87) if paid entire article presents paypal and shipping with the sums, but if less than 6.45 (eg 4.28) after applying the discount format fails.
    Only if paid integrity shipping rates and passes smoothly.

    Anyway I am using Sandbox Test PayPal Accounts, although I suppose that will give the same.

    Thanks for your interest.
    A greeting.

    Thread Starter mig810

    (@mig810)

    Hi, thanks for answering.
    I used this to format the amount:

    $total=number_format($total, 2, ‘.’, ”);

    but I do not get results.

    The problem has arisen in applying the sending me rates and separation rates either:

    WC()->cart->shipping_total;;
    WC()->cart->shipping_tax_total;

    Before, I had no problem.
    No where to go, I’m thinking of leaving shipping and payment rates for all products.
    Thank you.
    A greeting.

Viewing 6 replies - 16 through 21 (of 21 total)