$db = new Zend_Db_Adapter_Pdo_Mysql(array( 'host' => '174.142.90.89', 'username' => 'devleero_app', 'password' => 'app123', 'dbname' => 'devleero_vu_centerdata', 'profiler' => true, )); $profiler = $db->getProfiler(); $sql='select * from product_simple'; $data=$result = $db->fetchAssoc($sql);; $i=0; foreach($data as $d) { var_dump($d); $i++; } echo 'total:'.$i;
Latest posts
generate Data Center product to cvs (module verification)
SELECT di.sku,di.nom,di.couleur ,s.name as size, m.name_model as modele_nom , m.id_model as modele_id , ma.name as marque_nom ,ma.id_mark as marque_id,di.qty,di.sexe,prix,di.etiquette,di.combined_width, di.warranty,di.prescription FROM product_simple as di inner join models as m on m.name_model=di.modele_nom inner join mark as ma on ma.name = di.marque_nom...
detect ip for switch website or websotre
<?php $client_ip=$_SERVER; $json=file_get_contents("http://ipinfo.io/{$client_ip}/json"); $details = json_decode($json); var_dump($details->country); $country=$details->country; switch ($country) { case "CA": case "MX": case "US": $_SERVER = "usd"; $_SERVER = "website"; break; default: $_SERVER = "row"; $_SERVER = "store"; } Mage::run($_SERVER, $_SERVER); ?>
check etiquette perdu script
$p_simple = DB::table('product_simple')->get(); foreach ($p_simple as $s) { $sku = $s->sku; $etiquette = $s->etiquette; $update_p = (array)DB::table('db_update')->where('sku', $s->sku)->get(); $new_label = ""; $new_label_arr = explode(',', $etiquette); $lost_label = array(); $exit_label=array(); foreach ($update_p as $u) { if ($u->qty === null && $u->etiquette...
A record Eplain
这里@代表的是顶级域名 例如 bigc.at 而*代表的是所有二级域名,例如 plz.bigc.at www.bigc.at 有些同学问题特别多,www.bigc.at 也算二级域名啊? 算! 也包含在*里头
get Module url
Parameter 1 - $routePath The route path follows the Zend behaviour of “module/controller/action”. The module part is self-explanatory. For example “cms” resolves to Mage_Cms. The controller is the class that will handle the address. “cms/page” refers to the class Mage_Cms_PageController....
magento module rewriter url
<global> <rewrite> <instsgram_url> <from><!]></from> <to><!]></to> <complete>1</complete> </instsgram_url> </rewrite> </global> /* Note: <to> is real router <from> is url after rewiter
check product not only update qty to zero but also not deactivate
DATA CENTER SQL select * from product_simple where sku not in( select s.sku from product_simple as s inner join db_update as u on u.sku= s.sku where s.qty =0 and u.qty=0 )and sku not in( select s.sku from product_simple as s...
add image to mangento
$product->addImageToMediaGallery('ABSOLUTE_PATH','image',true,false); select all This snippet will add an image residing in ABSOLUTE_PATH to product, assign it to “image” attribute, move it from original location (true), and uncheck the “Exclude” option (false). Here’s Magento documentation on the method: void addImageToMediaGallery (string...