Skip to main content

Hikaserial Importer is allowing duplicate serials

More
10 years 10 months ago - 10 years 10 months ago #223113 by jschroeder
-- HikaShop version -- : 2.6.0
-- HikaSerial version -- : 1.10.0
-- Joomla version -- : 3.4.5

Hikashop importer allows duplicate serial numbers. When I import a set of serial numbers into a pack in hikaserial it allows me to import the same set of serial numbers 2 times causing duplicate serial numbers. This cannot happen for the company we are doing this for because they will have different people importing the csv and we cannot rely on them to know if they have already uploaded the csv already.

For example with the set of data below. If I import this csv in 2 times then the hikaserial importer imports the serial data twice and then we have duplicate serial numbers. I do realize I can use the serial_id column, but that is not a viable option for the company we are doing this for. It is for a very large company and the upload has to be full proof . I need the hikashop importer to check the serial_data column when the csv is uploaded and if it sees that the serial already exists in the serial_data column that it will not import that line in, in the csv or allow that duplicate serial number to be imported.?

How would I go about getting this to work? I do not think the importer currently has an option for this. However, this particular company pays for each serial number they use and each serial is attached to a specific dollar amount so there absolutely cannot be duplicate serial numbers. If duplicate serials accidentally happened they would be overselling their serials and then when a customer would come in their gift certificate would not work which would be very bad.

I cannot be the only one that needs this, I cannot see how any company would want duplicate serial numbers allowed in the database. What I would see making the most sense is having an option in the back end of the hikaserial import that says "do not allow duplicate serials when importing" or something like that, that would allow for this functionality.

This is a pretty urgent thing any help would be greatly appreciated.
Code:
pack_name serial_data serial_status printable gift cards $PQ9K6XTZ Free to use printable gift cards $P27MF5W6 Free to use printable gift cards $PRN1BDDC Free to use printable gift cards $P3ZMPKWY Free to use printable gift cards $P7JS0M61 Free to use printable gift cards $PRZVCBLZ Free to use printable gift cards $PQGMH059 Free to use printable gift cards $PQSDP3VC Free to use printable gift cards $PNF6PQNW Free to use printable gift cards $PZLGB6LD Free to use
Last edit: 10 years 10 months ago by Jerome. Reason: remove duplicate content - [code] is nice

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

More
10 years 10 months ago #223124 by Jerome
Hi,

That's right, there is currently no check made during the import in order to avoid the serial duplication.
But that is something which can be added.
With a little modification of the structure, the import could check the "serial data" before the insertion (only when there is no "serial_id") and exclude the serial which already exist in the database.

Regards,

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

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

More
10 years 10 months ago #223126 by Jerome
Hi,

After a deeper analyze ; HikaSerial could have such kind of option to avoid serial duplication during import.
It can't be the default value because having identical serials is authorized and can be useful for some specific cases.
Now ; that's also right that some case need checks to avoid duplication.

But ; in order to know more about the specifications ; When it checks if the serial already exists, does HikaSerial have to check only in the same pack or in all packs ?
You import sample only concern one single pack but it could also list other packs.
Depending if your using several packs or not, if the duplication can be authorized or not.. The algorithm will change a lot !

Regards,

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

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

More
10 years 10 months ago - 10 years 10 months ago #223127 by jschroeder
Thank you for the reply. It would need to check in all packs not just the same pack it is under.

I would think that would be the case though with anyone using serial numbers. The pack should be irrelevant because you only want someone using a serial number 1 time regardless of the pack it is under.

I would think it would just need to check the serial_data column and look to see if the serial already exists and if it does not import it into any pack but maybe it is more complicated than that?
Last edit: 10 years 10 months ago by jschroeder.

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

More
10 years 10 months ago #223129 by Jerome

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: jschroeder

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

More
10 years 10 months ago #223140 by jschroeder
Thank you so much works perfectly! You all have amazing support I always recommend this shopping cart and your products to everyone!

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

More
10 years 10 months ago #223141 by Jerome
Thanks !

With the issue reported on another thread ; I was working on a new release.
So it was a good opportunity to include directly that feature into HikaSerial than just giving you the files to modify.
www.hikashop.com/forum/16-serial-bug-rep...-problem.html#223094

After that, I'm really fan of recommandation by word of mouth but HikaSerial is also listed on the Joomla extension directory and, for a partially unknown reason, just have 2 reviews.

Regards,

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

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

More
10 years 9 months ago #223948 by fernando.alh
Hi! I need exactly the contrary, I need some duplicated serials. After the update, I can't import duplicated serials even though the button "Check duplicate serials" is set to NO. It says "DUPLICATE_SERIAL_IN_CONTENT".

Let's say that there is 3 unique serials and 3 duplicated.

So HikaSerial imports the 3 unique serials and 1 from the duplicated ones. I have to import manually every duplicated serial.

Help Please!

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

More
10 years 9 months ago - 10 years 9 months ago #223952 by jschroeder
There may be some sort of bug with the update and I am not sure about if the button is broke, but from what I understand if you assign a serial_id along with serial_data I am pretty sure that will allow you to do what you are trying to do. Each serial_data has its own serial_id assigned with it just like each joomla article has its own article id associated with each article. So, if you have a 3 duplicated serials but you assign 3 different serial_id's to each it should allow for this if you are doing a csv import and have the button turned to no.
Last edit: 10 years 9 months ago by jschroeder.

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

More
10 years 9 months ago #223964 by Jerome
Hi,

The serial import default behavior hasn't changed.
By default the setting "check duplicate serials" is "no" ; to continue to not check the serial duplication.

If you ask HikaSerial to check for duplicates, it will do so ; except if you specify the "serial_id" because it means that you are updating serials (and you know exactly what you do).

Regards,

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

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

More
10 years 9 months ago #224163 by fernando.alh
I'm sorry for insisting, but I have more than a year working importing serials with hikaserials and never before got the DUPLICATE_SERIAL_IN_CONTENT error even though having duplicated serials in the list. All this is happening after the last update.

I tried what you said, to add ,serial_id in the top and to assing a number to each of the serials in order not to have conflicts. It didn't work. The "Check duplicate serials" button is set to NO and still receiving a DUPLICATE_SERIAL_IN_CONTENT error for each repeated serial. :(

All this is delaying my work

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

More
10 years 9 months ago #224165 by Jerome
Hi,

Okay.
In the file "administrator/components/com_hikaserial/helpers/import.php" you will find the block
Code:
if(isset($serials[$serial_data])) { $app->enqueueMessage(JText::sprintf('DUPLICATE_SERIAL_IN_CONTENT', htmlentities($serial_data)));
You can replace it with
Code:
if($checkDuplicates && isset($serials[$serial_data])) { $app->enqueueMessage(JText::sprintf('DUPLICATE_SERIAL_IN_CONTENT', htmlentities($serial_data)));
to avoid the internal check in the imported content.
I'll also update the HikaSerial package.

Regards,

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

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

More
10 years 9 months ago #224171 by fernando.alh
I did it. I don't get the error. But I'm trying to import 10 duplicated serials and Hikaserial imports only 1. What to do?

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

More
10 years 9 months ago #224172 by Jerome
Hi,

Ah yes, there is still the merge on the serial data.
You need to replace
Code:
$serials[$serial_data] = implode(',', $serial);
By
Code:
if($checkDuplicates) $serials[$serial_data] = implode(',', $serial); else $serials[] = implode(',', $serial);
which is just below the previous modification.
I'll arrange a little bit more the code, process some tests and I'll update the HikaSerial package. But that patch would fix your issue.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: fernando.alh

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

More
10 years 9 months ago #224173 by fernando.alh
Jerome, now it works as it used to. Thank you very much ;)

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

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