![](/img/trans.png)
[英]Prestashop category items decreasing in size as you scroll down the page on mobile phone
[英]Prestashop Currency size
您好,我是prestashop的新手。 我想增加貨幣符號的大小。
我編寫了一個模塊來覆蓋Tools.php和tools.js並將其放置在主題目錄下。 文件結構如下
Mymodule\
-->mymodule.php
-->override
----->classes
-------->Tools.php
----->js
-------->tools.js
我只是從相應的文件夾中復制了兩個文件,並添加了以下代碼
在Tools.php中,我在if($ no_utf8)之前添加了這行代碼
$c_char = '<span>'.$c_char.'</span>';
在tools.js我在if(currencyBlank> 0)之前添加了這行代碼
currencySign = '<span>' + currencySign + '</span>';
謝謝你的時間
與問候AB
在override / classes / Tools.php文件中:
public static function displayPrice(...)
{
$price = paret::displayPrice(...);
// use regex to seperate number from currency sign
return $price.'<small>'.$sign.'</small>';
}
要覆蓋tools.js formatCUrreny,您需要在每個具有以下內容的頁面上插入腳本塊或文件:
var fnDefaultFormatCurrency = window.formatCurrency;
window.formatCurrency = function(price, currencyFormat, currencySign, currencyBlank){
var priceStr = fnDefaultFormatCurrency(price, currencyFormat, currencySign, currencyBlank),
// use regex here again
priceFinal = price +' <small>' + sing+ '</small>';
return priceFinal;
}
我實際上需要做的更小一些,所以我用的small
但是您可以使用其他的東西。 注意:您必須在ajax函數中將.text()
替換為.html()
才能正確顯示HTMl
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.