http://www.lomeit.info/export-et-import-des-produits-et-catgories-magento/
Category: 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...
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>
Password Protection with htaccess
Password Protection with htaccess With .htaccess it is very easy to password protect a folder or directory. The method is calledhtaccess password protection or htaccess authentication, and works by uploading two files called .htaccess and .htpasswd in the directory you...
language detecte by browser ( exception api url )
storeid=''; if(!$_SERVER=='/api/v2_soap/?wsdl') { $lang = substr($_SERVER, 0, 2); switch ($lang) { case "fr": $storeid = 2; break; case "en": //echo "PAGE EN"; $storeid = 1; break; default: $storeid = 1; break; } } $mageRunCode = isset($_SERVER) ? $_SERVER : $storeid;...
delete order test
SET FOREIGN_KEY_CHECKS=0; TRUNCATE `sales_flat_creditmemo`; TRUNCATE `sales_flat_creditmemo_comment`; TRUNCATE `sales_flat_creditmemo_grid`; TRUNCATE `sales_flat_creditmemo_item`; TRUNCATE `sales_flat_invoice`; TRUNCATE `sales_flat_invoice_comment`; TRUNCATE `sales_flat_invoice_grid`; TRUNCATE `sales_flat_invoice_item`; TRUNCATE `sales_flat_order`; TRUNCATE `sales_flat_order_address`; TRUNCATE `sales_flat_order_grid`; TRUNCATE `sales_flat_order_item`; TRUNCATE `sales_flat_order_payment`; TRUNCATE `sales_flat_order_status_history`; TRUNCATE `sales_flat_quote`; TRUNCATE `sales_flat_quote_address`; TRUNCATE `sales_flat_quote_address_item`; TRUNCATE `sales_flat_quote_item`; TRUNCATE `sales_flat_quote_item_option`;...
Get rewritten product url in a different store
It was pointed out to me in one of the preceding articles that getting a product’s URL in a different store can get pretty complicated if the URL you want to get is rewritten. I decided to come up with...
4 Simple but Effective Ways to Improve Magento’s Performance
4 Simple but Effective Ways to Improve Magento’s Performance When Magento is not set up correctly, it will run slowly since it is a ‘heavy’ eCommerce CMS system. Even the most experienced web developers might miss the not so obvious...
magento check stock qty est out stock
$_product=Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('type_id', array('eq' => 'simple')); foreach($_product as $p) { $stock=Mage::getModel('cataloginventory/stock_item')->loadByProduct($p); if($stock->getIsInStock()==="0"&&$stock->getQty()>=1) { echo $p->getSku(); echo '<br/>'; echo $p->getId(); echo '<br/>'; } }
Zend Framework Database Query
Zend Framework Database Query Database Manipulation Create a controller Call / Create(Write) Database configuration setting Request data object creation Assign message (Success / Failure / Already exists) Create a view page to see the message or to redirect to the...