Hi all,

There is a problem I faced with while integrating Magento: I have a pricing rule for a specified user group. However, when I create a quote from Drupal using magento_api_quote_create() it returns prices with all rules applied except the group-specific ones. If I set cutomer group in a pricing rule to NOT LOGGED IN (in Magento admin panel), magento_api_quote_create() returns the correct price. If anyone faced this problem and knows how to fix it? This is of great importance to me. I hope, I've explained my problem well =)

Thanks in advance.

Comments

chrisstina’s picture

Hello again,

Is it only me, who faced this problem? I am in desperate need of any comments on this problem.

Well, what I have understood for now, the API function quote.create() tries to get a session, but since we are not logged in as a customer (but as an api user), Mage::getSingleton('checkout/session') returns an empty session (or whatever it considers as "not logged in" state). What I have done for now, is adding

	$customerSession = Mage::getSingleton('customer/session');
	$customerSession->setCustomerAsLoggedIn($customer);

before Mage::getSingleton('checkout/session'). At least, this leads to applying correct pricing rules, including the customer-specific ones.

This is the only way I've found to make it work. However, it feels that this approach is a potential security hole.

I have to mention, that I am new to Magento, so I may be missing something.

Please, help.

Maxime Topolov’s picture

Assigned: Unassigned » Maxime Topolov
Category: support » bug

Chrisstina, we'll check that issue shortly, we were all in hollydays :) We'll get back with a solution asap. Thanks.

qwaygon’s picture

This will be fixed (in fact already is) in 1.3.4 (will be available soon) along with all rule application and "actual price" determination routine along with other major improvements.

qwaygon’s picture

Assigned: Maxime Topolov » qwaygon
qwaygon’s picture

Status: Active » Fixed

I have released 1.4 and it fix this issue, thanks for your feedbacks
p.s. note that 1.4 version of drupal modules pack require 1.3.4 version of megento extension

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.