- Posts: 5
- Thank you received: 0
customize add to cart button
Got this in quantity.php:
Please Log in or Create an account to join the conversation.
The function is a function in the Cart Helper. It is not a function that you can change easily (because it is in the HikaShop core, so your modification will be remove with HikaShop updates).
We will see to change and improve this function, it is in our TODO list for some refactoring parts.
For the moment, I can recommend you to use the code from the cart helper (administrator/components/com_hikashop/helper/cart.php) and put it directly in your view override.
It will be easier for you to change some elements without loosing them with updates.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
next question:
where is the hikashop_product_stock composed?
i mean this form in which you can type the quantitiy with the "+" and "-" buttons
Please Log in or Create an account to join the conversation.
I think you want to override the quantity input field, like explain in our developer documentation.
www.hikashop.com/support/documentation/6...tation.html#override
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
maybe for function hikashop_image_toggle_js(&$obj){
??
}
Please Log in or Create an account to join the conversation.
I don't understand why your are talking about the function "hikashop_image_toggle_js".
I said that you have to override the quantity input field.
For the quantity input:
You need to create the file templates/YOUR_TEMPLATE/html/hikashop_button.php. We invite you to look at the file administrator/components/com_hikashop/helpers/cart.php for the default code of the function you will define in it. In that file, you will be able to define the function:
hikashop_quantity_render($html,$i,$max_quantity,$min_quantity) => The $html variable will contain the HTML of the "add to cart" button, the $i variable will contain a unique int which will be different for each quantity input on the page, the $max_quantity and $min_quantity will contain the min and max quantity possible for the product. You need to return the whole HTML at the end of your function.
Also, please note that it only works if the option for "Display the quantity field on the product page" is set to "Ajax Input" in the configuration of HikaShop.
regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
I want to override the output of the small images on the product page.
Please Log in or Create an account to join the conversation.
Ok, I see !
We don't provide example because you have to copy the code from the indicated file.
In the case of the function "hikashop_image_toggle_js", it is the helper image file.
When you open it, you can search for the text "hikashop_image_toggle_js" in the file and you will see the default javascript content include in the helper file.
The override is just a simple php file with a function which will return some "text", you can copy paste the javascript content in the helper image file as the base.
This override will be improved, we are currently working on a new image system for HikaShop.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.