Danh mục sản phẩm

Danh mục các hãng xe

Hỗ trợ khách hàng

 

Kinh doanh:

Tel: +84 4 39844705

-----------

SaleOnline:

Tel: +84 4 39844916

-----------

Kĩ thuật:

Tel: +84 4 39847471

-----------

Kế toán:

Tel:+84 4 22148644

-----------


Xem chi tiết...

Đối tác

logo

Cty-SHB

jenka-media

noithatoto-cartoyvn

Tìm kiếm sản phẩm: Giá từ: 100 đến 1 triệu   /  1 đến 2 triệu  /  2 đến 5 triệu  /  trên 5 triệu  /  trên 10 triệu
Trang chủ Tin tức VM - Virtuemart hacking Quy định 1 hàng 3 sản phẩm liên quan sets up the 3 column by 4 row table for the Related Products
Quy định 1 hàng 3 sản phẩm liên quan sets up the 3 column by 4 row table for the Related Products
Quy định 1 hàng 3 sản phẩm liên quan sets up the 3 column by 4 row table for the Related Products PDF. In Email
I followed a couple of posts that went down a dead end for me, as they were for older implementations.  We're running Joomla 1.5.10 and Virtuemart 1.1.3 and wanted to display more than the stock four Related Products shown when you look at an individual product page.

In the attached zip file, there are two files to replace:
1.  joomla_root/components/com_virtuemart/themes/default/templates/common/relatedProducts.tpl.php
2.  joomla_root/administrator/components/com_virtuemart/html/shop.product_details.php


This sets up the 3 column by 4 row table for the Related Products.  If you want to change those parameters:

Columns:  relatedProducts.tpl.php

Code: [Select]
             while( $products->next_record() ) { 
        if ($relItem == 3) {
        echo "</tr>\n<tr>";
        $relItem = 0;
The number 3 inside the if statement specifies the number of columns.  Change that to whatever (within reason) you want.

Rows:  shop.product_details.php (around line 85)

Code: [Select]
$q .= "AND FIND_IN_SET(#__{vm}_product.product_id, REPLACE(related_products, '|', ',' )) LIMIT 0, 12";
The number 12 specifies the total number of products to be displayed, which in this case will result in 4 rows.

REMEMBER:  Always back up your original files in case something doesn't work!

Thanks to these two threads for bringing me to this conclusion: