VM 2.0.2 category layout not linking to Product Details

GK User
Wed Mar 28, 2012 8:53 am
Hi everybody,

I have a question in regards to the Virtuemart default category layout. If you click on the thumbnail it only opens a bigger image. You don't have a link (like in the news module) that tells you in that view that you can add a product to the cart.

From a usability point of view I find that very confusing as a web "standard" is that you either have a add-to-cart-button in that view or any click takes you to the product details page that shows a prominent add-to-cart button.

Is there anyway to change this or do I have to create or modify a template overwrite?

Regards,
Edward
User avatar
Junior Boarder

teitbite
Sat Mar 31, 2012 1:24 am
Hi

Please take a look at this article https://www.gavick.com/forums/140/link- ... ory#p69343
User avatar
Moderator

GK User
Sat Mar 31, 2012 7:34 am
Thanks Teitbite. Very appreciated.
User avatar
Junior Boarder

teitbite
Sat Mar 31, 2012 4:04 pm
Hi

No problem. Glad I could help.
User avatar
Moderator

GK User
Mon Aug 13, 2012 5:59 pm
Hi,

JOOMLA: 2.5.6
VIRTUEMART: 2.0.8e
TEMPLATE: gk_bikestore
MULTILANG. : fr_FR, en_GB, es_ES


in "../templates/gk_bikestore/html/com_virtuemart/category/default.php"

I replaced
Code: Select all
<?php /** @todo make image popup */ echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"'); ?> 


with this:
Code: Select all
<?php echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb('class="catImage" border="0"',false)); ?>



No changes are reflected in the frontend.
The product image and product name don't show, and together with the 'Product details' button still don't point to the product detail page.

The variables are empty. the first two return '0' and the last one nothing:
Code: Select all
<?php echo '<br/>virtuemart_product_id='.$product->virtuemart_product_id . '
<br/>virtuemart_category_id='.$product->virtuemart_category_id . '
<br/>img src: ' . $product->images[0]->file_url_thumb
?>


I have noticed that as well as the 'virtuemart_products' table there are 'virtuemart_products_fr_fr', 'virtuemart_products_en_gb' and 'virtuemart_products_es_es' tables.
I have checked the sql query but it seems that it's grabbing properly the data from 'virtuemart_products' table joining them with the language specific tables 'virtuemart_products_xx_xx':
file: "../administrator/components/com_virtuemart/models"
Code: Select all
$q = 'SELECT `product_name`,`product_sku`,`product_s_desc` FROM `#__virtuemart_products_' . VMLANG . '` as l JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`) WHERE `virtuemart_product_id`=' . (int)$field->custom_value;



I checked the 'gk_bikestore' template creator forum but they offer the same indication as mentionned earlier.

I'm running out of ideas. Anybody would have any idea/pointer?

Thanks in advance.
User avatar
Fresh Boarder

teitbite
Mon Aug 13, 2012 6:11 pm
Hi

Ok. Have You tried to disable our overwrite files entirely and see if it's working correctly ? You can do this simply by changing template to a joomla default one. If it will be working that I will help You to replace parts of the code from vm orginal files. If not than this is a problem vm developers will have to check.
User avatar
Moderator

GK User
Mon Aug 13, 2012 11:41 pm
Hi Teitbite,

Unfortunately, I did check this point before posting by switching to the default Joomla template "Beez2 - Default" and it failed the same way.

I did post this message on the vm forum as well.

Thank you.
User avatar
Fresh Boarder

GK User
Tue Aug 14, 2012 2:23 am
This works fine in latest versions.
File: templates/gk_bikestore/html/com_virtuemart/category/default.php
Line:201 to 203 which is below
Code: Select all
                              <?php /** @todo make image popup */
                     echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
                  ?>

Replace with below
Code: Select all
<a href="<?php echo $product->link ?>" title="<?php echo $product->product_name ?>"><?php echo $product->images[0]->displayMediaThumb("",false); ?></a>

Also in Featured products
File: templates/gk_bikestore/html/com_virtuemart/virtuemart/default_products.php
Line: 55 to 59 which is below
Code: Select all
            <?php // Product Image
               if ($product->images) {
                  echo JHTML::_ ( 'link', JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id ), $product->images[0]->displayMediaThumb( 'class="featuredProductImage" border="0"',true,'class="modal"' ) );
               }
               ?>

Replace with below
Code: Select all
            <?php // Product Image
               if ($product->images) { ?>
                  <a href="<?php echo $product->link ?>" title="<?php echo $product->product_name ?>"><?php echo $product->images[0]->displayMediaThumb("",false); ?></a>
            <?php } ?>


See you around...
User avatar
Platinum Boarder

GK User
Tue Aug 14, 2012 3:35 pm
Hi normanUK,


File: templates/gk_bikestore/html/com_virtuemart/category/default.php
Line:201 to 203 which is below

Code: Select all
<?php /** @todo make image popup */
                         echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
                      ?>



Replace with below

Code: Select all
<a href="<?php echo $product->link ?>" title="<?php echo $product->product_name ?>"><?php echo $product->images[0]->displayMediaThumb("",false); ?></a>



I updated the file '../templates/gk_bikestore/html/com_virtuemart/category/default.php' as you mentioned but unfortunately the same behaviour occurs. Product(s) are not displayed.

'$product->link' and '$product->product_name' return empty strings hence no product is shown.

I cross-checked the behaviour on the default Joomla template "Beez2 - Default" again and it failed the same way as when gk_bikestore is used.


Don't see what I'm missing. :dry:
User avatar
Fresh Boarder

GK User
Wed Aug 15, 2012 3:59 am
With permission from @teitbite , @devmogs can you please post a link to your website. Thank you.

See you around...
User avatar
Platinum Boarder

GK User
Thu Aug 16, 2012 12:18 pm
Hi @normanUK,

Here it is! This is a pre-prod env:

http://mogs.eu/dev/promosub/joo/index.php/en/connexion

Edit by Norman: Removed login details.

Then browse in english to "Home > Products > SpectR Accessories" which is a link menu of 'category layout' type.

The file '../templates/gk_bikestore/html/com_virtuemart/category/default.php' currently has got the code you mentioned in your last post:
Code: Select all
    <a href="<?php echo $product->link ?>" title="<?php echo $product->product_name ?>"><?php echo $product->images[0]->displayMediaThumb("",false); ?></a>


Thank you.
User avatar
Fresh Boarder

GK User
Thu Aug 16, 2012 12:32 pm
Additional info:

Browsing in english to "Home > Products", you should notice that "Featured Products", "Latest Products" and "Top ten Products" don't show any image, product name nor link. However, the exact number of existing product is displayed with the default "no image" box. Weird.

I just noticed that "VM - Featured products" and "VM - Best Sales" on the same page don't show either.


Thank you.
User avatar
Fresh Boarder

GK User
Thu Aug 16, 2012 10:28 pm
Can you please send new login details to my email normanuk[at] live.co.uk and I ll take a look.

See you around...
User avatar
Platinum Boarder

teitbite
Sat Aug 18, 2012 10:51 pm
Hi

Thank You Norman for taking over.

I think the empty modules is because of NSP not supporting multilangual content. I'm affraid You will have to create a module for each language separately.
User avatar
Moderator

GK User
Sun Aug 19, 2012 12:03 am
Just for reference customer is using Falang together with virtuemart. Regardless which style you use ( original or GK custom ) none of products have a product link, such as they are all pointing to a same certain url and not products itself. Can be seen from product details links on each product.

Awaiting for customer to correct his Virtuemart setup before continuing with the mod.

See you around...
User avatar
Platinum Boarder

teitbite
Sun Aug 19, 2012 6:25 pm
Hi

Ok. But was this the same with a default template? Because if this problem is a vm bug it would be good to let know about it to vm developers. Or you think it's a module issue ?
User avatar
Moderator

GK User
Sun Aug 19, 2012 8:19 pm
No it is related to users setup, basically component is not routing properly so none of the products have a proper url.

There has been problems in the past when Falang language component is used with Virtuemart.

See you around...
User avatar
Platinum Boarder

teitbite
Tue Aug 21, 2012 11:17 am
Hi

So I believe it's a problem exclusive to VM developers. devmogs please check their forum, falang is a popular extension so solution may be there already.
User avatar
Moderator

GK User
Thu Aug 23, 2012 7:51 pm
We have found the problem to be with Falang extension and fixed by making a change in a file, user will post the conclusion on this topic.

See you all around...
User avatar
Platinum Boarder

teitbite
Fri Aug 24, 2012 6:03 pm
Hi

Great to hear it :) But is it our extensions related? Does programmers know to update packages ? I know You are reporting such stuff, but I do not remember this one.
User avatar
Moderator

GK User
Fri Aug 24, 2012 9:15 pm
No this has nothing to do with our extension but for future reference following changes are required when using Falang language component with Virtuemart and if your product items does not get proper link or if system does not route product links properly.

File: /administrator/components/com_virtuemart/models/product.php
Line: 378 which is below.
Code: Select all
      if($joinLang){
         $select = ' * FROM `#__virtuemart_products_'.VMLANG.'` as l';
         $joinedTables = ' JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`)';
      } else {
         $select = ' * FROM `#__virtuemart_products` as p';
         $joinedTables = '';
      }

Replace with below
Code: Select all
      if($joinLang){
            //$select = ' l.*,p.* FROM `#__virtuemart_products_'.VMLANG.'` as l';
            $select = ' p.*,l.*';
            if ($joinCategory) {$select .= ',c.*';}
            if ($joinMf)  {$select .= ',m.*';}
            if ($joinPrice) {$select .= ',pp.*';}
            if ($this->searchcustoms) { $select .= ',pf.*';}
            if (!empty( $PluginJoinTables) ) {$select .= ','.$PluginJoinTables[0].'.*';}
            if ($joinShopper) {$select .= ',s.*';}
         $select .= ' FROM `#__virtuemart_products_'.VMLANG.'` as l';
         $joinedTables = ' JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`)';
      } else {
            $select = ' p.*';
            if ($joinCategory) {$select .= ',c.*';}
            if ($joinMf)  {$select .= ',m.*';}
            if ($joinPrice) {$select .= ',pp.*';}
            if ($this->searchcustoms) { $select .= ',pf.*';}
            if (!empty( $PluginJoinTables) ) {$select .= ','.$PluginJoinTables[0].'.*';}
            if ($joinShopper) {$select .= ',s.*';}
            $select .= ' FROM `#__virtuemart_products` as p';
      $joinedTables = '';
      }


See you around...
User avatar
Platinum Boarder

teitbite
Wed Aug 29, 2012 11:33 am
Hi

Ok. Solution looks good, but it's a modification to VM core files. I think they should know that too and update their product. With changes in this place it will be lost with any update.
User avatar
Moderator


cron