CalcBuilder Forum

Hikashop with Excel spreadsheet

User 2019-04-23 13:26:39

Hi there,

I've uploaded a spreadsheet as a calculator, created fields, mapped them etc. Now how do I make that work with HikaShop?

I want to be able to get the input from the Hikashop product, and use the output from the spreadhseet.

Thanks.

User 2019-04-23 15:48:35

Hi again.

Figured out how to create the form, and how to get the output to show up on the page, but now I am struggling with the price and the "add to cart" button.

How do I get the price that's been calculated on my form to show up on the page, AND how do I get all of this added to the cart?

Also, how do I change the filename for the excel and PDF files? I want it to reflect the site name - not your component!

Thanks. Here's what it looks like so far. Mostly working, need a little help!

Moonsoft support 2019-04-23 18:30:24

Hi,
ok, we assume the page you attach is not a hikashop product page with its custom fields, right? It's a form directly built with calcbuilder that you want to link with an 'add to cart' button once the results are calculated and shown at the page. This kind of integration with hikashop requires you to enable the 'add to cart' button for hikashop at the module/component configuration, and add some lines to your calculator, as explained here:

https://www.moonsoft.es/easyblog/entry/24-calcbuilder-extended-hikashop-integration

basically, if you have your quantity calculated as

myquantity

and your price as

myprice

, you only need to add to the calculator code section:

$hk_product_name='Write your product name here';
$hk_product_description='Write your product description here';
$hk_product_code='COD';

$hk_quantity=$myquantity;
$hk_pricehikaproduct=$myprice;


there are many other extra options, but with this code you should be able to add your product to the cart. If you have further problems to complete configuration you can share an access and we'll take a look to find out if there is any step missing.

Regarding file names, you should be getting a random number as the name of the file, something like xxxxx_cb.pdf , if you want to change it you can modify the function in charge of naming the file, here:

components/com_calcbuilder/models/calcbuilder.php
about line 750,798 and 802, you will find

$filename=rand(1000, 9000)."_cb.pdf";

or
$filename=rand(1000, 9000)."_cb.xlsx";

You can set any other name
$filename="mysite.pdf";
or

$filename="mysite.xlsx";

User 2019-04-23 22:24:23

Thanks!

I know this is a very dumb question too, but how do I get the price to show up on the page too? I've mapped the field as an output, but I assume because I am also using an excel sheet as an output, it's overriding that. Do I just add a price to the Excel sheet?

User 2019-04-23 22:36:48

Hi again,

Just checked, and I have the add to cart button activated, so I think the problem is to do with pricing.

As I said, I have mapped the field to the price, but it is on a different sheet to the material list, which I also need to show. Do I add the price to that sheet, and then map it as an output?

Is there a specific name I need to assign to the price?

Also, how do I alter the appearance of the material list? I need a little more room between the name, the qty and the price. Should I just override the css?

Thanks again!

User 2019-04-23 22:50:10

Hi,

Added the price to the output sheet, mapped the field using the var "myprice" and added the code (there's no quantity, as it's a lumpsum based on a pick list.)

I've made you a temporary account.

I've also attached the spreadhsheet I need to base this on. The calculator page is not what I need to see on the product page. The page with the parts list is.

I have to create three more products this way, so if you could help to get this one working, that would make that a lot simpler!

User 2019-04-23 23:09:48

Okay. Looks like I can't add the sheet here.

But basically, the calculator, input fields and pricing are on one sheet, and the output is on a different sheet.

Moonsoft support 2019-04-24 09:38:28

Hi,
ok, you can show the final price at the result section together with the rest of information, it doesn't matter if it's calculated on a different sheet. We can finish the configuration of this first product so you can see how all parts are linked, but we have a first an important question, based on your comment (The calculator page is not what I need to see on the product page)

There are 2 different ways to use a calcbuilder calculator together with hikashop cart. The first one is the solution you have created, you have a calcbuilder form, the calculate button gives you a result, a price and a full description if needed, and the add to cart button adds this product to the cart. The hikashop checkout continues normally from here.

The other one: you have a hikashop product at your catalog, and it contains the configuration fields that make the price change. They are hikashop fields, created as custom fields for 'item' at hikashop backend. The calculator is attached to this existing product, it recovers the user input fields from the default hikashop product page (with this option the calculator behaves 'silently' at the background), and when add to cart is clicked the product is added to the cart. The add to cart button and the rest of the checkout are the default hikashop ones.

We'd need to confirm first which is the solution you'd want to build, so we can finish your configuration in one or another way. Please zip the excel file before attaching to the ticket, so it won't be filtered by the firewall, thank you.

User 2019-04-24 15:22:20

Here you go. The worksheet. In case you need it to finish this off.

The way it's set up now is fine. I don't need to use the store products, and I need to be able to manipulate certain things to get an accurate price.

Can you confirm if the output can be styled by adding custom CSS, or if there's some other way to make it look a bit better?

User 2019-04-25 04:28:47

Hi again,

Just realized it might not have been clear what I said.

There are two sheets. Both do calculations, but one is just for the output (no prices, product descriptions etc.) That one needs to show on the product page, as it does, when the "calculate" button is used.

If possible, it can also show on the order page / cart. I assume it will also show up in some way in the backend, so I can process the order?

Anyway, I don't think there's too much left to be done, so hopefully you can get this done for me ASAP. I need to finish this site and have it ready for sales by next week, so I am in a time crunch!

Thanks!

Moonsoft support 2019-04-25 09:13:44

Hi,
ok, it shouldn't take long to finish configuration. But please confirm which is your url, we've rechecked this thread and we only find the user and pass some updates above.

User 2019-04-25 09:21:44

Sorry! http:///administrator

Thanks again!

Moonsoft support 2019-04-25 11:12:44

Hi,
ok, we added a couple of changes. As you were returning the result price with a $ sign, we removed it before passing it to hikashop, it only requires a number, so it doesn't allow the currency sign. In order to add all the information from the result, we added all the result sheet to the product description.
At the javascript tab, we also added some quick styles for a better looking of the result, this is only an example, all rows and columns have their own classes so you can tweak them as needed and style specific rows and/or columns.

Hope this helps, regards

User 2019-04-25 18:25:56

Hi again,

I just tried it on the front end, and when I hit calculate, it does nothing. It was generating the parts list and price before... so I guess it's not completely fixed yet.

Can you take another look? If you login to the front end and go here: http:////-standard-calculator

you can test the calculator as users will see it.

Thanks.

P.S. Please could you check this out ASAP? I have very limited time until this site has to go live!

User 2019-04-25 19:12:57

Hi again.

Seems like there's another problem. Every time the calculator is used, it creates a new product in the store. I don't need it to do that.

I just need it to calculate the parts and price for the customer.

Is that possible, OR, should I create a category for "full system orders" or something, and not publish that on the front end? I don't want the store to be cluttered up with calculations!

Moonsoft support 2019-04-26 09:30:27

Hi,
if you want to send to the cart a new different product, with different price and different description, you need to create a new product, hikashop requires to have the product created on its database if you want to use it at the checkout. For the calculator you can set any parameter of the product present at the main hikashop database product table, for ex, setting 1 as the quantity available (so once 'purchased' hikashop won't publish it), with the sales date only for today/now..etc.

The other option we explained was to use an existing product of your catalog, was the 2# solution we mentioned above:

The other one: you have a hikashop product at your catalog, and it contains the configuration fields that make the price change. They are hikashop fields, created as custom fields for 'item' at hikashop backend. The calculator is attached to this existing product, it recovers the user input fields from the default hikashop product page (with this option the calculator behaves 'silently' at the background), and when add to cart is clicked the product is added to the cart. The add to cart button and the rest of the checkout are the default hikashop ones.

Or, if you don't want product checkout, don't use hikashop at all. If you ask for the user data at the calculator form, you can send yourself and the customer an email with all information of the request. But we assumed this was not valid if you have other products at the catalog that will follow hikashop checkout normally.

Yesterday we left the calculation, product and forward to cart function working (even with some style tweaks, although please note the configuration service is far away the scope of the support of the extension). The calculator is still working (attached), but the hikashop checkout is showing an error, probably you wrongly configured any checkout option at hikashop side (per the query, regarding shipping, maybe). If you can't see the calculator working, please refresh your browser and send us more details about browser, inputs used etc so we can reproduce here.

Best regards

User 2019-04-26 09:39:14

Sorry. Guess there's a bit of a language barrier. It's kind of hard to understand what you are saying...

I didn't touch anything on the site though, and it wasn't working today... so not sure what happened.

Can you send me detailed instructions or a link to a detailed tutorial how to do this? I don't need you to do everything for me, but again, the information I found on your site wasn't exactly clear. Probably the language barrier again.

As for the scope of support, I have no idea what that is, and I didn't see anything on your site.

Send me a link to instructions and I will try to figure it out myself.

Moonsoft support 2019-04-26 09:59:35

Hi,
ok, sorry if our English is not clear enough, let's try to explain better:

- when we say the configuration work is not part of the default support it means the support (of this extension or any other one) solves questions regarding installation, errors, or specific questions about configuration. We have a custom calculator service for which we deliver the calculator ready to publish, but that is a different service from the extension support. We entered your site and finished configuration even adding some styling to have a better looking result. We understood you are in a hurry and you had everything almost ready anyway, so it's ok, it was only a comment.

- there is a section with all tutorials regarding integration with hikashop, at this site, tutorials->calcbuilder section. But each calculator has its own specific requirements so we don't mind to help with some specific needs (for ex, you wanted to add the whole result to the product description, thus the extra lines at the code section). Everything was working yesterday, we calculated many times, and we added the products to the hikashop cart, then we exit your site and updated the ticket, no more changes from this side.

As there are 2 parts here, the calculator form and the hikashop checkout let's start with the first part so we all are at the same point. Please enter the form(refresh your browser if needed), add some example data, and click calculate. What do you see? if the result doesn't come back as the screenshot we attached, please send:

which browser are you using
the inputs you introduce

so we can reproduce and look for errors, from here testing from different browsers is working ok at this time.

Regards

User 2019-04-26 10:05:17

Hi again,

Okay. From what I understand, this method of doing things won't deliver the result I need though, so I have to do it the other way anyway.

If this method is always going to create a new product, then I can't do it this way.

I have to use the field mapping option.

The button on the frontend didn't work at all though, on Firefox. So not sure what that's about.

I am going to try to find the information now, so I can start again.

Moonsoft support 2019-04-26 10:12:57

Hi,
ok, but as we mentioned above you could set that the product is only available for one purchase and/or that is out of date so it won't be shown on the catalog, this is not valid for your case?



Regards

User 2019-04-26 10:14:54

Yes! Sorry! I didn't see that part!

Let me go have a look now, and see what's happening. Sorry, it's 1:15AM here.

Tough to think at this time of night.

User 2019-04-26 10:16:48

Okay. Just tried. Logged in, put in the necessary parameters, hit calculate, and it did nothing.

I am using Firefox. Going to try on Edge quickly, but it was working fine on Firefox before.

User 2019-04-26 10:18:42

Not working on edge either.

User 2019-04-26 10:22:51

I don't know what the issue could be with checkout, because it works for all the products in the store. I've tested that extensively, and I don't know how your component is supposed to integrate with that?

Moonsoft support 2019-04-26 10:26:20

Hi,
in fact the product is a default one, with default settings, so it's added to the cart same as it was selected from the catalog. Let's first focus on the calculation part. We've disabled the hikashop button for now, please enter the form again ,and let us know if you can see any result now with either browser.

User 2019-04-26 10:32:57

Woohoo! It worked!

I did change the "use calc builder html editor." Could that have been a factor?

Moonsoft support 2019-04-26 10:49:51

Hi,
no, that's only for backend process, we guess your frontend problem was due to the number formatting, that's why we ask for the inputs being used, probably we were trying with numbers like $950.50 and your result was like $1,150.55 and hikashop was not accepting the comma. Next step, please calculate and try to add to cart. What do you see now?

User 2019-04-26 10:56:49

Perfect. Worked 100%

User 2019-04-26 10:57:48

Now the only question is how do I set it so it can only be bought once? I assume that's a code thing too? I want it to be bought from the sheet, but it shouldn't be added to the store.

User 2019-04-26 11:00:36

Thank you so much for helping me! I could have messed around with it and eventually figured it out, but this is MUCH easier.

I will be able to copy this to create the other products I need too, so that will be quick and easy.

Moonsoft support 2019-04-26 11:13:23

Hi,
ok, we'll search which parameter/s can be set according to your hikashop configuration in order to remove these custom products from user view. This is done also at the code section, and would be identical for any other product, so once completed, you only need to copy all code section to your other products, and maybe change the main description title if needed. We'll let you know which is the best approach here.

User 2019-04-26 11:14:40

Thanks SO much! You've been a lifesaver!

Moonsoft support 2019-04-26 12:54:34

Hi,
ok, we've attached these new products to a new category 'custom products' so it won't be present at your shop catalog. You could even remove these products periodically using the mass actions from hikashop configuration.

Regards

User 2019-04-26 12:57:49

FANTASTIC!

You are a rockstar!

You guys are going to get a 5 star review, for sure.

User 2019-04-26 13:05:56

Sorry. Very stupid question. But where do I see the calculations that match the order in the backend?

Do I just find the category, and look there? When I click on the order, I get a 404 page, obviously because it's not published.

User 2019-04-26 13:08:53

Nevermind. I'm slow. It's in the custom products section.

Thank you again!

Moonsoft support 2019-04-26 13:18:10

Hi,
right, but it should be visible from the orders product detail as well. Discard the previous orders because the products are not there anymore, but if you complete a new order, and you go to orders and click on the order number to access detail, the product name should link to
a 'front end' simulated view of the product with all details below.

Regards

User 2019-04-26 13:23:21

It is!

Thanks!

I will see how it all works in the morning, but you've been a life saver.

I've backed the site up too - just in case I mess it up somehow!

User 2019-04-28 23:06:23

Hi,

Sorry! Setting up the other calculators now, and I've got everything to work, but some of the fields are giving me a #VALUE error on the excel sheet output.

The sheet is basically the same, and when I view it in excel, there's no problem. Trying to figure out why it would be doing that, since the settings, as far as I can tell, are the same. I also checked, and those fields are set to not required, so I don't know why it would be returning that error!

Going to keep looking for an issue, but if I haven't let you know what could be causing this, could you have a look? Here's the frontend link.

http:////-calculator

I don't need you to log in or anything. I assume this is a simple solution.

User 2019-04-28 23:14:10

Nevermind. Fixed the Excel formulas, and it fixed everything else.

Moonsoft support 2019-04-29 09:25:36

Hi,
ok, we'll close the ticket with that solution please open a new one in case you find further issues.


Regards

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!