Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Quote Item setCustomPrice
 
PaulE
Member
 
Avatar
Total Posts:  43
Joined:  2008-12-09
 

I try to add products to my cart with a custom price (setCustomPrice). This actually works fine untill I refresh my cart page. By every refresh the amount of TAX get decreased from the item and saves it again, so on every refresh the item gets cheaper and cheaper.

I’m not sure if I’m doing this the right way, but as soon as a product is added to the quote/card I use the setCustomPrice on item with an amount of 10.00.

Hope somebody knows what I’m doing wrong, or what the right way is to set a custom price for the cart. The price per product depends on colour, qty and size which will be calculated from my custom module which should update the cart with the right amount.

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentonneau
Jr. Member
 
Total Posts:  12
Joined:  2010-05-04
 

Got the Same D*** problem ...

Any Ideas ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentonneau
Jr. Member
 
Total Posts:  12
Joined:  2010-05-04
 

Got the same problem ...

Any Ideas ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dlj32
Jr. Member
 
Total Posts:  17
Joined:  2010-02-21
 

Is the amount of 10.00 that you’re setting on the item a static value or is it a percentage by any chance?
I’m not quite sure I understand how you’ve added the products with custom price (haven’t done it myself), but you might want to take a look at System -> Configuration -> Sales -> Tax -> Calculation Settings and make sure that the tax is being applied in the correct manner

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentonneau
Jr. Member
 
Total Posts:  12
Joined:  2010-05-04
 

Well, i’ve overload the Cart Controller.

In this Class i’ve overload the indexAction with this code :

$items $this->_getCart()->getItems()
foreach (
$items as $item{

     $item
->setCustomPrice(20);
     
$item->save();
}

parent
::indexAction();

I’ve checked the Configuration as you said, I apply Tax On Custom price if available.

Another strange thing n°1 : without any TAX , the price in Ckeckout onepage is the good one (20).
Another strange thing n°2 : Whatever the TAX configuration,in Ckeckout Multishipping, the price is still the original one.

I dont understand :/

 
Magento Community Magento Community
Magento Community
Magento Community
 
dlj32
Jr. Member
 
Total Posts:  17
Joined:  2010-02-21
 

Does it make a difference if you change the “Apply Tax On” to Original Price Only?
(Which version of Magento are you using?)

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentonneau
Jr. Member
 
Total Posts:  12
Joined:  2010-05-04
 

I use the latest Version (1.4.0.1)

And if I change to Original Price Only, I’ve got a NEGATIVE price !!! Oo

Yeah that’s awesome

 
Magento Community Magento Community
Magento Community
Magento Community
 
dlj32
Jr. Member
 
Total Posts:  17
Joined:  2010-02-21
 

A negative price? Oh boy.
Have you done anything else with the cart controller when you\’ve overloaded it?

As i mentioned earlier I haven\’t tried overload the controller to set custom prices but it sounds as if it\’s either updating the price at the wrong point, or the tax is being modified before the price change.

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentonneau
Jr. Member
 
Total Posts:  12
Joined:  2010-05-04
 

Well, i’ve only modify the IndexAction. I havn’t modify anything else . Maybe i do not use the good function.

PS : In fact the price in the CART is the good one (20) . But there’s a problem with the CHECKOUT page.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top