Author Topic: GENERAL QUESTION: Weight of custom fields  (Read 3738 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: GENERAL QUESTION: Weight of custom fields
« Reply #15 on: February 01, 2017, 23:49:21 pm »
Of course, in VM2 you was not able to do it natively, because some trigger was missing but remember what was all the TODO in vm2. in customfields as in payment and shipment plugins
Note that a trigger in VM3 is not right, the stockUpdate trigger, because it's not possible to modify general quantity, you have to fully rewrite the stock update in the plugin.
Eg, if you have a plugin that need to handle on order state change 5 in stock for 1 quantity in the order or cart, main quantity before stock update cannot be set from plugin(note: i don't checked in last 3.0.19)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9591
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: GENERAL QUESTION: Weight of custom fields
« Reply #16 on: February 03, 2017, 09:34:04 am »
trigger updateStatusForOneOrder ?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: GENERAL QUESTION: Weight of custom fields
« Reply #17 on: February 03, 2017, 13:51:11 pm »
I mean in function handleStockAfterStatusChangedPerProduct($newState, $oldState,$tableOrderItems, $quantity) {

line $dispatcher->trigger('plgVmGetProductStockToUpdateByCustom',array(&$tableOrderItems,$param, $productCustom)); have not the quantity, so it's not possible to change main quantity.
In my cas for eg. It's for "electronic kits", so the main quantity change is "0" because the elements in the kit use completly different products.
So in the called handleStockAfterStatusChangedPerProduct product, the quanitty change is "0", but for the elements in the kit, quantity change depending the custom field.
So the right way for me is to use
$dispatcher->trigger('plgVmGetProductStockToUpdateByCustom',array(&$tableOrderItems,$param, $productCustom,&$quantity));
then you can change quantity by plugin if needed and not have to rewrite completly the same function for order statut (copy paste with some changes).
Another problem is that $newState, $oldState is not send to plugins so you cannot easy veriify what to do and have to get order status another way.


eliotrayner

  • Beginner
  • *
  • Posts: 3
Re: GENERAL QUESTION: Weight of custom fields
« Reply #18 on: May 16, 2018, 13:25:58 pm »
Hi Studio 42

Did you get anywhere with this? I am trying to do a similar thing in VM 3.2.12 aka alter quantity and id of product to have stock updated.

I am also using ... $dispatcher->trigger('plgVmGetProductStockToUpdateByCustom',array(&$tableOrderItems,$param, $productCustom,&$quantity));

thanks
Eliot


Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: GENERAL QUESTION: Weight of custom fields
« Reply #19 on: May 16, 2018, 18:05:53 pm »
Hi, i dont checked, if the core has change, i wrote the updater manually, but this need a big code for nothing, only because quantity do not exist.

eliotrayner

  • Beginner
  • *
  • Posts: 3
Re: GENERAL QUESTION: Weight of custom fields
« Reply #20 on: May 16, 2018, 18:41:40 pm »
Hi Studio 42,

I also wrote my own updater but it was a good pointer for me adding in the &$quantity

thanks

servlet

  • Jr. Member
  • **
  • Posts: 344
  • Business optimization
    • Фототапети
  • VirtueMart Version: 3.2.2
Re: GENERAL QUESTION: Weight of custom fields
« Reply #21 on: May 19, 2018, 14:44:23 pm »
Is there any development for Weight of custom fields
I am using: Joomla 3.7.2 VM 3.2.2
Он-лайн магазин за фототапети http://mishelfoster.com

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: GENERAL QUESTION: Weight of custom fields
« Reply #22 on: May 19, 2018, 20:05:59 pm »
Is there any development for Weight of custom fields
It's possible to change weight using a product customfield plugin but not with Virtuemart core custom fields.

servlet

  • Jr. Member
  • **
  • Posts: 344
  • Business optimization
    • Фототапети
  • VirtueMart Version: 3.2.2
Re: GENERAL QUESTION: Weight of custom fields
« Reply #23 on: May 20, 2018, 07:57:02 am »
Ok, but which one?
I am using: Joomla 3.7.2 VM 3.2.2
Он-лайн магазин за фототапети http://mishelfoster.com

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: GENERAL QUESTION: Weight of custom fields
« Reply #24 on: May 20, 2018, 10:47:45 am »
What is your need, A dropdown, a checkbox ...?

servlet

  • Jr. Member
  • **
  • Posts: 344
  • Business optimization
    • Фототапети
  • VirtueMart Version: 3.2.2
Re: GENERAL QUESTION: Weight of custom fields
« Reply #25 on: May 20, 2018, 12:47:04 pm »
Dropdown, thank you
I am using: Joomla 3.7.2 VM 3.2.2
Он-лайн магазин за фототапети http://mishelfoster.com

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: GENERAL QUESTION: Weight of custom fields
« Reply #26 on: May 20, 2018, 16:27:20 pm »
Check here https://forum.virtuemart.net/index.php?topic=127362.0, if i'm right, it support weight parameters.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2752
  • VirtueMart Version: 3.2.15
Re: GENERAL QUESTION: Weight of custom fields
« Reply #27 on: May 21, 2018, 09:27:51 am »
Yes it does - but it doe not support stock control on VM
regards
A

Joomla 3.8.8
php 7.0

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9591
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: GENERAL QUESTION: Weight of custom fields
« Reply #28 on: May 29, 2018, 15:56:57 pm »
https://extensions.virtuemart.net/product/products/custom-size-detail

has also a method to set the weight.

line $dispatcher->trigger('plgVmGetProductStockToUpdateByCustom',array(&$tableOrderItems,$param, $productCustom));

imho the $tableOrderItems has the weight.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/