Month: June 2015

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));

GIT

git 教程

http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 2015-06-08 resume 1. git 是分布式版本管理系统, 每台电脑上都有自己的版本库,svn ,cvs 是集中式版本管理,必须有服务器支持 2.git 常用命令: git add readme.txt ->>添加一个文件到版本库    git commit -m "append GPL" 提交 添加文件到Git仓库,分两步: 第一步,使用命令git add <file>,注意,可反复多次使用,添加多个文件; 第二步,使用命令git commit,完成。

GIT

create git in siteground host

1. excuter ssh-keygen -t dsa create ssh public key in siteground by ssh 2 copier .ssh/is_dsa.pub public key à  bitbucket 3. ssh -T git@bitbucket.org tester login bitbucket 4.excuter git commande https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git https://www.siteground.com/tutorials/siteground-git/github-siteground.htm