customize checkout (developer question)

  • Posts: 201
  • Thank you received: 7
4 months 2 weeks ago #361920

hi
i want move the subtotal, shipping, Total from
checkout / show_block_coupon.php
to
checkout / show_block_cart.php
according attached picture.what is the standard way?


i do some modify in php files and it work but i have another problem.

Attachments:
Last edit: 4 months 2 weeks ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 months 2 weeks ago #361929

Hi,

I'm sorry but I have a hard time to access your checkout.
When I try your link, I arrive on this page:
i.imgur.com/ja9jrnY.png
Then, I don't know what to do. the blue button doesn't lead to a products listing with add to cart buttons. So I'm not sure what I need to do.
Could you provide instructions ?

Please Log in or Create an account to join the conversation.

  • Posts: 201
  • Thank you received: 7
4 months 2 weeks ago #361938

excuse me for empty cart when you arrive .
step1:
click on the green button
daneh.ir/component/moojla/coursedetail/3566
step2:
add "arman100" as coupon to set
step3:
(problem1) coupon affected on total in the page but not affected in the cart module total price.
(problem2) remove product not possible with Trash icon from page. it only work from cart module.
note: i understand this is not a hikashop issues and it is maybe from my customization, but if you can advise me about is my work is right or not. thenk you.
i attached 3 files that i modify that which you can replace in your demo and see result.

File Attachment:

File Name: Newfolder14.zip
File Size:18 KB

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 months 1 week ago #361945

Hi,

When I try to add the coupon to my cart, I get this error:
i.imgur.com/VkodEtO.png
So I was still not able to look at problem 1.

Regarding problem 2, I can see that the problem is that you're using the code from the cart module for the delete button in the context of the checkout.
I can this code:

<a href="/سبد-خـرید-دوره-ها/product/updatecart/cart_product_id-96242/quantity-0?cart_id=92609&amp;return_url=L9iz2KjYry3YrtmA2LHbjNivLdiv2YjYsdmHLdmH2KcvY2hlY2tvdXQ%3D" data-cart-id="92609" data-cart-type="cart" data-cart-product-id="96242" onclick="if(window.hikashop) { return window.hikashop.deleteFromCart(this, null, 'hikashop_cart_650'); }" title="حذف">
                                                <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="256.000000pt" height="256.000000pt" viewBox="0 0 256.000000 256.000000" preserveAspectRatio="xMidYMid meet">
                                                                 .... svg data .....
                                                </svg>
                                            </a>
As you can see, you have a call to window.hikashop.deleteFromCart. This call is actually the same you have in the cart module.
The problem is that "this" is a reference to the button clicked (in the checkout when you click on it in the cart view of the checkout), and hikashop_cart_650 is the id of the div encompassing the cart module. So there is some issue because the system doesn't find what it's looking for.
In the checkout cart view, the code is actually normally this:
				<div class="hikashop_cart_product_quantity_delete">
					<a class="hikashop_no_print" href="<?php echo $delete_url; ?>" onclick="var qty_field = document.getElementById('<?php echo $this->last_quantity_field_id;?>'); if(qty_field){qty_field.value=0; return window.checkout.submitCart(<?php echo $this->step; ?>,<?php echo $this->module_position; ?>); } return false;" title="<?php echo JText::_('HIKA_DELETE'); ?>">
						<i class="fa fa-times-circle"></i>
					</a>
				</div>
You can see that the delete button in the checkout calls the window.checkout.submitCart function after setting the quantity input field in the checkout to 0. That's what you should do in your view override of the show_block_cart.

The following user(s) said Thank You: sadaf3d

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum