我这里是根据订单id,生成一个扫一下显示订单号的二维码,
你也可以生成链接的二维码。
if(!function_exists("create_qrcode")){
function create_qrcode($orderid){
global $_W;
$path = IA_ROOT . "/addons/ewei_shopv2/data/qrcode/orderid";
if( !is_dir($path) )
{
mkdirs($path);
}
$file = "order_qrcode_" . $orderid . ".png";
$qrcode_file = $path . "/" . $file;
if( !is_file($qrcode_file) )
{
require(IA_ROOT . "/framework/library/qrcode/phpqrcode.php");
QRcode::png($orderid, $qrcode_file, QR_ECLEVEL_H, 4);
}
return $_W["siteroot"]."/addons/ewei_shopv2/data/qrcode/orderid/" . $file;
}
}