prices in checkout are duplicated

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
10 years 1 month ago #193812

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.5.14
-- Browser(s) name and version -- : Chrome 40.0.2214.115
-- Error-message(debug-mod must be tuned on) -- : error reporting maximum gives blank page.

After update to this version this problem came:

We have one category 'Kleding' (cloth) that gives us problems; when you add a item to the cart the total price is twice the amount of the item.

Please see screenshot for the problems;




There is also a ,. in shopping cart / price so the price has to be 20,00 but it shows: 20,.00

There is no coupon active on that categorie.

Attachments:
Last edit: 10 years 1 month ago by comyoo.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 month ago #193817

Hello,
Did you add some code customization on the "Listing_price" / "cart" file of the "product" / "checkout" view of your front-end template via "Hikashop->Display->Views" ?
If yes, can you try it withtout your customization ?

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

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
10 years 1 month ago #194032

No, we don't have any custom views at all.
I already thought that could be a problem, but there isn't any.

Database check gives 'oke'.

Where can I look for the problem?
If you can help me and need login; please send me an email so I can reply on.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #194036

Hi,

Don't you have any plugin enabled which could edit the price of the product in the cart ?
If not, please give us a backend and FTP access in order to have a look at the issue.

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

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
10 years 1 month ago #194258

Hi Xavier;

Just submitted the contact form with my credentials; Please have a look at the backend. I don't know if and then which plugin can do that on one categorie.

When can you have a look?

I have set the menu where it is all about on 'special'. Please login also in front-end to view 'Kleding'.

Last edit: 10 years 1 month ago by comyoo. Reason: explained where menu 'kleding' is.

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

  • Posts: 83589
  • Thank you received: 13528
  • MODERATOR
10 years 4 weeks ago #194289

Hi,

We found the issue which happens only with products with characteristics.
Download again the install package of HikaShop via the menu My account>My subscriptions on our website and install it on yours via the Joomla installer and that will add the fix.

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

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
10 years 4 weeks ago #194456

Hi Nicolas,
Thanks.

Fix works, except from the shoppingcart and the ., in the price sometimes.




That bug is also in the slider of products on some pages.

Attachments:

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

  • Posts: 83589
  • Thank you received: 13528
  • MODERATOR
10 years 4 weeks ago #194556

Hi,

We are not able to reproduce the problem.
If you have a file templates/YOUR_TEMPLATE/html/com_hikashop/product/cart.php on your website, rename it in order to deactivate the view override on the cart module display and that might help avoid the problem.

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

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
10 years 4 weeks ago #194621

We don't have any override in the template.

It seems to happen when you are logged in; when you are not logged in the cart is normal; but when logged in there is a ,. of ., in the price and the total is 0,-

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

  • Posts: 26220
  • Thank you received: 4034
  • MODERATOR
10 years 4 weeks ago #194688

Hi,

It took a while but I finally found your issue.
One plugin, something in your Joomla is changing the locale and break the number locale.
(And change the locale only when the user is logged)

The result is that the local was good when HikaShop process his content but not when Joomla process the modules.
So, that's why the issue was only display for the modules.

The side effects :
- a float converted to a string was not converted properly ; that's why "bccomp" was not working anymore (in order to break a native PHP function, it's already pretty big)
- the conversion made by "sprintf" was not right too ; it results the ".," that you could see.

For the second point I just want to say that it's pretty huge because, we take a float number, you cast it into a string and you use a function which is made to compare big numbers.. And this function does not recognize the number as a float number ; like the locale was partially configured to convert a number in a special way but the function can't even convert it back.

Well, I made several patches in HikaShop (and in your website) in order to pre-convert correctly the data and use as less as possible function which could be affected by a corrupted locale.
It is now display good in your website.

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: 97
  • Thank you received: 0
  • Hikashop Business
10 years 3 weeks ago #194971

Hi Jerome,

Thanks. Super that you fixed it. Do you know which plugin / module did break the string?

So the conclusion is that Hikashop has now a fix that will not break it again and will also beter work at different enviroments.

Thanks.

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

  • Posts: 83589
  • Thank you received: 13528
  • MODERATOR
10 years 3 weeks ago #195621

Hi,

We don't know which one it was. We just added the patches so that it doesn't happen anymore in the future.

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

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
9 years 11 months ago #198827

Hi Nicolas,

My collegue just updates Hikashop with the latest version 2.4.0 of your website and the problem is back;

Prices in cart module are shown with ., in the price and the total is 0,.00 instead of the total of the cart items.

Is the problem not fixed in the new release of Hikashop and only at our website? Can you again have a look?

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

  • Posts: 26220
  • Thank you received: 4034
  • MODERATOR
9 years 11 months ago #198844

Hi,

HikaShop 2.4.0 has been release on March 3th
www.hikashop.com/support/support/documen...ashop-changelog.html

We include the patch in HikaShop in our side but the current available package does not contain that patch yet ; they will be integrated in the next release.
Because you were using HikaShop 2.4.0 and we patched your website ; we didn't think that it was necessary to create an "hot patch" for HikaShop due to the fact that you were the only people currently concerned by that issue.

Like the modification of the hikashop_toFloat in the HikaShop helper

function hikashop_toFloat($val){
	if(is_string($val) && preg_match_all('#-?[0-9]+#',$val,$parts) && count($parts[0])>1){
		$dec=array_pop($parts[0]);
		return (float) implode('',$parts[0]).'.'.$dec;
	}
	return (float) $val;
}
Ot the replacement in the class cart from
if(bccomp($cart->full_total->prices[0]->price_value_with_tax, 0, 5) <= 0) {
To
if(hikashop_toFloat($cart->full_total->prices[0]->price_value_with_tax) <= 0) {
There is also a modification in the class currency from
foreach(get_object_vars($total) as $key => $value){
	if(!in_array($key,array('price_currency_id','price_orig_currency_id','price_value_without_discount_with_tax','price_value_without_discount','taxes')) && isset($price->$key)){
		$total->$key = $total->$key + $price->$key;
	}
}
To
foreach(get_object_vars($total) as $key => $value){
	if(!in_array($key,array('price_currency_id','price_orig_currency_id','price_value_without_discount_with_tax','price_value_without_discount','taxes')) && isset($price->$key)){
		$total->$key = $total->$key + (float)hikashop_toFloat($price->$key);
	}
}

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: 97
  • Thank you received: 0
  • Hikashop Business
9 years 11 months ago #198950

Hi thanks for the patched; can you mention the place / location of the files in the filestructure of hikashop?

Then we can patch easily; because there are many helpers.

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

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
9 years 11 months ago #199019

Hi,

Problem; after patch the total price is not provided; only the shipping costs; now the total is the shipping costs; so the transfer to the bank is only shipping costs instead of total.

Very poor situation; can you help us out?

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

  • Posts: 83589
  • Thank you received: 13528
  • MODERATOR
9 years 11 months ago #199150

Hi,

Please revert your changes. Only one patch is necessary for your issue.
It is to change the line:

$num = sprintf("%0.{$round}f",round($number,$decimals));
to:
$num = number_format(round($number, $decimals), $round, '.', '');
in the file administrator/components/com_hikashop/classes/currency.php
As Jerome said, this patch will be included in next version of HikaShop.

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

  • Posts: 97
  • Thank you received: 0
  • Hikashop Business
9 years 10 months ago #203028

I just installed the most recent version of hikashop, and the code above does fix the '.,' issue, but I again have the issue with the cart-module showing €0,00 at total (only the module).

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

  • Posts: 83589
  • Thank you received: 13528
  • MODERATOR
9 years 10 months ago #203090

Hi,

I've checked your website but I don't see the problem there : take.ms/E7LlF
Am I missing something ?

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

Time to create page: 0.133 seconds
Powered by Kunena Forum