Subtotal is wrong

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264126

-- url of the page with the problem -- : verswarenrapallo.be/bestellen
-- HikaShop version -- : 3.0.0
-- Joomla version -- : 3.6.5

I would like to show the subtotal (without tax), tax and Total (with VAT). Now, subtotal shows price with tax?

I red here ( www.hikashop.com/forum/4-how-to/78956-i-...gistration-form.html ) that I have to change the view checkout / Cart. But when I go to that file (from my template), I don't find the code you describe. (See attachments for the code that I see)

Can you help me?

I also would like to remove the coupon code?

Thanks!

Regards

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #264127

Hi,

1. This thread is 4 years old. A lot changed since then.
With HikaShop 3, we introduced a new checkout.
So if you have the "checkout legacy" deactivated in your configuration, you need to edit the file "show_block_cart". Otherwise, it's the "cart" view file you need to edit.
No I don't see what code you're talking about since the thread on your link doesn't contain any code.

2. Just remove the "coupon" view from the "checkout workflow" setting of the HikaShop configuration.

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264179

Checkout legacy is activated, so I took a quick look @ the cart view. This is the code:

Code removed by a moderator.
If it is the official view content, there is no need to past it in our forum, the support team already have it.

Thanks!

Last edit: 7 years 8 months ago by Jerome.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #264184

Hi,

We already know the code in the cart view. What we don't know is what code you're looking for in there ?

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264213

I'm looking for the part where I can fix the wrong subtotal. VAT is also included in it ... How can I fix that?

Thanks

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #264231

It's that code:

<span class="hikashop_checkout_cart_subtotal">
							<?php
								if($this->params->get('price_with_tax')){
									echo $this->currencyHelper->format(@$this->total->prices[0]->price_value_with_tax,@$this->total->prices[0]->price_currency_id);
								}else{
									echo $this->currencyHelper->format(@$this->total->prices[0]->price_value,@$this->total->prices[0]->price_currency_id);
								}
							?>
						</span>
Simply change price_value_with_tax by price_value.

The following user(s) said Thank You: Lodeke87

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264459

Thank you very much! Problem solved! But now i have the same problem with the e-mail i receive when an orden has been placed. (See attachments)

Can you help me chance that and maybe also tell me where i can chance the fields I see in the e-mail. Now its onlu klant, bestelnummer and betaalmethode.

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #264464

Hi,

You can edit the emails in the menu System>Emails.
There, look in the "preload" section.
There you will find that code which calculates the subtotal:

if($config->get('price_with_tax')){
			$unit_price = $currencyHelper->format($item->order_product_price+$item->order_product_tax,$data->cart->order_currency_id);
			$total_price = $currencyHelper->format($item->order_product_total_price,$data->cart->order_currency_id);
			$subtotal += $item->order_product_total_price;
		}else{
			$unit_price = $currencyHelper->format($item->order_product_price,$data->cart->order_currency_id);
			$total_price = $currencyHelper->format($item->order_product_total_price_no_vat,$data->cart->order_currency_id);
			$subtotal += $item->order_product_total_price_no_vat;
		}

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264580

Ok thank you, but can you help me chance it to the wayIi want it?
Because I really don't know how to achieve that ...

Thank you very much!

Regrads

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #264584

Hi,

It's almost the same as before. Swap :
$subtotal += $item->order_product_total_price;
and:
$subtotal += $item->order_product_total_price_no_vat;

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264652

Ok, I will take a look at it. Can you help me with something else please? I added an advanced date picker to the registration form and i would like to display it in both mails (to customer and to me)

How can i display that to the form please, because i'm not very strong with the code ...

Thank you very much!!!

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #264657

Hi,

I'm not sure what you mean. How did you configure the custom field ? Could you do a screenshot of its settings ?

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264698

I created a new field (type: advanced date picker) and now i would like to show in the email to the administrator ... But how can i do that? (See attachments)

Also there is a second : sign that i not able to remove? how can i do that?

Thank you very much

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #264734

Hi,

1. In the HikaShop configuration, in the checkout tab, you can configure the address format. You need to add the tag for your custom field there and it will be added in the email address area, like the other custom address fields.

2. Edit your order admin notification email via the menu System>Emails and in the preload area, remove it on the line :
'CUSTOMER_DETAILS' => JText::_('HIKA_CUSTOMER_EMAIL').': '.$userInfos->user_email,

PS: when you do screenshots next time, please try to do them while being logged in in English so that we can easily understand them or not have to translated them.

The following user(s) said Thank You: Lodeke87

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #264801

Thank you! That worked!

But I still have a problem with the subtotal, so I will just delete it from my email, because it's the same as 'price with vat'. Do you know how I can remove the line subtotal? Thank you

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 8 months ago #264802

Hi,

Nicolas indicated you how to modify the email preload
www.hikashop.com/forum/checkout/889192-s...is-wrong.html#264464

There you can modify the way that the subtotal is process but you will also find the line which add the subtotal in the cart "footer".
By commenting the line, you won't add the subtotal in the footer which won't be display in the email afterwards.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 21
  • Thank you received: 0
7 years 8 months ago #265001

Yes thanks for that. But it's the first time I use Hikashop, so I'm not very confident. So before I do something that ruins the whole thing, I rather ask twice. So I apologize for my many questions ...

I think this is the part where I have to look? But exactly what part do I have to comment out?

		if($config->get('price_with_tax')){
			$unit_price = $currencyHelper->format($item->order_product_price+$item->order_product_tax,$data->cart->order_currency_id);
			$total_price = $currencyHelper->format($item->order_product_total_price,$data->cart->order_currency_id);
			$subtotal += $item->order_product_total_price;
		}else{
			$unit_price = $currencyHelper->format($item->order_product_price,$data->cart->order_currency_id);
			$total_price = $currencyHelper->format($item->order_product_total_price_no_vat,$data->cart->order_currency_id);
			$subtotal += $item->order_product_total_price_no_vat;
		}
		$cartProduct['PRODUCT_PRICE'] = $unit_price;
		$cartProduct['PRODUCT_TOTAL'] = $total_price;

		$cartProducts[] = $cartProduct;
	}
	$templates['PRODUCT_LINE'] = $cartProducts;

	if(bccomp($data->cart->order_discount_price,0,5) || bccomp($data->cart->order_shipping_price,0,5) || bccomp($data->cart->order_payment_price,0,5) || ($data->cart->full_total->prices[0]->price_value!=$data->cart->full_total->prices[0]->price_value_with_tax) || !empty($data->cart->additional)){
		$cartFooters[] = array(
			'NAME' => JText::_('SUBTOTAL'),
			'VALUE' => $currencyHelper->format($subtotal,$data->cart->order_currency_id)
		);
	}
	if(bccomp($data->cart->order_discount_price,0,5)) {
		if($config->get('price_with_tax')) {
			$t = $currencyHelper->format($data->cart->order_discount_price*-1,$data->cart->order_currency_id);
		}else{
			$t = $currencyHelper->format(($data->cart->order_discount_price-@$data->cart->order_discount_tax)*-1,$data->cart->order_currency_id);
		}
		$cartFooters[] = array(
			'NAME' => JText::_('HIKASHOP_COUPON'),
			'VALUE' => $t
		);

Thank you very much!

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #265014

Hi,

You can always click on the "remove customization" bin icons of the email on the emails listing if you mess up the email. So don't worry.

Please understand that we provide user support, not custom development services. We already went beyond what we're supposed to do and gave you hints and code modifications. If you're not a developer and need such customization help by a professional, please contact someone to help you with it. For example, some of our partners can do such custom development:
www.hikashop.com/home/our-partners.html

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

Time to create page: 0.085 seconds
Powered by Kunena Forum