- Posts: 22
- Thank you received: 0
Hikashop cart integration with T3/bootstrap
10 years 11 months ago #218608
by Kingwell
Hikashop cart integration with T3/bootstrap was created by Kingwell
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Chrome
Hi there,
Apologies if something similar to this has been posted before, i've searched around but cant seem to find an answer.
I'm trying to use the t3/bootstrap off canvas sidebar to display the mini cart, which is working correctly, but i would like to have the sidebar open when something is added to the cart, rather than the hikashop popup.
If anyone could point me in the right direction, or even point out what files i should be looking at to trigger the offcanvas sidebar that would be great.
Many thanks, Oli
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Chrome
Hi there,
Apologies if something similar to this has been posted before, i've searched around but cant seem to find an answer.
I'm trying to use the t3/bootstrap off canvas sidebar to display the mini cart, which is working correctly, but i would like to have the sidebar open when something is added to the cart, rather than the hikashop popup.
If anyone could point me in the right direction, or even point out what files i should be looking at to trigger the offcanvas sidebar that would be great.
Many thanks, Oli
Please Log in or Create an account to join the conversation.
10 years 11 months ago #218617
by Xavier
Replied by Xavier on topic Hikashop cart integration with T3/bootstrap
Hi,
Not sure but I think that the sidebar open and close is done via Javascript.
So some javascript code could be added to the page in order to open the sidebar (so see with the template provider how to do that) when the "add to cart" button is pressed.
With jQuery that could be something like that:
This code is very generic and will be call every time the customer click on an add to cart button.
That can be more specific by calling a JS function in a plugin based on the function "onBeforeCartUpdate()".
This require Javascript knowledges and in the second case PHP too.
Here is the developer documentation for the plugin part:
www.hikashop.com/support/support/documen...r-documentation.html
Not sure but I think that the sidebar open and close is done via Javascript.
So some javascript code could be added to the page in order to open the sidebar (so see with the template provider how to do that) when the "add to cart" button is pressed.
With jQuery that could be something like that:
Code:
jQuery('.hikashop_cart_button').click(function(){
// open the canvas sidebar
});
That can be more specific by calling a JS function in a plugin based on the function "onBeforeCartUpdate()".
This require Javascript knowledges and in the second case PHP too.
Here is the developer documentation for the plugin part:
www.hikashop.com/support/support/documen...r-documentation.html
Please Log in or Create an account to join the conversation.
10 years 11 months ago #218720
by Kingwell
Replied by Kingwell on topic Hikashop cart integration with T3/bootstrap
Hi Xavier,
Thanks for that, I cannot seem to find the onBeforeCartUpdate() function in any of the hikashop files, it is called in \administrator\components\com_hikashop\helpers\cart.php, but i cannot find the actual function.
I would have thought it would be located near onAfterCartUpdate() in hikashopuser.php but it doesnt seem to be there.
Thanks, Oli
Thanks for that, I cannot seem to find the onBeforeCartUpdate() function in any of the hikashop files, it is called in \administrator\components\com_hikashop\helpers\cart.php, but i cannot find the actual function.
I would have thought it would be located near onAfterCartUpdate() in hikashopuser.php but it doesnt seem to be there.
Thanks, Oli
Please Log in or Create an account to join the conversation.
10 years 11 months ago #218721
by Xavier
Replied by Xavier on topic Hikashop cart integration with T3/bootstrap
Hi,
The best will be to create a new plugin and use this function in the plugin directly.
The best will be to create a new plugin and use this function in the plugin directly.
Please Log in or Create an account to join the conversation.
10 years 10 months ago #218866
by Kingwell
Replied by Kingwell on topic Hikashop cart integration with T3/bootstrap
Hi Xavier,
Thanks for your help with this, its most appreciated.
In the end i solved the problem by placing the following code in to the off canvas loader.
By using 2 Attributes i was able to display the cart only when the actual "add to cart" button is pressed, ignoring the proceed to checkout buttons etc.
Cheers, Oli
Thanks for your help with this, its most appreciated.
In the end i solved the problem by placing the following code in to the off canvas loader.
By using 2 Attributes i was able to display the cart only when the actual "add to cart" button is pressed, ignoring the proceed to checkout buttons etc.
Code:
$document = JFactory::getDocument();
$document->addScriptDeclaration('
jQuery(document).ready(function(){
jQuery("[class*=hikashop_cart_input_button][name=add]").click(function(){
jQuery("[class*=off-canvas-toggle]").trigger("tap");
});
});
');
Cheers, Oli
Please Log in or Create an account to join the conversation.
Time to create page: 0.180 seconds