douhun7609
2015-02-07 13:00
浏览 51
已采纳

将php函数应用到Magento价格中

i wanna change Magento price view to my language. i mean i want to change numbers.

i have this php function:

function fanum($englishnumbers)
{
$englishnumbers = str_replace(’0′ , ‘٠’ , $englishnumbers);
$englishnumbers = str_replace(’1′ , ‘١’ , $englishnumbers);
$englishnumbers = str_replace(’2′ , ‘٢’ , $englishnumbers);
$englishnumbers = str_replace(’3′ , ‘٣’ , $englishnumbers);
$englishnumbers = str_replace(’4′ , ‘۴’ , $englishnumbers);
$englishnumbers = str_replace(’5′ , ‘۵’ , $englishnumbers);
$englishnumbers = str_replace(’6′ , ‘۶’ , $englishnumbers);
$englishnumbers = str_replace(’7′ , ‘٧’ , $englishnumbers);
$englishnumbers = str_replace(’8′ , ‘٨’ , $englishnumbers);
$englishnumbers = str_replace(’9′ , ‘٩’ , $englishnumbers);

return $englishnumbers;
}

and:

$echo fanum($en_number);

how to apply these in magento price

图片转代码服务由CSDN问答提供 功能建议

我想将Magento价格视图更改为我的语言。 我的意思是我想改变数字。

我有这个php函数:

  function fanum($ englishnumbers)
 {
  $ englishnumbers = str_replace('0','0',$ englishnumbers); 
 $ englishnumbers = str_replace('1','1',$ englishnumbers); 
 $ englishnumbers = str_replace('2','2'  ,$ englishnumbers); 
 $ englishnumbers = str_replace('3','3',$ englishnumbers); 
 $ englishnumbers = str_replace('4','4',$ englishnumbers); 
 $ englishnumbers = str_replace(  '5','5',$ englishnumbers); 
 $ englishnumbers = str_replace('6','6',$ englishnumbers); 
 $ englishnumbers = str_replace('7','7',$ englishnumbers);  
 $ englishnumbers = str_replace('8','8',$ englishnumbers); 
 $ englishnumbers = str_replace('9','9',$ englishnumbers); 
 
return $ englishnumbers; 
} 
    
 
 

和:

  $ echo fanum($ en_number); 
   \  n 
 

如何在magento价格中应用这些

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题