php & magento - sale category edit

Cerrado Publicado Oct 27, 2014 Pagado a la entrega
Cerrado

i need this modifiying so it doesnt look for STOCK status

<?php

class Mage_Catalog_Block_Product_Sale extends Mage_Catalog_Block_Product_List

{

//public $_collection;

public function getProductsLimit()

{

if ($this->getData('limit')) {

return intval($this->getData('limit'));

} else {

return 32;

}

}

public function __construct()

{

parent::__construct();

$collection = $this->_getProductCollection();

$this->setCollection($collection);

}

protected function _getProductCollection()

{

$page = Mage::getBlockSingleton('page/html_pager')->getCurrentPage();

date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));

$todayDate = strftime("%Y-%m-%d",Mage::app()->getLocale()->storeTimeStamp(Mage::app()->getStore()->getId()));

$storeId = Mage::app()->getStore()->getId();

$product = Mage::getModel('catalog/product');

$this->_productCollection = $product->setStoreId($storeId)

->getCollection()

->addAttributeToSelect(array('name','status', 'price', 'special_price', 'small_image','required_options','special_from_date', 'special_to_date'), 'inner')

->joinField('stock_status','cataloginventory/stock_status','stock_status',

'product_id=entity_id', array(

'stock_status' => Mage_CatalogInventory_Model_Stock_Status::STATUS_IN_STOCK,

'website_id' => Mage::app()->getWebsite()->getWebsiteId(),

))

->addAttributeToFilter('special_price', array('gt' => 0), 'left')

->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))

->addAttributeToFilter('special_to_date', array('or'=> array(

0 => array('date' => true, 'from' => $todayDate),

1 => array('is' => new Zend_Db_Expr('null')))

), 'left')

//->setOrder('created_at', 'desc')

->addAttributeToSort('created_at', 'desc')

->addFinalPrice()

->addStoreFilter()

->setPageSize($this->getProductsLimit())

->setCurPage($page)

->addAttributeToFilter('status', 1)

->addUrlRewrite();

Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($this->_productCollection);

Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($this->_productCollection);

$checkedProducts = new Varien_Data_Collection();

foreach ($this->_productCollection as $k => $p) {

$p = $p->loadParentProductIds();

$parentIds = $p->getData('parent_product_ids');

if (is_array($parentIds) && !empty($parentIds)) {

if (!$checkedProducts->getItemById($parentIds[0])) {

$parentProduct = Mage::getModel('catalog/product')->setStoreId($storeId)->load($parentIds[0]);

if ($parentProduct->isVisibleInCatalog()) {

$checkedProducts->addItem($parentProduct);

}

}

} else {

if (!$checkedProducts->getItemById($k)) {

$checkedProducts->addItem($p);

}

}

if (count($checkedProducts) >= $this->getProductsLimit()) {

break;

}

}

return $this->_productCollection;

}

}

Magento PHP

Nº del proyecto: #6647027

Sobre el proyecto

21 propuestas Proyecto remoto Activo Dec 3, 2014

21 freelancers están ofertando un promedio de $23 / hora por este trabajo

designcreative1

Hi, I can help you resolve the following error Kindly let me know the best time to talk regards Andrew

$25 USD / hora
(301 comentarios)
9.3
mistersoft

Hello! I am experienced PHP/MySQL developer with more that 10 years of experience. Can guide you how to remove stock looking after bid selection. Thanks

$24 USD / hora
(483 comentarios)
7.9
p4provider

Hello, Here are Magento Experts , 1. Easy access on IMs like Gtalk, Skype, Yahoo and MSN 2. Excellent Communication Skills 3. Immediate response to concerns and queries 4. Payments linked to delivery mileston Más

$15 USD / hora
(159 comentarios)
7.8
VnBestSolutions

Dear Sir. We claim to get it done perfectly for you EXACTLY in the way you want it - Kindly give we a chance and we will prove myself - Ready to prove our words, let's get it done right away and I mean RIGHT AWAY !! Más

$21 USD / hora
(211 comentarios)
6.9
davaidwilliam

A proposal has not yet been provided

$26 USD / hora
(60 comentarios)
5.9
Pureimagination

Hi, Hope all is well. I would like to take this opportunity to introduce to our recent start up software company based in India. "Pure Imagination". Since we are new over here the only thing which we have along w Más

$22 USD / hora
(1 comentario)
0.0