VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Themes & Layout Problems and Customization VM 1.1 => Topic started by: 32golf on June 20, 2011, 21:10:27 pm

Title: Latest Products - Small Mod
Post by: 32golf on June 20, 2011, 21:10:27 pm
Hi guys,
Just wondering if any of you know how to add a "View All In This Category" Link to the latest products module?


Regards

Ross
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 25, 2011, 15:22:25 pm
Anyone?
Title: Re: Latest Products - Small Mod
Post by: PRO on June 25, 2011, 15:46:19 pm
you might can try this
<a href="index.php?page=shop.browse&category_id=<?php echo ps_product::get_field($product_id,'category_id'); ?>&option=com_virtuemart&Itemid=4">View All is This Category</a>
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 25, 2011, 16:06:55 pm
which line should i add that too?
Title: Re: Latest Products - Small Mod
Post by: PRO on June 25, 2011, 16:17:49 pm
the featured template is

featuredProducts.tpl.php

Title: Re: Latest Products - Small Mod
Post by: 32golf on June 25, 2011, 17:21:20 pm
This is in the latest products module
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 25, 2011, 17:29:03 pm
Right got it working - but doesnt work with my virtuemart SEF turned on because of that href link building.

Any way around that?
Title: Re: Latest Products - Small Mod
Post by: PRO on June 25, 2011, 17:38:24 pm
http://virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html#Templates
$sess

    Used to build (SEF-enabled) URLs that can be used in links.

    Usage:

    <a href="<?php echo $sess->url( $_SERVER['PHP_SELF'] .'?page=shop.product_details&amp;product_id='.$product_id ) ?>">Details...</a>
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 25, 2011, 17:47:56 pm
Sorry im not a PHP programmer at the moment - just learning - but will give it a go and post the results

Thanks for the info.
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 25, 2011, 18:22:38 pm
Ok i tried to merge them 2 together with a few tweaks but it doesnt seem to want to work

$var = ps_product::get_field($product_id, 'category_id');
        ?>         <a href="<?php echo $sess->url( $_SERVER['PHP_SELF'] .'?page=shop.browse&category_id='.$var.'&option=com_virtuemart&Itemid=4'); ?>">Details...</a>         

Thats what i got.

Can you see anything wrong?
Title: Re: Latest Products - Small Mod
Post by: PRO on June 25, 2011, 23:53:36 pm
You dont have to set the var. I am not a php guy. But know you dont have to do that. Use the code i posted first right in the url
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 26, 2011, 00:47:32 am
Cant seem to get it to work

When ever i put it in all i get is a blank white page with just 3 products on it. Very strange
Title: Re: Latest Products - Small Mod
Post by: PRO on June 26, 2011, 12:59:01 pm
I will look at it on monday
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 26, 2011, 13:34:54 pm
Ok mate cheers
Title: Re: Latest Products - Small Mod
Post by: PRO on June 27, 2011, 16:41:57 pm
I had a look at this, and dont know how to do it, I am not a php guy either
Title: Re: Latest Products - Small Mod
Post by: 32golf on June 28, 2011, 00:45:39 am
Ok mate - thanks for trying


Anyone else want to have a shot at it?