-
- mipecera

-
Total Posts: 5
Joined: 2008-10-15
|
I want to list all products with special price on a page.
Just like a catgory page, but for special products.
I could do that with a new category for offers, but there must be an automated process to find products with special price…
thanks a lot
|
| |
-
- Posted: November 14 2008
-
| top
-
|
 |
 |
 |
|
|
-
- UrKo

-
Total Posts: 22
Joined: 2008-04-04
|
im interested too....
|
| |
-
- Posted: November 27 2008
-
| top
| # 1
-
|
 |
 |
 |
|
|
-
- rsingh

-
Total Posts: 10
Joined: 2008-10-06
|
Mates,
Have you got solution? I am also looking for this.
|
| |
-
- Posted: December 13 2008
-
| top
| # 2
-
|
 |
 |
 |
|
|
-
- Benek

-
Total Posts: 11
Joined: 2008-10-08
|
Anyone know? I need the same thing!
|
| |
-
- Posted: December 15 2008
-
| top
| # 3
-
|
 |
 |
 |
|
|
-
- gopika

-
Total Posts: 11
Joined: 2008-06-18
|
I am too interested. But here I don’t need a category. I need a page with special products listed in it. Can anyone help :(.
|
| |
-
- Posted: December 16 2008
-
| top
| # 4
-
|
 |
 |
 |
|
|
-
- retif

-
Total Posts: 171
Joined: 2008-08-16
Odessa, Ukraine
|
i am trying to do that, but with no success for now
$storeId = Mage::app()->getStore()->getId();
$product = Mage::getModel('catalog/product'); $todayDate = $product->getResource()->formatDate(time()); $products = $product->setStoreId($storeId)->getCollection() ->addAttributeToSelect(array('name', 'price', 'small_image','manufacturer'), 'left') ->addAttributeToSelect(array('special_price', 'special_from_date', 'special_to_date'), 'left') ->addAttributeToSelect('status') ->addAttributeToSort('special_to_date','desc') ->addAttributeToFilter('special_to_date', array('date'=>true, 'from'=> $todayDate)) ;
help if you can
|
| |
-
- Posted: December 21 2008
-
| top
| # 5
-
|
 |
 |
 |
|
|
|
|
-
- djmweb

-
Total Posts: 6
Joined: 2009-01-08
|
Does anyone know if this is possible yet in Magento or a plugin? I would like to show all my products that are one sale.
|
| |
-
- Posted: January 22 2009
-
| top
| # 7
-
|
 |
 |
 |
|
|
-
- jakilcz

-
Total Posts: 14
Joined: 2008-09-01
|
generally it should be something like:
$todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $this->_productCollection = Mage::getResourceModel('catalogsearch/advanced_collection') ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
if(isset($_GET['promo_only'])) { $this->_productCollection->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'); }
But it doesn’t work perfectly :(
In some specific situations it causes problems (like on last day of promotions product is listed but it has only 1 price shown and it’s regular one)
|
| |
-
- Posted: February 12 2009
-
| top
| # 8
-
|
 |
 |
 |
|
|
-
- DirectLowVoltage

-
Total Posts: 30
Joined: 2009-02-19
|
jakilcz - 12 February 2009 06:00 AM generally it should be something like:
$todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $this->_productCollection = Mage::getResourceModel('catalogsearch/advanced_collection') ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
if(isset($_GET['promo_only'])) { $this->_productCollection->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'); }
But it doesn’t work perfectly :(
In some specific situations it causes problems (like on last day of promotions product is listed but it has only 1 price shown and it’s regular one)
I’m not a programming expert or really know much about php stuff.. but it looks like your comparing the date to = or “>"be greater than.. could you just tell it to look for dates greater then todays date and then your items that are showing up on the last day that don’t have special prices shouldn’t fit and won’t show up… or make it do today’s date -1 and compare the special_to_date to that.. but the first idea seems like you would just need to remove a few “=” signs..
|
| |
-
- Posted: February 20 2009
-
| top
| # 9
-
|
 |
 |
 |
|
|
|
|
-
- Jeremy54

-
Total Posts: 1
Joined: 2009-05-15
|
This post was extremely helpful after hours of headaches trying to get the special price to work correctly in advanced search. I fixed the problem with using today’s date as the from and to values (which on day of the sale’s expiration would still return the item with an expired sale). You need to use tomorrow’s date. Here is the entire getProductCollection function from /store/app/code/core/Mage/CatalogSearch/Model/Advanced.php which will return only products currently on sale:
public function getProductCollection(){ if (is_null($this->_productCollection)) { $this->_productCollection = Mage::getResourceModel('catalogsearch/advanced_collection') ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes()) ->addMinimalPrice() ->addStoreFilter(); Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($this->_productCollection); Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($this->_productCollection); /* include special price from and to date filtering */ if(isset($_GET['special_price'])) { $todayDate = date('m/d/y'); $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y')); $tomorrowDate = date('m/d/y', $tomorrow); $this->_productCollection->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate)) ->addAttributeToFilter('special_to_date', array('or'=> array( 0 => array('date' => true, 'from' => $tomorrowDate), 1 => array('is' => new Zend_Db_Expr('null'))) ), 'left'); } } return $this->_productCollection; }
|
| |
|
 |
 |
 |
|
|
|
|
-
- generalbongo

-
Total Posts: 75
Joined: 2009-01-25
|
I guess that you could create a category ‘promo items’ and add all promo items to this category.
Than it is simple, you put this code:
{{block type="catalog/product_list" category_id="43" template="catalog/product/list.phtml"}}
You change the id in your category id and that is that.
Off course this is not the best way to do this because everytime you have another promotion you should also add them to the category.
There must be an easy way to do this also.
|
| |
-
- Posted: September 23 2009
-
| top
| # 13
-
|
 |
 |
 |
|
|
|
|
|
|