cancel
Showing results for 
Search instead for 
Did you mean: 

Group Price by code

SOLVED

Group Price by code

Hello,
I need to be assigned by the price code according to customer group.
How can I do ?
Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Group Price by code

hi @totti240282
Here are sample code for setting the price by group

$productId=10;
$groupId=1;
$productPrice=20;
$product = Mage::getModel('catalog/product')->setStoreId(0)->load(productId);
$new_price = array( array ('website_id'=>0, 'cust_group'=>$groupId, 'price'=>$productPrice));
$product->setData('group_price', $new_price); $product->save();

 

here are few example code

 

http://www.webpioneer.in/blog/group-price-programmatically-magento/
http://magento.stackexchange.com/...

Find helpful ? Consider Giving Kudos to this post.
Problem solved? Click Accept as Solution!"
Qaisar Satti

View solution in original post

3 REPLIES 3

Re: Group Price by code

It's not clear from the question what you really want to achieve.

I guess that you want to define different prices for different Customer Groups. In that case, there is section called "Group prices" on every product, just go into Admin panel, open "Edit Product" page for any product you want, and go to the Prices tab.

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue

Re: Group Price by code

It is exact, but I have so many products and I can not do this by hand but I would do it by programming

Re: Group Price by code

hi @totti240282
Here are sample code for setting the price by group

$productId=10;
$groupId=1;
$productPrice=20;
$product = Mage::getModel('catalog/product')->setStoreId(0)->load(productId);
$new_price = array( array ('website_id'=>0, 'cust_group'=>$groupId, 'price'=>$productPrice));
$product->setData('group_price', $new_price); $product->save();

 

here are few example code

 

http://www.webpioneer.in/blog/group-price-programmatically-magento/
http://magento.stackexchange.com/...

Find helpful ? Consider Giving Kudos to this post.
Problem solved? Click Accept as Solution!"
Qaisar Satti