Author Topic: 2.0.22a Related Product displayed in cart instead of childs products  (Read 5913 times)

adaz911

  • Beginner
  • *
  • Posts: 4
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

  • Beginner
  • *
  • Posts: 4
Re: 2.0.22a Related Product displayed in cart instead of childs products
« Reply #1 on: July 20, 2013, 22:21:52 pm »

now i know that the issue is from :

administrator\components\com_virtuemart\models\customfields.php

still wondering where in the file...

adaz911

  • Beginner
  • *
  • Posts: 4
Re: 2.0.22a Related Product displayed in cart instead of childs products
« Reply #2 on: July 20, 2013, 23:51:05 pm »
the problem is somewhere in the new code :

Code: [Select]
/* 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 :

Code: [Select]
$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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10087
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.22a Related Product displayed in cart instead of childs products
« Reply #3 on: July 22, 2013, 15:20:44 pm »
would be nice to have your BE access and link to the parent product
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

adaz911

  • Beginner
  • *
  • Posts: 4
Re: 2.0.22a Related Product displayed in cart instead of childs products
« Reply #4 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

brenee

  • Beginner
  • *
  • Posts: 12
Re: 2.0.22a Related Product displayed in cart instead of childs products
« Reply #5 on: August 10, 2013, 00:37:51 am »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10087
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.22a Related Product displayed in cart instead of childs products
« Reply #6 on: August 10, 2013, 07:53:44 am »
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
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

brenee

  • Beginner
  • *
  • Posts: 12
Re: 2.0.22a Related Product displayed in cart instead of childs products
« Reply #7 on: October 01, 2013, 19:32:27 pm »
After an update to VM 2.0.22c this bug has been solved.