- Posts: 9
- Thank you received: 0
Intergration Moonsoft Calcbuilder extended
-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.9.1
-- Browser(s) name and version -- : Firefox 64.0
In the Calcbuilder Extended extension of Moonsoft we have setup a price calculator which is integrated with Hikashop.
With the hikashops codes like '$hk_product_name' , '$hk_product_description' and $hk_pricehikaproduct we are able to give the correct data to the hikashop checkout. These codes are put in the PHP section of the Moonsoft Calcbuilder
Is it there a way to give a picture to the hikashop checkout?
Th moonsoft support gave the next information: "It's not possible to send and image to the new product from the calculator, as the image file is stored by hihaskop in a different table." and "You could try to create a new custom field at hikashop side 'image' attached to the product and ask hikashop support if you could fill it with an html tag from the calculator, "<img src='yourimagehere.png'>" but we suggest to check with hikashop support first if this would work when they show the product at the cart."
Please Log in or Create an account to join the conversation.
The image is not stored in a different table. The image path is stored in the same table. It's only the image data which is stored in the upload safe folder. And this requires the data of the image to be passed in $_FILES.
However, I don't know how the data is given by the calculator to HikaShop. It is done with a redirect to the add to cart URL of the product ? In that case, that won't be technically possible. Or is the add to cart done in PHP and then the calculator redirect to the checkout ? In that case, the calculator could store the image data in the correct folder and store the image path in the table like it does with other custom fields and it would work.
I'm afraid you'll have to check with them again with the additional information I gave above
Please Log in or Create an account to join the conversation.
I will let you know when they have given a reaction. Or you can participate directly on the Moonsoft forum if you like.
Regards,
AdK
Please Log in or Create an account to join the conversation.
I'm Guillermo from Moonsoft support, we think this issue should be handled here as we're the ones asking for help about hikashop
The workflow for this specific case is: the calculator adds product information to the table #__hikashop_product. Then redirects (using as you say, add to cart url) to the checkout. When we see images stored for a product in hikashop, we find the information inside the table #__hikashop_file instead, this is the 'other' table we mentioned. Or we're wrong and there is any other way to set the product image using only the product table?
As the calculator is not ready to manage the #__hikashop_file table by default, we suggested our user to confirm with you if any valid html tag, like an img with valid absolute url for ex, could be stored on a product custom field, so we can update it easily at #__hikashop_product table. as we were not sure if every part of the system, checkout, invoices, etc, will show properly this kind of information.
Thanks
Regards
Please Log in or Create an account to join the conversation.
Ok, I didn't had the full picture and I thought that the product was already in hikashop_product and that what the calculator was doing is adding that product to the cart and trying to add an image along with it.
I was thinking about something like selling a custom tshirt where the customer can enter his own image, and so in that case, it's better to use an existing product and add the data from the calculator in the hikashop_cart_product table using custom item fields:
www.hikashop.com/forum/2-general-talk-ab...-product-fields.html
So if you add a product to the hikashop_product table, the image of the product is indeed in the hikashop_file table. However, it's potentially possible to create a custom field of the table "product" and of the type "image" or "ajax image" (hikashop Business) and store the path of the file in the column of that custom field in the hikashop_product table and store the image data in the upload safe folder. That way, HikaShop can display the image along with the product (in the emails, the order, the checkout, etc) based on the display settings of the custom field. I'm thinking that might be the best solution if you don't want to manage the hikashop_file table.
Please Log in or Create an account to join the conversation.
The only thing which is not totally clear for me is: "store the path of the file in the column of that custom field in the hikashop_product table and store the image data in the upload safe folder."
I do not know how to do this with the right PHP coding but maybe Moonsoft can help me with that.
Regards,
AdK
Please Log in or Create an account to join the conversation.
yes, that would be the best solution indeed. Create the custom field at hikashop side typed image as suggested, and then you can fill it from your calculator using the image name. I think we can go back to calcbuilder forum now, we can point you to a specific tutorial there in case you need further help to configure the calculator logic.
Many thanks to hika support for the prompt response.
Regards
Guillermo
Please Log in or Create an account to join the conversation.
I am not sure if I did everything right, maybe I have made a mistake at the hikashop side so that is the reason why I post the enclosed attachment here. I
In the attachement you can see at the left hand side the screens generated by Calcbuilder at the URL www.atlasacomfa.nl/nl/alumon-calculatie
In Calcbuilder a image is defined and I want to show this image in the Hikashop checkout as shown in the right hand side of the attachment.
Below you can see the custom field which is created. Are the configuration and settings correct?
What am I doing wrong?
Best regards,
AdK
Please Log in or Create an account to join the conversation.
There is no way that you'll be able to easily display an image from a custom field instead of the image of the product.
That will require some coding of view overrides ( www.hikashop.com/support/documentation/1...-display.html#layout ) of the show_block_img for the image on the left of the product page and of the show_block_cart view file for the checkout.
For example, for the show_block_cart, you could add some code like that:
Please Log in or Create an account to join the conversation.
Can I use the same code for the show_block_img? And where do I have to place it?
Best regards,
AdK
Please Log in or Create an account to join the conversation.
Instead of $product it should be $this->element but the rest should be similar yes. and you can place it before the line starting with "echo '<img class=" there too.
Please Log in or Create an account to join the conversation.
I am an absolute beginner in PHP coding so I am not sure if I have understood everything. I have to parse the next code in show_block_img :
But I could not find any line beginning with "echo '<img_class="
Best regards
AdK
Please Log in or Create an account to join the conversation.
Regards,
AdK
Please Log in or Create an account to join the conversation.
No it's that line:
Please Log in or Create an account to join the conversation.
There is only one little thing left which is not so important but I will mention it any away.
When you change the number of articles and you click on refresh the image will disappear. See attachment.
The image appears again when you refresh the page with the refresh button of your browser.
Best regards
AdK
Please Log in or Create an account to join the conversation.
I'm not sure why it would do that.
Do you still see the img tag there if you look at the HTML of the area after the refresh ?
If so, what is the URL of the src attribute ?
Please Log in or Create an account to join the conversation.
The img tag is still there. The only difference in the HTML aera is the code
See enclosed screenshots.
Best regards,
AdK
Please Log in or Create an account to join the conversation.
Since the HTML is there, it means that there is some CSS code hiding it. Check the CSS of the HTML img tag with the browser inspector or maybe its parent, or its parent, etc until you find which one is being hidden by the CSS.
Please Log in or Create an account to join the conversation.