Portfolio
Code/Web

[Magento] get price and special price product magento

March 18, 2014Category : Code/Web

Loading Product $_productId = 52; $_product = Mage::getModel(‘catalog/product’)->load($_productId); –  Get Regular Price chưa có phần formart theo currency. $_actualPrice = $_product->getPrice();  – Get Regular Price  đã formart theo currency. $_formattedActualPrice = Mage::helper(‘core’)->currency($_product->getPrice(),true,false); Get Special Price // special price chưa có formart theo currency. $_specialPrice = $_product->getSpecialPrice(); //  specila price đã formart theo currency $_formattedSpecialPrice =..

Read more
01.

[Magento] Sửa Lỗi Database server does not support InnoDB storage engine.

March 13, 2014Category : Code/Web

Go To Line 59 of the file app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php Replace public function supportEngine() { $variables = $this->_getConnection() ->fetchPairs(‘SHOW VARIABLES’); return (!isset($variables[‘have_innodb’]) || $variables[‘have_innodb’] != ‘YES’) ? false : true; }   With public function supportEngine() { $variables = $this->_getConnection() ->fetchPairs(‘SHOW ENGINES’); return (isset($variables[‘InnoDB’]) && $variables[‘InnoDB’] != ‘NO’); }  

Read more
02.

[Magento] Optimize magento database by Cleaning log

January 3, 2014Category : Code/Web

Optimize magento database Log Cleaning Magento maintains several tables for logging. These tables log things such as customer accesses and which products have been compared. Magento has a mechanism for cleaning these logs regularly, but unfortunately this feature is disabled by default and most customers do not turn it on. There are three ways to..

Read more
03.

[Magento] SQLSTATE[HY000]: General error: 1030 Got error 28 from storage engine

January 3, 2014Category : Code/Web

There has been an error processing your request. SQLSTATE[HY000]: General error: 1030 Got error 28 from storage engine     >>>> Fix: Clear tmp folder

Read more
04.

[Magento] Sửa lỗi Could not determine temp directory, please specify a cache_dir manually

December 31, 2013Category : Code/Web

If you are still having issues with this try creating a new dir called tmp. Navigate to app/code/core/Zend/Cache/Backend/ Edit File.php Change: protected $_options = array(         ‘cache_dir’ => ‘null’, to protected $_options = array(         ‘cache_dir’ => ‘tmp/’, For Magento Version 1.4.1.0

Read more
05.

[Magento] Tăng tốc độ cho magento

December 31, 2013Category : Code/Web

Tìm các dòng trong .htacess và thay thế như bên dưới   ############################################ ## enable apache served files compression ## http://developer.yahoo.com/performance/rules.html#gzip # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems… BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch..

Read more
06.

[Magento] Exporting products to CSV results in “Invalid entity model” error

November 11, 2013Category : Code/Web

To resolve it open  app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php around line no. 60 replace  $destination = tempnam(sys_get_temp_dir(), ‘importexport_’); to  $destination = tempnam(Mage::getBaseDir() . ‘/tmp/’ , ‘importexport_’);

Read more
07.

[WP] Resize images post

October 14, 2013Category : Code/Web

Add layout.css or style.css in your theme p img { max-width: 500px; height: auto; }

Read more
08.

[Magento] Cập nhật nhanh sản phẩm qua file csv

September 25, 2013Category : Code/Web

Giá thành sản phẩm dù được cập nhật thông qua hồ sơ cá nhân nhập khẩu mặc định mặc nhưng điều này là rất chậm và đòi hỏi rất nhiều fields csv (ngoài sku và prices) để có thể cập nhật. Hôm nay tôi sẽ nói chuyện về việc cập nhật giá sản phẩm chỉ..

Read more
09.

[Magento] Xóa thuộc tính

September 24, 2013Category : Code/Web

Bạn muốn xóa một thuộc tính. Nhưng không có tùy chọn xóa trong khi bạn chỉnh sửa các thuộc tính. Điều này có nghĩa rằng thuộc tính là thuộc tính hệ thống. Thuộc tính hệ thống không thể bị xóa. Thuộc tính chỉ người dùng định nghĩa có thể bị xóa.

Read more
010.

[Magento] Hiện số người Online – Hiển thị Customer, Guest, Total online

September 17, 2013Category : Code/Web

Vào app\design\frontend\default\your theme\template\page\html\footer.phtml chèn vào đoạn $visitor_count = Mage::getModel(‘log/visitor_online’)->prepare()->getCollection()->count(); $write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’); $readresult=$write->query(“select count(distinct customer_id) as num_visitors from log_visitor_online where last_visit_at > date_sub(now(),INTERVAL 20 MINUTE); “); $row = $readresult->fetch();$n=0;if($row[‘num_visitors’]>0) $n = $row[‘num_visitors’]; echo “Customers online: “.$n; $guest = $visitor_count-$n; echo ” | Guest online: “.$guest.” | “; if(!empty($visitor_count) && $visitor_count > 0){ $cnt = $visitor_count;..

Read more
011.

[Magento] number coulumn in hompage – list.phtml

September 12, 2013Category : Code/Web

Thiết lập giá trị $_columnCount = Ở trên đoạn if($_columnCount == 5){ $imgSize = 180; }elseif($_columnCount == 3){ $imgSize = 245; }

Read more
012.

[Mangento] Limit number product in Homepage list.phtml

September 12, 2013Category : Code/Web

Tìm < ?php $i=0; foreach ($_productCollection as $_product): ?> Thêm vào sau < ?php if($this->getIsHomepage() && $i==10) break; ?>

Read more
013.

[Magento] Listing sub-categories on a category page

September 7, 2013Category : Code/Web

Tutorial này sẽ hướng dẫn các bạn cho hiển thị danh sách sub-category bao gồm ảnh thumbnails và tên của subcategories trong trang category. Bước 1: Đăng nhập vào admin: CMS -> Static Blocks -> Add New Block Bước 2: Gọi block này vào nội dung static block -> save. {{block type=”catalog/navigation” template=”catalog/navigation/subcategory_listing.phtml”}}

Read more
014.

[magento] add thành phố vào db

September 7, 2013Category : Code/Web

DS các thành phố VN INSERT INTO `by_directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (485, ‘VN’, ‘HN’, ‘Hà Nội’), (487, ‘VN’, ‘HCMC’, ‘Tp Hồ Chí Minh’), (488, ‘VN’, ‘HP’, ‘Hải Phòng’), (489, ‘VN’, ‘BR’, ‘Bà Rịa’), (490, ‘VN’, ‘VT’, ‘Vũng Tàu’), (491, ‘VN’, ‘BL’, ‘Bạc Liêu’), (492, ‘VN’, ‘BG’, ‘Bắc Giang’), (493, ‘VN’, ‘BC’, ‘Bắc Cạn’),..

Read more
015.

[Magento] Bỏ phần thập phân tiền tệ

September 4, 2013Category : Code/Web

Step 1: Open file with path: app\code\core\Mage\Directory\Model\Currency.php Step 2: Old line: return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets); New line: return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets); Step 3: System/Cache management/ Action: 1. [Select all] -> [Refresh] -> [Submit] 2. [Flush Cache Storage]

Read more
016.
© Oliver / All rights reserved.
To top