2.0.22a Related Product displayed in cart instead of childs products

Started by adaz911, July 20, 2013, 15:03:18 PM

Previous topic - Next topic

adaz911

hi,

i have products with childes products, the liste to choose from is defined via a custom filed defined on "variant childes".
For this same product, some related products are defined too, to be showen at the page bottom.

Everything works well before 2.0.22a update.

Now i have one related product showen as cart custom field and no childes appears.

All was perfect before the update...

Is there someone who has both on a product (childs and related defined)? do you have the same probleme?

PS : This not happend if there is no related product assigned, if none, everything is ok

thanks for any tips or help :)

adaz911


now i know that the issue is from :

administrator\components\com_virtuemart\models\customfields.php

still wondering where in the file...

adaz911

the problem is somewhere in the new code :

/* related */
case 'R':
$pModel = VmModel::getModel('product');
$related = $pModel->getProduct((int)$value,TRUE,TRUE,TRUE,1,FALSE);
if(!$related){
vmError('related product is missing, maybe unpublished');
return false;
}
$thumb ='';
if (!empty($related->virtuemart_media_id[0])) {
$thumb = $this->displayCustomMedia ($related->virtuemart_media_id[0]).' ';
} else {
$thumb = $this->displayCustomMedia (0).' ';
}
return JHTML::link (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $related->virtuemart_product_id . '&virtuemart_category_id=' . $related->virtuemart_category_id,FALSE), $thumb   . $related->product_name, array('title' => $related->product_name));
break;


everything is ok after putting the older :

$q = 'SELECT l.`product_name`, p.`product_parent_id` , l.`product_name`, x.`virtuemart_category_id` FROM `#__virtuemart_products_' . VMLANG . '` as l
JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`)
LEFT JOIN `#__virtuemart_product_categories` as x on x.`virtuemart_product_id` = p.`virtuemart_product_id`
WHERE p.`published`=1 AND  p.`virtuemart_product_id`= "' . (int)$value . '" ';
$this->_db->setQuery ($q);
$related = $this->_db->loadObject ();
if (empty ($related))
return '';
$thumb = '';
$q = 'SELECT `virtuemart_media_id` FROM `#__virtuemart_product_medias`WHERE `virtuemart_product_id`= "' . (int)$value . '" AND (`ordering` = 0 OR `ordering` = 1)';
$this->_db->setQuery ($q);
$thumb="";
if ($media_id = $this->_db->loadResult ()) {
$thumb = $this->displayCustomMedia ($media_id).' ';
}

Milbo

would be nice to have your BE access and link to the parent product
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

adaz911

Thanks you for your interest

it's on prod and dont think i have the right to do so  :-[ :'(

but if you update the demo store on : http://demo.virtuemart.net to the version or any other show, i can go in it and reproduce the facts

please let me know

brenee

VM  2.0.22a
Joomla 2.5.11

I too have come across this strange error after a 2.0.22a update. 

When using child/parent products with the Generic child variant custom field, the drop down variant menu for the product is inherited from the first related product on the page. 

Milbo, would you like a PM with direct link information?

Thanks

Milbo

Quote from: adaz911 on July 22, 2013, 16:57:14 PM
Thanks you for your interest

it's on prod and dont think i have the right to do so  :-[ :'(

but if you update the demo store on : http://demo.virtuemart.net to the version or any other show, i can go in it and reproduce the facts

please let me know

Funny the main developer of the software you are using would give direct and privat support, but your company rules does not allow it? Quite silly eh? Then I wont be able to help you. btw demo uses last version
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

brenee