VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: doorknob on March 20, 2008, 01:46:13 AM

Title: Recently Viewed Products problem
Post by: doorknob on March 20, 2008, 01:46:13 AM
The Recently Viewed Products feature on the flypage shows the wrong Product Name when the product is an item of another product.

To reproduce:
1 Load the demo data shipped with nightly build
2 Navigate to the ladder product
3 Using the drop down, select a ladder variant (e.g. Plastic Ladder)
4 Navigate to a third product and view product detail (to ensure tha the flypage is active. The recently viewed products list will show two entries for 'Ladder'. Clicking on them will demonstrate that the two entries are for different products

The problem can be resolved with a simple change to administrator/components/com_virtuemart/classes/ps_product.php
Lines 2461 to 2463 are currently as follows:

$db->query( $q );
if(!$this->is_product($prod_id )) {
    $prod_id_p = $this->get_field($prod_id,"product_parent_id");

This should be changed to:

$db->query( $q );
$recent[$k]['product_name'] = $db->f("product_name");
if(!$this->is_product($prod_id )) {
    $prod_id_p = $this->get_field($prod_id,"product_parent_id");
    $recent[$k]['product_name'] = $this->get_field($prod_id,"product_name");


and then delete the following (at line 2486 before the above changes):

$recent[$k]['product_name'] = $db->f("product_name");


VM 1.1 Nightly Build 19-03-2008
Joomla 1.5.1
Apache 2.2.8
MySQL 5.0.51a
PHP 5.2.5

Regards
Phil