Search Results
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 |
Denotes a question related to the Magento products.
6
votes
Accepted
Create product via install script
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
What is the effect of Mage::getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID)
0
votes
Is it possible to save a product without without firing events?
You may be able to disable the event by using the event type disabled. For example:
<events>
<product_save>
<observers>
<reports>
<type>dis …
5
votes
Fastest way to update an attribute in all products
NOTE: entity_type_id = 4 is most always the product EAV entries. …
3
votes
Accepted
Search Product Attribute for Product Year Range
The easiest approach would be with two attributes, since not knowing a range to end with would mean pre-populating a single attribute with a range:
Mage::getModel('catalog/product')
->getCollection …
2
votes
Accepted
Limit characters in product name attribute while adding a new product in Magento Admin Panel...
https://stackoverflow.com/questions/15809872/add-a-character-count-to-admin-inputs-and-textareas
An alternative:
Something like this would work, just get the script added in the admin product pages …
0
votes
Accepted
Magento show configurable product options multiple times
Normally to collect all of the related options to a configurable product you could do something like this:
$productAttributeOptions = $product->getTypeInstance(true)->getConfigurableAttributesAsArray( … $product);
$attributeOptions = array();
foreach ($productAttributeOptions as $productAttribute) {
foreach ($productAttribute['values'] as $attribute) {
$attributeOptions[$productAttribute[' …
1
vote
Get associated products of group in parts
This should do what you are looking for, setCurPage is the start of the Offset, and setPageSize is the number of items return starting from the offset:
$product = Mage::getModel('catalog/product');
$product … ->load('157902');
$_simples = Mage::getModel('catalog/product_type_grouped')->getAssociatedProductCollection($product)->setCurPage(0)->setPageSize(2);
foreach ($_simples as $key => $value) {
Zend_Debug …
3
votes
How can i quick update of qty and stock and all inventory fields in Magento
= Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
if ( $product ) {
$productId = $product->getId();
$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId … $value:0);
}
$stockItem->save();
unset($stockItem);
unset($product);
}
echo "<br />Stock updated $sku";
}
fclose($file);
? …
2
votes
Programmatically adding images to products
::ADMIN_STORE_ID);
if ($product->getId()){
$mediaApi = Mage::getModel("catalog/product_attribute_media_api");
$items = $mediaApi->items($product->getId());
foreach($items as $item) … $mediaApi->remove($product->getId(), $item['file']);
}
Some related:
addImageToMediaGallery copy the image file to media folder
https://stackoverflow.com/questions/5709496/magento-programmatically-remove-product-images …
0
votes
Import many products programatically
protected function _getIndexers()
{
return Mage::getSingleton('index/indexer')->getProcessesCollection();
}
protected function _stopReindex()
{
$this->_getIndexers()->walk('setMode', arra …
3
votes
Full Page Cache Infinite Redirect
FPC:
http://www.developers-paradise.com/wp-content/uploads/2014/03/NRG_-MDP_Presentation_Max_Gubar_Ibiza_2012.pdf
https://stackoverflow.com/questions/9120413/how-do-i-include-a-dynamic-block-in-the-product-page-with-full-page-caching-turn …
1
vote
How to improve product inventory daily updates from CSV file?
= Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
if ($product)
{
$productId = $product->getId();
$stockItem = Mage::getModel('cataloginventory/stock_item')-> … $value : 0);
}
$stockItem->save();
unset($stockItem);
unset($product);
}
echo "<br />Stock updated $sku";
}
fclose($file);
? …
1
vote
SQL Query to fetch all child SKUs by using the configurable SKU
SELECT entity_id as product_id, sku FROM catalog_product_entity WHERE sku = 'foobarsku'; to get the configurable details by SKU.
After which you could sub-select on the catalog_product_super_link ta …