option for Tip amount

Is there a way I can add an option in marketpress where the buyer can add a tip amount in the shopping cart for my local delivery?

Thanks

  • digitsoft
    • The Crimson Coder

    I started digging through the code and found where to add a “Tip” area and then as I was looking for how to allow the update cart to add this to the total I thought of the easiest answer for you – add a product called TIP with a cost of $1. Then someone can add as much as they like.

    You’ll probably want to add the tip product in the widget area or do some custom code to always add that product to the cart.

    Hope that helps!

  • hakimus
    • New Recruit

    Thank you digitsoft :slight_smile:

    I didn’t know I can add new product with an open price, in this case tip amount? But even if I did it, I have to be able to add this product ” tip” to checkout page before payment?

  • digitsoft
    • The Crimson Coder

    Just create a product that “costs” $1 and name it Driver Tip, but you’re correct – you’d need to do some custom coding to always add that product to the checkout screen.

    It’s not an open price, but rather a fixed price of $1 that the buyer can add multiple quantities of.

    Example – if they wanted to tip $10, then they’d change the quantity to 10 instead of 1.

  • digitsoft
    • The Crimson Coder

    Here’s a quick solution:

    1. Create a “Tip” product and maybe give it variations of “Thanks” $1, “Big Thanks $2, “Wow” $5 (these would display in the product listing as a drop down)

    2. In each product that you want to add a tip option add this at the bottom of the product in html mode:

    <table><tr><td>

    Add a tip: [mp_buy_button product_id=”94″ context=”single”]

    </td></tr></table>

    The product_id would need to be changed to the tip product you created in #1.

    I tested this and it works…

    If it helped, feel free to click the “Say thanks to this user” above :slight_smile:

  • hakimus
    • New Recruit

    Hi digitsoft,

    It WORKS!!!!!!!! It WORKS!!!!!!!! It WORKS!!!!!!!! It WORKS!!!!!!!! It WORKS!!!!!!!! It WORKS!!!!!!!! It WORKS!!!!!!!! . Thank you very much for your help :slight_smile:

    I did some change to it but I kept the same idea you gave me. Instead of adding it to every product. I just put a message on the shopping cart with a link to the tip product with an image :slight_smile:

    Now I have a last question for you, and I swear it's the last one :slight_smile::

    Is there a way I can change the flat rate for the shipping to a percentage instead of $ amount. I want to make it 15% to all products.

    And again you have been very helpful.

    Thank you aecnu, I'm pleased to be a member of WPMU Dev

    Best

  • digitsoft
    • The Crimson Coder

    Cool….glad it worked for you!

    Here’s how to do a flat % in a round about way:

    1. Open wp-content/plugins/marketpress/marketpress-includes/plugins-shipping/mp-table-rate.php in an editor

    2. At line 323 (or so) above where it says “return $price;” add these 2 lines:

    $percent = .15;

    $price = $total * $percent;

    It should look like this now:

    $percent = .15;

    $price = $total * $percent;

    return $price;

    3. Set your shipping to flat rate, enter a 1 in each, and you’re done.

    I did a quick test and it worked, but you’ll want to verify.

    LMK if this solves it for you…

    Rob

  • digitsoft
    • The Crimson Coder

    I took this one step further…mainly as a personal challenge to see if I could do it and after an hour or so I was able to create a working shipping percentage plugin :slight_smile:

    Just unzip it and put the php file in this dir: /wp-content/plugins/marketpress/marketpress-includes/plugins-shipping

    It will automatically find the shipping option after you click the Shipping tab again.

    Here’s the d/l link (I can’t attach ZIP files): http://www.mediafire.com/?1vpyrw9x7wpoqnw

    Aecnu (or other staff) – feel free to edit this post and attach the ZIP file.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.