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!
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";
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?
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!
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!
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.
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.
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?
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!
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.
Sorry! http:///administrator
Thanks again!
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
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!
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!
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
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.
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
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.
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
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.
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.
Not working on edge either.
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?
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.
Woohoo! It worked!
I did change the "use calc builder html editor." Could that have been a factor?
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?
Perfect. Worked 100%
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.
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.
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.
Thanks SO much! You've been a lifesaver!
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
FANTASTIC!
You are a rockstar!
You guys are going to get a 5 star review, for sure.
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.
Nevermind. I'm slow. It's in the custom products section.
Thank you again!
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
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!
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.
Nevermind. Fixed the Excel formulas, and it fixed everything else.
Hi,
ok, we'll close the ticket with that solution please open a new one in case you find further issues.
Regards
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.