<?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); ?>
Month: March 2015
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...