Thursday, October 21, 2010

Modifying VirtueMart

How to remove the VirtueMart Logo from the module shopping cart

1) go to directory: components/com_virtuemart/themes/default/templates/common/minicart.tpl.php
2) delete the code below
<a href="http://virtuemart.net/" target="_blank">
<img src="http://www.blogger.com/%3C?php%20echo%20$mm_action_url%20?%3Ecomponents/com_virtuemart/shop_image/ps_image/menu_logo.gif" alt="VirtueMart" border="0" width="80" /></a>"

Refer to:http://forum.virtuemart.net/index.php?topic=45737.0


How to delete/remove Add to Cart text if have the button


For the browser page,

Go to: components\com_virtuemart\themes\default\templates\browse\includes\addtocart_form.tpl

at line 17 from

<input type="submit" class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?&gt" title="<?php echo $button_lbl ?&gt" />

change to

<input type="submit" class="<?php echo $button_cls ?>" value="" title="<?php echo $button_lbl ?&gt" />

For Product detail page

Go to: components\com_virtuemart\themes\default\templates\product_details\includes\addtocart_form.tpl

And do the same as the browser page

How to resolve add to cart button missing on browse page in Virtuemart

Go to: administrator\components\com_virtuemart\html\shop.browser.php

Then delete the red texts in this file

if (USE_AS_CATALOGUE != '1' && $product_price != ""
&& $tpl->get_cfg( 'showAddtocartButtonOnProductList' )
&& !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )
&& !ps_product::product_has_attributes( $db_browse->f('product_id'), true )) {

$tpl->set( 'i', $i );
$tpl->set( 'product_id', $db_browse->f('product_id') );
$tpl->set( 'product_in_stock', $db_browse->f('product_in_stock') );
$tpl->set( 'ps_product_attribute', $ps_product_attribute );
$products[$i]['form_addtocart'] = $tpl->fetch( 'browse/includes/addtocart_form.tpl.php' );
$products[$i]['has_addtocart'] = true;
}

Change localhost url to IP adderss

Goto: pathways in virtuemart.cfg.php - in /administrator/components/com_virtuemart/

see the lines
define( 'URL', 'localhost/your_directory/' );
define( 'SECUREURL', 'localhost/your_directory/' );

define( 'URL', 'http://172.16.100.199/your_directory/' );
define( 'SECUREURL', 'http://172.16.100.199/your_direcotory/' );

Change texts in Virtuemart,e.g. texts in the pop-up window
Go to: adminsitrator/components/com_virtuemart/languages/common/english.php

and search your message that you would like to modify

Increase the number of related products shown

Go to: administrator/components/com_virtuemart/html/shop.product_details.php

and edit from

$q .= "AND FIND_IN_SET(#__{vm}_product.product_id, REPLACE(related_products, '|', ',' )) LIMIT 0, 4";

to

$q .= "AND FIND_IN_SET(#__{vm}_product.product_id, REPLACE(related_products, '|', ',' )) LIMIT 0, 6";

now, your max num of products is 6 shown in the page.

How to remove Add to Cart in the related products module

Go to:/administrator/components/com_virtuemart/classes/ps_product.php

and look for the following line below:

function product_snapshot( $product_sku, $show_price=true, $show_addtocart=true, $show_product_name = true )

change it to

change from

function product_snapshot( $product_sku, $show_price=true, $show_addtocart=true, $show_product_name = true )

Change and customize the related products page

Go to: components\com_virtuemart\themes\default\templates\common\relatedProducts.tpl.php

and modify the code as wanted

or better Go to: components\com_virtuemart\themes\default\templates\common\productsnapshot.tpl

No comments: