Latest posts

magento

Programmatically assign products to configurable

Programmatically assign products to configurable Version 1, last updated by lbernard at 2010-12-29 <?php define('MAGENTO', realpath('/var/www/magento')); ini_set('memory_limit', '128M'); require_once MAGENTO . '/app/Mage.php'; Mage::app(); $title = 'Test Video'; $description = 'Test Video'; $bodyContent='This is a test video'; $itemNum='testVideo2.1'; $price='129.95'; $product = Mage::getModel('catalog/product'); $product->setTypeId('configurable');  // $product->setTaxClassId(0); //none $product->setWebsiteIds(array(1));  // store id $product->setAttributeSetId(26); //Videos Attribute Set Id /*    Media Format Values <option value="6">dvd</option>7 <option value="5">vhs</option> */ $product->setSku($itemNum); $product->setName($title); $product->setDescription($description); $product->setInDepth($bodyContent); $product->setPrice($price); $product->setShortDescription(ereg_replace("n","",$description)); $product->setWeight(0); $product->setStatus(1); //enabled $product->setVisibilty(4); //catalog and search...

Issue Magento, magento

magento contact form handle

<contacts_index_index translate="label"> <label>Contact Us Form</label> <reference name="root"> <action method="setTemplate"><template>page/2columns-right.phtml</template></action> <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action> </reference> <reference name="content"> <block type="core/template" name="contactForm" template="contacts/form.phtml"/> </reference> </contacts_index_index>

Issue Magento

Call to undefined method Mage_Core_Model_Locale::getDateFormatWithLongYear() in /home/…/public_html/…/app/code/core/Mage/Adminhtml/Block/Widget/Form.php on line 207

Probleme  Call to undefined method Mage_Core_Model_Locale::getDateFormatWithLongYear() in /home/.../public_html/.../app/code/core/Mage/Adminhtml/Block/Widget/Form.php on line 207 Solutions I fixed by copying /app/code/core/Mage/Adminhtml/Block/Widget/Form.php to /app/code/local/Mage/Adminhtml/Block/Widget/Form.php Changing line 207 to read: $element->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));