Thứ Năm, 16 tháng 10, 2014

Sửa lỗi You don't have permission to access /phpmyadmin/ on this server Wamp

Solution:

goto C:\wamp\alias\ and edit the phpmyadmin.conf file using notepad

Alias /phpmyadmin "c:/wamp/apps/phpmyadmin2.11.6/"

# to give access to phpmyadmin from outside
# replace the lines
#
#        Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
#        Order Allow,Deny
#   Allow from all
#

<Directory "c:/wamp/apps/phpmyadmin2.11.6/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
 Allow from all
 Allow from 127.0.0.1
</Directory>

Thay toàn bộ code trên vào file của bạn. Chú ý nhớ sữa đường dẫn thư mục phpmyadmin đúng với thư mục mà bạn cài đặt nhé.

Thứ Sáu, 15 tháng 8, 2014

Bỏ dấu cộng trong options products trong mangento

Mở file 
app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php

Tìm 2 dòng priceInclTax đóng nó lại và thay bằng 2 dòng dưới.

//$_priceInclTax = $this->getPrice($value['pricing_value'], true);
//$_priceExclTax = $this->getPrice($value['pricing_value']);

Thay bằng

$_priceInclTax = $this->getPrice($value['pricing_value'], true)+$this->getProduct()->getFinalPrice();

$_priceExclTax = $this->getPrice($value['pricing_value'])+$this->getProduct()->getFinalPrice();

Muốn bỏ dấu + có trong option tìm $sign='+'; đóng nó hoặc thay = dấu khác

Thứ Năm, 14 tháng 8, 2014

Thay đổi tiền tệ viêt nam trong magento

root/lib/Zend/Locale/Data/vi.xml 
Tìm:
 1.Trong <symbols>
                                     <symbols>
                                    <decimal>.</decimal> 
                                    <group>.</group>
                                    <list>;</list>
………….</symbols>
<!—từ dấu , sửa thành dấu .à định vị tiền 1,000 đ thành 1.000 đ
2.Bạn tìm function roundPrice() trong

app/code/core/Mage/Core/Model/Store.php 

public function roundPrice($price)
    {
        return round($price, 2);
    }
 Sửa lại thành=>
public function roundPrice($price,$roundTo=3)
    {
        return round($price, $roundTo);
    }
3.Tim /lib/zend/Currency.php 

protected $_options = array(
        'position'  => self::STANDARD,
        'script'    => null,
        'format'    => null,
        'display'   => self::NO_SYMBOL,
        'precision' => 2,
        'name'      => null,
        'currency'  => null,
        'symbol'    => null
    );
Thay bằng:
protected $_options = array(
        'position'  => self::STANDARD,
        'script'    => null,
        'format'    => null,
        'display'   => self::NO_SYMBOL,
        'precision' => 3,
        'name'      => null,
        'currency'  => null,
        'symbol'    => null
    );

4.Mở file Currency.php trong app\code\core\Mage\Directory\Mode
Tìm:

public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
    }
ð  Sửa lại thành số 3
public function format($price, $options = array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 3, $options, $includeContainer, $addBrackets);
    }
5.Sửa định vị tiền hiển thị danh sách sản phẩm trong admin. Tìm

/js\varien\js.js: dòng 254:
    var r = (j ? i.substr(0, j) + groupSymbol : "") + i.substr(j).replace(re, "$1" + groupSymbol) + (precision ? decimalSymbol + Math.abs(price - i).toFixed(precision).replace(/-/, 0).slice(2) : "")
Thêm +'0' vào cuối dòng:
    var r = (j ? i.substr(0, j) + groupSymbol : "") + i.substr(j).replace(re, "$1" + groupSymbol) + (precision ? decimalSymbol + Math.abs(price - i).toFixed(precision).replace(/-/, 0).slice(2) : "")+'0'

vào trang admin xóa cache và xem kết quả

Hiên thị tổng số tiền trong giỏ hàng

Để hiển thị tổng số tiền hiện tại trong giỏ hàng echo đoạn code dưới
<?php echo $price=number_format(Mage::getSingleton('checkout/session')->getQuote()->getSubtotal(),3);?>
khi hiển thị số tiền hàng đơn vị có dấu , (phẩy) ví dụ: 1,123.000 đ =>1.1.23.000 đ mới đúng
thay đổi thành
<?php echo $price = number_format(Mage::getSingleton('checkout/session')->getQuote()->getSubtotal(), 3, ".", ".");

=>”.”,”.” là dấu chấm của hàng đơn vị

. Định dạng hiển thị thời gian đặt hàng theo dd/mm/yyyy HH:mm

. Định dạng hiển thị thời gian  đặt hàng theo dd/mm/yyyy HH:mm
Để hiển thị thời gian đặt hàng theo mẫu ví dụ: 17/10/2014 13:05
Dùng funtion formatDate();
Trong file history.phtml là danh sách đơn đặt hàng tim chổ ngày đã đặt
<?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?>
Ta thay thành:
<?php echo $this->formatDate($_order->getCreatedAtStoreDate(),'short',true) ?>