User Login
Latest Technology Articles
- A New Dimension of PCinvent Group Business Management
- Object's assignment, storage & grabage
- C# Mutliple Dimension Syntax
- Small Business System Diagram
- C# Desktop HTTP Post Method to Web
- PHP, Java & C# Documentation Compile
- C# to Open Firefox and go to a URL
- c++ 8 Queens Chessboard Placement in One Dimension
- My Old C++ Pointer Homework
- Simple C# Code to Open and Select File in WinForm
| How to hack Manufacture Name in Virtuemart Browse Page Template |
|
|
| Sunday, 15 June 2008 | |
|
Virtuemart is a very easy extensible Shopping Cart System. In its pre-defined Template, we can have many tags available. Such as product price, rating, product image and etc. In this artilce I write here, I would like to guide you how to implement the Virtuemart to have Manufacture Name available in Browse Page because I had seen may asked for this solution in official Virtuemart forum but has no clear answer yet......
First of all, let's open these three files first:
Shop.browse.php Search for this line: // NOW START THE PRODUCT LIST All code will be inserted after the line above. That created the object of class vmTemplate. Before the add to cart button:
I insert the codes to set the manufacturer name.
Note: Do not put the code above inside any if condition statement after the $tpl = vmTemplate::getInstance(); Otherwise, the codes might not work probably.
So, you might ask what does this line say about:
PS_product is the PHP class file "ps_product.php". To get each product id in browse page, we have this build in function: $db_browse->f('product_id')
Lastly, we put this "TAG" $mf_name in our browse template file:browse_1.php browse_1.php <?php echo $mf_name; ?>Straight forward? Just echo the variable we defined before. Comments (20)
![]() written by Ronaldo, June 16, 2008
Wanna ask, is this compatible to Virtuemart 1.1 ? cause i already tried what u explain here, but it still can't work anyway ??? tq....
written by Ronaldo, June 17, 2008
ok.... i'll try it later tonight.... i'll keep u posted whether it works or not... thx....
written by Ronaldo, June 17, 2008
hi there... wanna inform u, that it doesn't work...
my browse page is browse_4.php (componentscom_virtuemart hemesdefault emplatesrowse) my shop.browse.php (administratorcomponentscom_virtuemarthtml) i put the code : $mf_name = $ps_product->get_mf_name( $db_browse->f('product_id') ); $tpl->set('mf_name',$mf_name); // Add-to-Cart Button if (USE_AS_CATALOGUE != '1' && $product_price != "" [After // NOW START THE PRODUCT LIST $tpl = vmTemplate::getInstance(); ] It shows the manufacturer name, but wrong manufacturer... Doesn't match with the product.... ex: Product A should have Manufacturer C, but with that code, it shows Manufacturer B for Product A instead.... Can help any further ? thx.... btw, i actually wanna sort it, order by product name and then by manufacturer.... done it before at previous version of virtuemart... but in this 1.1 i can't do it... thx... anyhelp will be appreciate... written by Ronaldo, June 17, 2008
i found out the problem.... u have to put this code :
$products[$i]['mf_name'] = $mf_name; right before : } // END OF while loop cheers written by mhit, June 23, 2008
It does not work for me in VirtueMart 1.0.15, however this does work :
In shop.browse.php : Before the line: /*** Add-to-Cart Button ***/ Add: $mf_name = $ps_product->get_mf_name( $db_browse->f('product_id') ); After the line: $product_cell = str_replace( "{product_sku}", $db_browse->f("product_sku"), $product_cell ); Add: $product_cell = str_replace( "{manufacturer_name}", $mf_name, $product_cell ); then in the browse page you can use this variable: {manufacturer_name} written by Thomas, June 29, 2008
Thanks for this code snippet! It was very inspiring for me. And thanks to Ronaldo. His code part is important. It inserts the variable $mf_name, that changes with each call, to the array $products[]. If you ommit this line, the manufacturer name displayed will be the same for all products.
written by jared, July 06, 2008
First of all thanks for this code it got me out of a tight spot!
Second, would you know how to also add the product attribute dropdown list to the browse page as well? Thanks again. written by Nivea, July 19, 2008
Thanks you for this great modification
But I would like to know if there is any way to show the manufacturer name in a module, I'm using gavick shoptrix II. I want to show the manufacturer name in the new products module. Merci. written by Nivea, July 20, 2008
I have a module that show latest product, and I have another module thats show 6 product rotating, you can see them working : http://demo.gavickpro.serwery....&Itemid=53
first one is the header rotator and in the middle of the page u can see latest product, is there any way to show the manufacturer name before the product name, I have try many way and I have failed. written by federico, October 18, 2008
Hi,
Thanks for your job. Please, I have a question: where and how I put in browse_1.php file? Thanks again written by Alex, October 31, 2008
YEAh it works with VM 1.1
Thanks a BUNCH!!! This link should be posted in several thread on the VM forum dealing about that issue written by Danny, November 15, 2008
Hello,
I am trying to hack VM to show product type parameter values in category view for each product, just like in product flypage. I would apreciate any reply to your topic in VM FORUM on this matter. Thank you Write comment
Tags: Technology Programming How to hack Manufacture Name in Virtuemart Browse Page Template Virtuemart E-commerce Virtuemart template |
|
| Last Updated ( Sunday, 15 June 2008 ) |
| < Prev | Next > |
|---|




