- Posts: 56
- Thank you received: 1
Add to cart redirect
3 years 10 months ago #347140
by jiawen
Add to cart redirect was created by jiawen
The add to cart in product detail page, after click will redirect to the cart page, is it any way to stop the redirect to cart? Just want it to have the product added into cart and stay on the same page.
Please Log in or Create an account to join the conversation.
3 years 10 months ago #347147
by nicolas
Replied by nicolas on topic Add to cart redirect
That should be the default behavior to stay on the same page.
I see two potential reasons for that to not happen:
- The "HikaShop cart notification" plugin has been disabled, or has been configured to redirect on successful add to cart. So please chekc that plugin in the Joomla plugins manager.
- There is a javascript error on the page which leads to the add to cart to work in "fallback" mode and in that case a redirection to the checkout is mandatory after the add to cart. We would need a link to a product page to be able to check on that.
I see two potential reasons for that to not happen:
- The "HikaShop cart notification" plugin has been disabled, or has been configured to redirect on successful add to cart. So please chekc that plugin in the Joomla plugins manager.
- There is a javascript error on the page which leads to the add to cart to work in "fallback" mode and in that case a redirection to the checkout is mandatory after the add to cart. We would need a link to a product page to be able to check on that.
Please Log in or Create an account to join the conversation.
3 years 10 months ago #347179
by jiawen
Replied by jiawen on topic Add to cart redirect
Hikashop cart notification has turned on and applied with the webpage option.
ezfun.satumalaysiahosting.com/mall/epide...-adult-502-promotion This is the product link.
ezfun.satumalaysiahosting.com/mall/epide...-adult-502-promotion This is the product link.
Please Log in or Create an account to join the conversation.
3 years 10 months ago #347183
by nicolas
Replied by nicolas on topic Add to cart redirect
Hi,
From what I can see on your link, the issue is that you've activated the redirect on success setting of the HikaShop cart notification plugin.
Turn that setting off and it will stay on the same page.
From what I can see on your link, the issue is that you've activated the redirect on success setting of the HikaShop cart notification plugin.
Turn that setting off and it will stay on the same page.
Please Log in or Create an account to join the conversation.
3 years 10 months ago #347190
by jiawen
Replied by jiawen on topic Add to cart redirect
Please Log in or Create an account to join the conversation.
3 years 10 months ago #347191
by nicolas
Replied by nicolas on topic Add to cart redirect
Hi,
Ok. I looked deeper into it and I think it's falling back to redirecting because it can't display the notification box. And I think it can't display the notification box because of the javascript error on the page:
i.imgur.com/Fu0QBw4.png
That javascript error stops the proper initialisation of the rest of the javascript on the page.
I looked on that line 907 and this is the code generating the error:
That code seems to have been added with a view override but it doesn't check if the element with the id hikashop_product_characteristic_30 is on the page before using it. And since the product on your link doesn't have that element (because it doesn't have any characteristic) it creates that error.
The line:
should be changed to:
to avoid the error and it should hopefully fix the problem.
Ok. I looked deeper into it and I think it's falling back to redirecting because it can't display the notification box. And I think it can't display the notification box because of the javascript error on the page:
i.imgur.com/Fu0QBw4.png
That javascript error stops the proper initialisation of the rest of the javascript on the page.
I looked on that line 907 and this is the code generating the error:
Code:
<script>
if (document.getElementById('hikashop_product_characteristic_30').value == 32){
document.getElementById('add_to_cart_btn').style.pointerEvents = 'none';
}
$("#hikashop_product_characteristic_30").on("change",function(){
if (document.getElementById('hikashop_product_characteristic_30').value == 32){
document.getElementById('add_to_cart_btn').style.pointerEvents = 'none';
}
});
</script>
The line:
Code:
if (document.getElementById('hikashop_product_characteristic_30').value == 32){
Code:
if (document.getElementById('hikashop_product_characteristic_30') && document.getElementById('hikashop_product_characteristic_30').value == 32){
Please Log in or Create an account to join the conversation.
3 years 10 months ago #347231
by jiawen
Replied by jiawen on topic Add to cart redirect
Have revised the coding according to your reply, but it still redirect to cart page.
ezfun.satumalaysiahosting.com/mall/epide...-adult-502-promotion
ezfun.satumalaysiahosting.com/mall/epide...-adult-502-promotion
Please Log in or Create an account to join the conversation.
3 years 10 months ago #347240
by nicolas
Replied by nicolas on topic Add to cart redirect
Hi,
Indeed. I hadn't seen, but you're actually using HikaShop 4.4.5. Could you please update your HikaShop ? We've made significant changes to the notification mechanism since then and it might help. If you still have the issue after the update, please provide a FTP access.
Indeed. I hadn't seen, but you're actually using HikaShop 4.4.5. Could you please update your HikaShop ? We've made significant changes to the notification mechanism since then and it might help. If you still have the issue after the update, please provide a FTP access.
Please Log in or Create an account to join the conversation.
Time to create page: 0.257 seconds