Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 5757

Questions about product categories in the Magento catalog

2 votes
1 answer
972 views

Show Disabled products in collection

On my category page I am trying to show all it's products, even though they are all disabled. … On the category page I am using: $categoryModel = Mage::getModel('catalog/category'); $_category = $this->getCurrentCategory(); $_category_id = $_category->getId(); $products = $categoryModel->load …
odd_duck's user avatar
  • 1,396
1 vote
1 answer
2k views

Force only category URL

For each product it will have 2 urls: From the Homepage = mysite.com/product-page From the Category Page = mysite.com/category/product-page My problem is I need to only have the category url and not … I know I can do the opposite (don't have category version, only homepage) by setting the Use Categories Path for Product URLs option to No in the admin system but there is no way of doing what i want. …
odd_duck's user avatar
  • 1,396
3 votes
1 answer
2k views

Magento - get categories and subcategories in a collection

I have the following category structure in my magento store - root - category 0 (ID 26) - category 1 (main) - category A (sub) - category V (sub) - category … 1 link><category 1 name> <category 2 link><category G icon img> <category 2 link><category 2 link> <category 3 link><category L icon img> <category 3 link><category 3 link> What is the best way of …
odd_duck's user avatar
  • 1,396
0 votes
2 answers
2k views

Add Custom Collection Pagination to Existing Category Page

page - Category X On my category page: www.website.com/category-x/ I have the display mode set to static block only. … keep my category url page. …
odd_duck's user avatar
  • 1,396
2 votes
2 answers
3k views

Loop through all products in category, change value and save

I need to loop through all the products in a particular category, change a custom attribute and then save each product. … Currently i have: $_category = Mage::getModel('catalog/category')->load($_POST['id']); $all_products = $_category->getProductCollection(); foreach ($all_products as $product) { $product = Mage::getModel …
odd_duck's user avatar
  • 1,396
3 votes
2 answers
7k views

Set Category Product Position of Products

try { $product->save(); } catch (Exception $ex) { // catch error } With each product i need to be able to set the category product position (see below) How can this be done …
odd_duck's user avatar
  • 1,396
3 votes
1 answer
2k views

Multi Select Category Attribute not saving

I have programmatically created a custom category attribute which is a multi select. The attribute can be seen in my admin category section. … Can multi select not work on category attributes on CE-1.9? …
odd_duck's user avatar
  • 1,396
2 votes
1 answer
771 views

Filter (layered navigation) categories

My store has the following categories: - Root - other category - another category - Home - Kitchen - Cabinets - Appliances - Accessories … $home_id.'/'; $collection = Mage::getModel('catalog/category')->getCollection() ->addAttributeToFilter('level', 4) ->addAttributeToFilter('is_active', 1) ->addPathsFilter($path) -> …
odd_duck's user avatar
  • 1,396
0 votes
1 answer
2k views

Product collection for subcategories of subcategories

$category = Mage::getModel('catalog/category')->load($the_id); $categories = $category->getCollection() ->addAttributeToSelect(array('name', 'thumbnail')) ->addAttributeToFilter('is_active', 1) … php foreach ($categories as $category): ?> <li><?php echo $category->getName() ?></li> <?php endforeach; ?> </ul> …
odd_duck's user avatar
  • 1,396
1 vote
1 answer
2k views

Add category settings and thumbnail programatically/in front end

php $category = Mage::getModel('catalog/category'); $category->setName('new_category'); $category->setIsActive(1); $category->setIsAnchor(0); $parentCategory = Mage::getModel('catalog/category' … )->load("X"); $category->setPath($parentCategory->getPath()); $category->save(); ? …
odd_duck's user avatar
  • 1,396
1 vote

Filter Product Collection by BOTH multiple catgeories

Ended up filtering by just the 1 category, and then on the for each output checking if the product id is present in the 2nd category. …
odd_duck's user avatar
  • 1,396
0 votes
1 answer
3k views

Collection - call to a member function getId() on a non object

I have the following code which shows 5 products from the current category (which has cat ID:63): $_helper = $this->helper('catalog/output'); $_category = $this->getCurrentCategory(); $collection … prepareProductCollection($collection); $numProducts = 5; $collection->setPage(1, $numProducts)->load(); This works fine but i want to adjust this further so it only show products that are also found in another category
odd_duck's user avatar
  • 1,396
1 vote
3 answers
1k views

Filter Product Collection by BOTH multiple catgeories

<br/>"; }; My product/category setup is: products: category 1 (ID 26) category 2 (ID 63) product A - found in category 1 product B - found in category 1 & 2 product C - found in category 1 & 2 …
odd_duck's user avatar
  • 1,396
0 votes
1 answer
2k views

URL Rewrite not working

I am trying to add in a url redirect in the admin system so I can bypass a category page to go straight to the product as there is only 1 product in that category. … I know that it definitely has a category ID of 15 and that the labels/a4.html is correct …
odd_duck's user avatar
  • 1,396
1 vote
1 answer
4k views

Check if subcategory exists in current category

lighting misc misc I need to be able to check if the category misc exists as a subcategory in my current category or not, and if so show a particular block. … So if i was in the kitchen category it would not show but in bedroom and bathroom it would. How can i do this this check? …
odd_duck's user avatar
  • 1,396