Author Topic: Product kits - a developer for new VM feature  (Read 6403 times)

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2433
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product kits - a developer for new VM feature
« Reply #15 on: November 07, 2016, 19:10:23 pm »
I don't want loose time each new VM release, so  i only publish it when Vm dev stop to change behavior on each release.

Which changed behavior on each release? I've no adjustments for all of my extensions for vm 3.0.18.
old selected Price array is not used anymore, so now you need to check if product->prices exist or not.
But in new way the prices names change too. So you cannot use one or other but have to update the right price names too.
I have other plugin in customers site using same method as me when you need to change main product price, but in the cart calculation, i mean that this method changed too.
So you have to modify the function plgVmPrepareCartProduct too, to set right prices.

bortolani

  • Jr. Member
  • **
  • Posts: 91
Re: Product kits - a developer for new VM feature
« Reply #16 on: November 07, 2016, 22:49:33 pm »
I want to write a new feature, which would combine reviews of the children and show them for the parent.

Hi Milbo,
I wrote it already. You can see it here if you are interested: www.puffosport.it/puffo2
I also created a module to show reviews with several options.

Feel free to write a review for a product if you like.

Bruno

K&K media production

  • VirtueMart Developer Team
  • Global Moderator
  • Full Member
  • *
  • Posts: 834
  • VirtueMart Version: VM3 on J3
Re: Product kits - a developer for new VM feature
« Reply #17 on: November 08, 2016, 13:50:23 pm »
old selected Price array is not used anymore, so now you need to check if product->prices exist or not.
But in new way the prices names change too. So you cannot use one or other but have to update the right price names too.

I've looked trough the calculationh.php log and can't find new names for the prices or other big changes.

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2433
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product kits - a developer for new VM feature
« Reply #18 on: November 08, 2016, 14:14:49 pm »
I've looked trough the calculationh.php log and can't find new names for the prices or other big changes.

CHeck in a vmcustom product plugin, before in vm 3.0.16 product->prices was not existing and you had to use selected price to update right price for eg. and i don't speak about vm 2.x
dump your $product in a plugin plgVmOnDisplayProductFEVM3 and plgVmPrepareCartProduct

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9416
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Product kits - a developer for new VM feature
« Reply #19 on: November 10, 2016, 08:51:47 am »
Patrick you misunderstood a lot.

We had always $product->prices and we could only hold ONE price. Now we have $product->allPrices, which is an array, which keeps all prices of the product. To know which price is active, we have now the $product->selectedPrice. But to keep it backward compatible, the $product->prices is set to $product->allPrices[$product->selectedPrice]
Code: [Select]
$child->prices = $child->allPrices[$child->selectedPrice];
But this price is set in getProduct, not in getProductSingle.

The trigger plgVmPrepareCartProduct is very important. In VM2, the cart takes just the form, thats it. For example a product had 3 length variants, you could buy a non existing variant, by manipulating the form. The trigger plgVmPrepareCartProduct checks the values of the form. So plugins can now verify the information/selection given by the user.

And all this was changed from vm2 to vm3.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9416
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Product kits - a developer for new VM feature
« Reply #20 on: November 10, 2016, 10:01:39 am »
I want to write a new feature, which would combine reviews of the children and show them for the parent.

Hi Milbo,
I wrote it already. You can see it here if you are interested: www.puffosport.it/puffo2
I also created a module to show reviews with several options.

Feel free to write a review for a product if you like.

Bruno


Yeh, then send me the code please, that I can integrate it
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/