CalcBuilder Forum

Use Calcbuilder's Hikashop product code

User veli 2017-10-06 12:38:54

Hi,
have seen that I can use the session Id or name to keep track of my product, but it would be a lot easier if the product code that I am sending to Hikashop from Calcbuilder ('COD') could be used also in the calcbuilder forms.
Have tried all kinds of things, but can't get this to work. Is this because it is only 'made' the moment the product is added to the cart?
If so, would sessionID/name be a better way to set the product code?
(I am looking for a code that is everywhere the same, after 'calculate' is pressed, so we can always find the customisations of the client very easily).
Thanks!

Moonsoft support 2017-10-06 21:34:36

Hi,
we're not sure of what you're trying to achieve,sorry. When you use Calcbuilder as an external module to link with hikashop, the dynamic product is created at the time you add it to the cart, could you please provide more details about where do you want to recover this code afterwards?

Regards

User veli 2017-10-07 08:09:39

Hi,
thanks for the quick reply!
I am using the Calcbuilder code which is ending a product code to Hikashop. The product that is being made within calcbuilder has characteristics that I need to know in order to prepare the product for the client (the client selects a part of a print, in an image). I have all this working in the Javascript part, but would like to use the Clacbuilder generated product code also in Calcbuilder so this code can serve to identify the product.
I know I can make my own code with SessionID or Name but your 'COD' is a lot shorter.
I have seen the 'COD' is generated each time a calculation is done, but I understand now that obviously that is too late to get it out of the product table and will always be empty.
Is there a way to (easily) generate a different code that is not as long as sessionID or Name so I van give this code to Hikashop and also have it on the PDFs generated?
Thanks as always for your help!

Moonsoft support 2017-10-07 10:44:37

Hi,
ok, so you're searching for an unique identifier generated at the calculator that can help you to identify each calculation/product, right? We can think in some kind of numeric code, for example based on actual date:

$yourcode=date("ymd/his");

So you can use ##yourcode## both at calcbuilder pdf, and/or pass it to your new hikashop product.

You can check more format options for date here:

http://us3.php.net/manual/en/function.date.php

Hope this helps, regards

User veli 2017-10-07 11:07:37

Thanks! That is an excellent solution indeed!

...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!