- Posts: 178
- Thank you received: 5
+ and - instead Refresh button in Chekout and Cart
-- Joomla version -- : Joomla! 3.3.3 Stable
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Any
I can change quantity by pressing + and - in product or category listing.
But in Checkout I have only Refresh button.
And in the CartI havent any button at all.
Can I change quantity in the Cart and Checkout by pressing + and - too? Many users don't understand, that they can press Refresh. They are search + and - buttons.
Please Log in or Create an account to join the conversation.
There is no option to activate such capability, but you can always modify the cart view files via the menu Display>Views in order to add them.
It's not really complex if you know a bit of programming. For example, for the + of the checkout/cart view file, you could have that code:
<div class="hikashop_cart_product_quantity_refresh">
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Now it works I think.
Please Log in or Create an account to join the conversation.
How I can now add +/- to cart module and checkout page?
Doesn't work too.
Please Log in or Create an account to join the conversation.
It change quantity in cart, but reload page, no ajax reload.
Please Log in or Create an account to join the conversation.
Please be sure that you do not have view overrides for your content.
The code you mentioned is related to the "legacy" add to cart system and it received some minor modifications in order to be compatible with the new way that the cart is handled in HikaShop.
You have to keep using the getElementById but you need to use the right code to get the HTML input element.
Without knowing what you have modified but seeing that you do not have the original content ; I'm afraid that our support won't be able to give you any useful help.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
There is still no default function to show +/- in the cart or checkout page in Hikashop 3?
Please Log in or Create an account to join the conversation.
There is no mention of
So I don't know what you're trying to do but that's not the official HikaShop 3 code.
If you're using HikaShop 3 ; you have to use code of HikaShop 3, not older code.
And yes, there is features in HikaShop 3 to display a quantity selector in the checkout cart.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
I can write again. Modification <table class="cartplusminus"> was in 2.6.3. When I try the same hack in 3.0.1 it doesn't work.
How can I add +/- to the cart module without page reload in 3.0.1?
Please Log in or Create an account to join the conversation.
And I wrote:
So I don't know what I can tell you.If you're using HikaShop 3 ; you have to use code of HikaShop 3, not older code.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Jerome wrote: You have to keep using the getElementById but you need to use the right code to get the HTML input element.
Jerome wrote: If you're using HikaShop 3 ; you have to use code of HikaShop 3, not older code.
3 years ago Nicolas wrote how to add +/- buttons to Hikashop 2.
nicolas wrote:
Code:<a href="#" onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php echo $row->cart_product_id;?>'); qty_field.value=qty_field.value.parseInt()+1;qty_field.form.submit();">+</a>
In the new Hikashop 3 it does not work anymore. And I ask for 5 days how to add these buttons.
How can I use the code of Hikashop 3, if I do not know what it should be now. If I knew, obviously I would not write on the forum.
I can not understand the meaning of your answers.
Please Log in or Create an account to join the conversation.
You can still use the same code with the new checkout cart view.
If you look at either the "cart" view file of the "legacy" checkout, or at the show_block_cart view file of the new checkout, both have a quantity input field with the same id :
So the code I wrote three years ago should still work there:
Please understand that this is custom coding.
We provide user support in this forum. We try to help when you have coding questions regarding HikaShop, but that's already outside the support we're supposed to give, and that doesn't mean that we will work on your customizations for you. If you're a developer, these basic modifications shouldn't be a problem, and if you aren't, then you should ask a developer for help on such customization.
Please Log in or Create an account to join the conversation.
In the cart module as I see, id do not contain product id. I don't know what this number (_39) is meaning. Product id is in name atribute.nicolas wrote: (obviously, you need to update the $row variable to $product, but the logic is still the same and you still need to use a getElementById as Jerome was saying.)
Try to use getElementsByName instead getElementById, but when change quantity - all page content reloads. So the advantage of the new "Add to cart" system is lost in that case.
It's normal to change the amount through the input field via keyboard on the desktop PC, but on the mobile phone it's easier to press the plus and minus buttons. Reloading the page on the phone is annoying. Today, more than half of all visitors use mobile phones.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You are right about mobile. I have asked same question about 2 months ago here; www.hikashop.com/forum/4-how-to/888560-h...uestions.html#260825
Still waiting for the improvement
Thanks
Please Log in or Create an account to join the conversation.
If you want to submit the block (ajax refresh), instead of a whole step refresh, it's quite easy. Just take example on the delete button.
If you look in the cart.php for the delete button code, you can see that the submission of the data is done with qty_field.form.submit();
while in the show_block_cart.php that piece is replaced by:
return window.checkout.submitCart(<?php echo $this->step; ?>,<?php echo $this->module_position; ?>);
So in your code in show_block_cart, do the same change and the + and - buttons will also use AJAX refresh.
Please Log in or Create an account to join the conversation.
Thank you. In Checkout page it works.nicolas wrote: So in your code in show_block_cart, do the same change and the + and - buttons will also use AJAX refresh.
In cart module another code for Delete button and I didn't find solution
Please Log in or Create an account to join the conversation.
alikon1 wrote: Found else that I can edit /components/com_hikashop/views/layouts/tmpl/quantity.php near line 118, to get buttons with correct id.
Code:<a href="#" onclick="var qty_field = document.getElementById('<?php echo $id;?>'); qty_field.value=parseInt(qty_field.value)+1;qty_field.form.submit();">+</a>but this variant refresh all page too
That file already contains some +/- code:
But when I try to add this, it's only increase quantity in input box and don't recalculate total sum, no entire or ajax page reload.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.