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 10 years, 8 months ago by admin.
-
AuthorPosts
-
May 29, 2010 at 12:18 pm #1277usr_localMember
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 #21057amin007ParticipantCan 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 #21058usr_localMemberThere ya go admin007. Thats where I got the idea that my code edit might work.
May 30, 2010 at 2:31 am #21059amin007ParticipantYou 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 theelse if ($_POST['cquantity'])
block.March 1, 2014 at 6:39 pm #21060joybelle1080MemberI 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 #21061adminKeymasterIt 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?
-
AuthorPosts
- You must be logged in to reply to this topic.