VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: markito on March 17, 2013, 17:58:49 PM

Title: minicart change product_name to product_sku
Post by: markito on March 17, 2013, 17:58:49 PM
In minicart module, i need to change the product_name to the product_sku.

someone know how to change this in VM 2 like this post for VM1?

http://forum.virtuemart.net/index.php?topic=47855.msg237254#msg237254


When i change in:
mod_virtuemart_cart/tmpl/default.php

<?php echo  $product['product_name'] ?>
to
<?php echo  $product['product_sku'] ?>

it just show the sku without a link to the product.

Thanks for any hints!
Title: Re: minicart change product_name to product_sku
Post by: Joseph Kwan on March 18, 2013, 06:41:54 AM
Try replace the echo line with these lines
<?php
$url 
JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product['virtuemart_product_id'].'&virtuemart_category_id='.$product['virtuemart_category_id']);
echo 
JHTML::link($url$product['product_sku']);
?>


I didn't try this and so this may not work. If you have problem, you can report back.
Title: Re: minicart change product_name to product_sku
Post by: markito on March 18, 2013, 08:33:45 AM
thanks, now the product_sku is a link.

But, the link brings you to the VM mainpage instead to the Product which is in the Cart....

Title: Re: minicart change product_name to product_sku
Post by: Joseph Kwan on March 18, 2013, 16:44:09 PM
Can you post the link? It will be better if you can provide a sample site.
Title: Re: minicart change product_name to product_sku
Post by: markito on March 18, 2013, 23:09:47 PM
hi, thanks, this is the shop which i am working right now: http://www.yoyo-shop.ch
Title: Re: minicart change product_name to product_sku
Post by: Joseph Kwan on March 19, 2013, 05:06:15 AM
Unfortunately, the link is not working on the site. The actual link will help to clarify the problem.
Title: Re: minicart change product_name to product_sku
Post by: markito on March 22, 2013, 13:54:12 PM
Hi Joseph

i don't get it what you mean .... if you put something in the cart, you will see that the SKU-Link brings you not to the Product.

Someone have a proposal, what has to be changed to have a Cart-Module with SKU-Links instead the Product name?

somthing like this:
1x WB5393             20.-
3x RF5684              55.-

Total:                     75.-


thanks for helping
Title: Re: minicart change product_name to product_sku
Post by: Joseph Kwan on March 30, 2013, 19:54:34 PM
don't see the product sku link. no way to check whether the link is correct
Title: Re: minicart change product_name to product_sku
Post by: PRO on March 30, 2013, 20:05:57 PM
the cart changes when you refresh the page