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

Modifying Customer Group Switcher Extension
 
RyanSkelton
Jr. Member
 
Total Posts:  2
Joined:  2008-02-22
 

I am trying to modify Vinai’s Group Switcher extension to be able to switch the group after a certain amount of product has been bought.
This is the current code I have written, but it isn’t working.

$orderCollection Mage::getModel('sales/order')->getCollection()
            ->
addAttributeToFilter('customer_id'$this->_customer);

        
$total_purchased 0;
        
Mage::log($orderCollection);
        foreach (
$orderCollection AS $order_row{

            $orderItems 
$order_row->getItemsCollection();         
            foreach (
$orderItems as $item){
                $product_id 
$item->product_id;
                
$number_ordered $item->qty_shipped;
                
$product_price $item->row_invoiced;
                
$product_status $item->status;
                
$_product Mage::getModel('catalog/product')->load($product_id);
                
$product_sku $_product->getSku();
                
$tiering $_product->getWholesaleTiering();
                
$cats $_product->getCategoryIds();
                
$count count($cats);
                for (
$i 0$i $count$i++) {
                    
if ($cats[$i] == 52 && $tiering == 1{
                        $total_purchased 
= ($number_ordered $product_price) + $total_purchased;
                    
}
                }
            }
        }
        $this
->totalValue $total_purchased;
        
Mage::log('customer total ' $total_purchased);
    
}

So basically the extension looks at a rule that switches the group when a certain action happens. Can anyone help with this?

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