Refresh associations - Removing serials

  • Posts: 132
  • Thank you received: 2
9 years 10 months ago #185414

-- HikaShop version -- : 2.3.5
-- HikaSerial version -- : 1.9.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.10
-- Browser(s) name and version -- : Chrome 40

Hi!

We are using HikaSerials to attach licenses to our software, we generate the licenses manually and then import them into HikaSerial, the Serials are attached to a order/product as they should upon purchase. Without any further action I can see the serial attached in the order details (in the back end), but if I then press the "Refresh associations" the serial vanishes from the order and is set to "Free to use" once more, and it appears as if the serial was never attached.

The order the is processed manually fyi.

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
9 years 10 months ago #185425

Hi,

Thanks for the report.
HikaSerial 1.9.0 has the possibility to assign "manually" some serials to an order thanks to the data stored in the colum "order_serial_params" of the table "hikashop order".
The column "order_serial_params" stored a json encoded array using this kind of organization

 'order' =>
 		[pack_id] => ( [qty var], [qty fixed] )
 'product' =>
 		[product_id] =>
 			[pack_id] => ( [qtyvar], [qty fixed] )
 'order_product' =>
		[order_product_id] =>
 			[pack_id] => ( [qtyvar], [qty fixed] )
 'serial' =>
 		[serial_id]
So if you have a serial (with the ID 50) that you want to assign to the order, you have to store in the column
{"serial":50}
Thanks to that, when you will click on "refresh association", HikaSerial will know that the serial is link with the order and it won't remove the association.

The "refresh association" is there to check the serials assigned to the order, depending the current products of the order and the data stored in the "order_serial_params" column.
The button has been made for the case when the order has changed (you added a product, changed a quantity, etc) and you want HikaSerial to check that the serials are good.

In your case, because you just stored the information in the serial, by asking a refresh, HikaSerial won't find any data saying that the order require a serial and it will remove all associations.

I hope my explanations are clear enough.
Don't hesitate to ask if you want more details.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: earmaster

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
9 years 10 months ago #185490

Hi!

Thanks for the explanation :) I have been browsing your support / doc's but couldn't find anything on the "Refresh associations" button.

To ensure that I've understood everything correctly:

HikaSerial 1.9.0 has the possibility to assign "manually" some serials to an order thanks to the data stored in the colum "order_serial_params" of the table "hikashop order".
The column "order_serial_params" stored a json encoded array using this kind of organization

'order' =>
 		[pack_id] => ( [qty var], [qty fixed] )
 'product' =>
 		[product_id] =>
 			[pack_id] => ( [qtyvar], [qty fixed] )
 'order_product' =>
		[order_product_id] =>
 			[pack_id] => ( [qtyvar], [qty fixed] )
 'serial' =>
 		[serial_id]
So if you have a serial (with the ID 50) that you want to assign to the order, you have to store in the column
{"serial":50}
Thanks to that, when you will click on "refresh association", HikaSerial will know that the serial is link with the order and it won't remove the association.

The "refresh association" is there to check the serials assigned to the order, depending the current products of the order and the data stored in the "order_serial_params" column.
The button has been made for the case when the order has changed (you added a product, changed a quantity, etc) and you want HikaSerial to check that the serials are good.


Means that if I want to have the "Refresh associations" button to "work correctly" (To not remove the licenses), I have to store the license information in the "order_serial_params" of the hikashop_order table?

IF that is the case, is there a way to get hikashop to do this automatically when a license/serial is assigned to a purchase? (Or rather when a order status is set to one of HikaSerial's "Assignable order statuses") ?

Or do I have to make a plugin / code it myself? If this is the case could you possibly give me a heads up for what "trigger" would be best to use and/or place to put this code?

Last edit: 9 years 10 months ago by earmaster. Reason: Display fix

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
9 years 10 months ago #185550

Hi,

The fact is that, you shouldn't use the button "refresh association" specially if you assign manually some serials to an order.
Like I explained in my previous post, this button is there to solve problems and reprocess the serials depending the order content.

I added a new task in the HikaSerial TODO list in order to have an interface to assign a serial to an order directly in the backend.
In your case, if you import directly the serials with the link to the order id ; the serials should be listed correctly and the "refresh association" is not required at all (because you have nothing to solve, nothing to reprocess).

If you want to make a plugin for the assignation, it's possible but I will really need to understand your process in order to guide you correctly.
But regarding the sentence

Without any further action I can see the serial attached in the order details (in the back end), but if I then press the "Refresh associations" the serial vanishes from the order and is set to "Free to use" once more, and it appears as if the serial was never attached.

I just want to say that you don't have to press on the button.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: earmaster

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
9 years 10 months ago #185558

I just want to say that you don't have to press on the button.


If there's a button, I have to press it AT LEAST once, preferably more.

Never the less, your explanations have been great and seeing as it's not something we are in need of / going to use, I will then hide the button with CSS. (The button has such a innocent name that I fear that if I don't hide it, I/Someone else might press it just to see what it does).

Thank you for your time and great support :)

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
9 years 10 months ago #185560

Hi,

If there's a button, I have to press it AT LEAST once, preferably more.

Yes I understand that it's still difficult to resist to click on a button :)
In most cases, the "refresh association" do his job and all is good ; but in your case because the serials are not coming from products of the order, the button's job is not what you expected (even if, the button does not have totally wrong, it just don't know).

That's why we added the "order_serial_params" so the "refresh association" button can do its jobs with the knowledge of the serials which should be there or not, even if there is no serial provided thanks to the products.

More than the CSS ; you can edit the HikaSerial view "orderserial | show_order_back_show" and replace
<?php if($this->show_refresh) { ?>
into
<?php if(false) { ?>
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
9 years 3 months ago #210107

Jerome wrote: I added a new task in the HikaSerial TODO list in order to have an interface to assign a serial to an order directly in the backend.


Hi Jerome, sorry to revive such an' old threat.

I simply wished to hear whether there had been any progress / status on this feature? Since it's something we have a real need of :)

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #210129

Hi,

That feature is planned for HikaSerial 1.10 but with the current developments on HikaMarket/HikaShop and the HikaShop support I'm doing when Nicolas is taking some well-deserved holidays ; I'm not able to work on HikaSerial very much.
I already start the development and some improvements in the HikaSerial interfaces (like the integration in the HikaShop product edition page).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: earmaster

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.066 seconds
Powered by Kunena Forum