How to apply discount amount in QuoteItem - magento

I have code that saves order in Magento:
foreach ($poducts as $productData)
{
$quoteItem = Mage::getModel('sales/quote_item');
$quoteItem->setProduct($productData);
$quoteItem->setQty(2);
$quoteItem->setDiscountPercent($productData['discount_percent']);
$quoteItem->setDiscountAmount($productData['discount_amount']);
$quoteItem->setQuote($quote);
$quote->addItem($quoteItem);
}
I am wondering if there is way to apply discount why the setDiscountPercent and setDiscountAmount is not working. Is there other way to set discount on quoteItem?

Discounts are bases on salesrules modules (Baskets and catalog promotion tab in magento admin panel)
Magento discounts are recalculated each times your quote is saved (and when you load the checkout page, when you add a product, etc)
You can't manually add some discount as it will be erased by magento standaard discounts mechanims.
Try to use catalog or baskets sales rules.

Related

applying a 20% discount for students to magento store

I am trying to apply a student discount to some of my products but I can only see a way of applying a discount to the product itself, so everyone gets the discount! What I really want is somewhere for students to enter a code to get their discount, how can I achieve this please?
If you want to create a discount with coupon code, you should create a shopping cart price rule. So the students can add the products to cart and enter the coupon code on shopping cart page to get the discount for the products.
In Magento backend go to Promotions > Shopping Cart Price Rules.
Click Add New Rule on the top right.
Complete all required options. Set Coupon field to Specific Coupon and enter a coupon code on below text field. On conditions tab, configure settings for discount products that should be found in cart. On actions tab, configure setting to apply rules only for discounted product.

Magento product custom options, show discount in cart

i have a problem with my magento cms. On some of my products, i have added a custom option, with a dropdown. All the options in the dropdown gives 20% discount, and the discount is reduced from the price in the shopping cart, but i want the discount showed in the cart, like it does when a coupon is used. How can i do that?
I think you need to start using configurable products to adjust prices on options. You can easily solve this issue if you use configurable products and know some Magento programming.

How to create a coupon on specific product or category in Magento?

I am using Magento ver. 1.7.0.2.
Let's say I have 20% off coupon code.
This coupon is applicable only to Product B
A customer have in its cart :
Product A
Product B
Product C
I don't want my 20% off coupon apply to other product but only to Product B.
Do you know how I can do that within Magento?
You can create a shopping cart price rule under promotions. Under conditions, you want to choose "product subselection", then under subselection add a rule that the product in the cart must match the sku of the product you want the discount to apply to.

Magento discount coupon feature on product page

I want to have a coupon code generator on product page and whenever a customer enters that code it gets certain discount in the shopping cart.Any help would be appreciated.
You should check Catalog price rules and Shopping cart price rules. You can create conditions for particular products. Thus, the discounts will be applied only the products added to the rule.
or
How to Set-up a Discount Coupon in Magento

Want to add discounted price field to Cross sell tab in magento

I want to implement following requirement in magento admin panel-
When I add 'A' product to shopping cart then system suggest me 'B','C'.. products with discount price which I already configured through admin panel.i.e want to make a provision to select products and add discounted price..like cross sell tab.
Thanks in Advance...
i think i want the same... use the magento crosssell function to display a particular product(s) at the checkout of another unique product in the normal way. the extra feature required is to hard code a promotional price or % discount into the crosssell item. if a sku 123456 is in the product view or category it has a retail price but if show in crosssell it is shown with a promotional discounted price that is controlled at product level. so maybe this feature is part of the product setup. maybe a new field called crosssell price ?
i have asked aheadworks for clarification on the function of their 'checkout promo' extension.
the ahead works extension seems to be a banner but i'll see what they say.
Is this to use the magento crosssell function to display a particular product(s) at the checkout of another unique product in the normal way? The extra feature required is to hard code a promotional price or % discount into the crosssell item. If a sku 123456 is in the product view or category it has a retail price but if show in crosssell it is shown with a promotional discounted price that is controlled at product level. So maybe this feature is part of the product setup, maybe it's a new field called crosssell price ?
I have asked aheadworks for clarification on the function of their 'checkout promo' extension.
The ahead works, extension seems to be a banner but I'll see what they say.

Resources