php - magento - reindex category product position -


i've developed custom product sort module drag'n'drop and, simplicity , speeds sake, updates directly eav tables. save new position with:

$write = mage::getsingleton('core/resource')->getconnection('core_write'); $write->begintransaction();  ($i = 0; $i < sizeof($ids); $i++) {     $query = "update catalog_category_product set position='".$i."' product_id='".$ids[$i]."' , category_id='".$cat."'";     $write->query($query); }  $write->commit(); 

my question how can force reindex on affected changes position sorting visible in frontend.

i've tried dispatch several different events example this:

mage::dispatchevent('catalog_product_flat_rebuild', array(     'store_id' => mage::app()->getstore()->getstoreid(),     'table'    => mage::getresourcesingleton('catalog/category_flat')->getmainstoretable(mage::app()->getstore()->getstoreid()) )); 

but still see old sort order in frontend, , reindex full flat table, prefer reindex array of product id's , category id changed position on. ideas on how accomplish this?

thanks in advance!


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -