Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Discount- Changing $item['price']

by

Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple Shopping Cart Tweaks › Discount- Changing $item['price']

Tagged: discounts, items, price, shipping costs

  • This topic has 5 replies, 4 voices, and was last updated 11 years, 2 months ago by admin.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • May 29, 2010 at 12:18 pm #1277
    usr_local
    Member

    This is similar to the shipping cost post. Am attempting to drop the item price by 1 if item quantity is > 2. I tried this and got no results at all. Any ideas or help with my coding would be great. I am no PHP guru. Thanks!

    This is what I added to the function:

    {

    if ($item > 2)

    {

    $item += $item – 1;

    return $item;

    $total += $item * $item;

    }

    else

    {

    $total += $item * $item;

    }

    $item_total_shipping += $item * $item;

    $total_items += $item;

    }

    May 29, 2010 at 1:55 pm #21057
    amin007
    Participant

    Can you please post a link to the shipping cost post that you are referring to so we can both be on the same page?

    May 29, 2010 at 2:06 pm #21058
    usr_local
    Member

    Free Shipping for Quantity > 1

    There ya go admin007. Thats where I got the idea that my code edit might work.

    May 30, 2010 at 2:31 am #21059
    amin007
    Participant

    You won’t be able to follow that shipping cost example and do what you are after. It’s because you will need to modify the item price itself if the quantity is greater than 2 and modification needs to happen when the “Add to Cart” button is clicked or the quantity change happens. So you code to change the item price needs to go inside the if ($_POST['addcart']) block of code and also in the else if ($_POST['cquantity']) block.

    March 1, 2014 at 6:39 pm #21060
    joybelle1080
    Member

    I am trying to do something similar, give an automatic discount when a user purchases more than one of a certain product. I have it set up using the Automatic Discount, apply coupon for quantity over 1 apply x coupon. then x coupon is set to a percent/$$ amount. however I need the end price to a certain amount – my amounts are not even. So when applying this coupon it is a penny off. I need to change this amount though up to 4 items. Such as purchase one it is 6.50, purchase two it’s 6.375 a box or 12.75, three boxes, 6 each/18 total, or 4 boxes 5.75/23 total.

    I at first had set my product to have 4 different prices pending on number selected, but it cancelled out my limit of 4 purchased when in the shopping cart – it would make a different item purchased if I chose a quantity of 2, 3 or 4. BUT the price would be how I wanted it to be.

    How do I modify the code to do one of the two things above? I can explain more if needed. I would greatly appreciate any help. I purchased this product for the auto discount feature and the simplicity of the interface/awesome instruction and documentation.

    Thank you.

    March 2, 2014 at 3:04 am #21061
    admin
    Keymaster

    It seems like you should be able to do what you are after using the following estore addon:

    http://www.tipsandtricks-hq.com/ecommerce/wp-estore-bulk-discount-addon-2507

    Have you checked that addon?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ