Product with custom fields, wrong total price

  • Posts: 73
  • Thank you received: 0
9 years 10 months ago #205769

-- HikaShop version -- : 2.5.0

Hello
I have product with custom fields. I add this product twice to cart (with different options). I got one error in the total price. It seems that the total price in this case contain the tax again. Also the tax is not correct.
Regards,
Petar Ristanovic
www.sokart.ch

Attachments:

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

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
9 years 10 months ago #205770

Hi,

We would need more information on the issue to be able to say anything.
Could you do a screenshot of the settings of your product ?
Could you give a direct link to that product ?
Could you provide a screenshot of your tax rules listing (menu System>Taxes) so that we can see how you configured your taxes ?

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

  • Posts: 73
  • Thank you received: 0
9 years 10 months ago #205836

Hi,

Please move this topic to the right category :)
Product settings are attached. (first four)
Direkt link:
www.sokart.ch/cms/e-shop/nach-kategorien...asergravur-kleopatra
Tax settings are attached. (last two). Info: If I set Tax to 0% then is the total price OK!













Regards,
Petar Ristanovic

Last edit: 9 years 10 months ago by sokartch.

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

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
9 years 10 months ago #205958

Hi,

Could you try switching the "round prices during calculations" setting and/or the "floating taxed prices" setting of the HikaShop configuration ?

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

  • Posts: 73
  • Thank you received: 0
9 years 10 months ago #206100

Hi

When I "order" two items of the same product with different user defined fields data 25 pieces * 4 francs + 25 pieces * 4 francs = 200 francs

Without "Round prices during calculations"
Zwischensumme 555,56 CHF
MwSt. 370,37 CHF
Summe 555,56 CHF (instead of 200.00)

Wihh "Round prices during calculations"
Zwischensumme 560,00 CHF
MwSt. 375,00 CHF
Summe 560,00 CHF (instead of 200.00)

If I "order" 50 pieces * 4 francs = 200 francs
Zwischensumme 200,00 CHF
MwSt. 14,81 CHF
Summe 200,00 CHF

When I choose tax category for product with 0% tax (instead of 8%)
Summe 185,19 CHF

Direct link to product:
sokart.ch/cms/e-shop/nach-kategorien/kat...asergravur-kleopatra

Last edit: 9 years 10 months ago by sokartch.

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

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
9 years 10 months ago #206251

As we're not able to reproduce the issue on our end, could you provide a backend access along with a link to this thread via our contact form so that we could check your settings ?
www.hikashop.com/support/contact-us.html

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

  • Posts: 73
  • Thank you received: 0
9 years 10 months ago #206600

Ok, I wrote email... last friday

Additionaly: If an item has custom fields "After a product is added to the cart" is meaningless. It always jumps in the cart.

Attachments:
Last edit: 9 years 10 months ago by sokartch.

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

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
9 years 10 months ago #206732

Hi,

Please understand that such issues require time to debug as they are quite complex.
It seems to come from a bug with some versions of PHP where the cloning of objects is not done properly.

Change the code:

$element->prices[]=(!HIKASHOP_PHP5) ? $price : clone($price);
to:
$element->prices[] = $this->_copy($price);
and add the code:
function _copy(&$src){
		if(is_array($src)){
			$array = array();
			foreach($src as $k => $v){
				$array[$k]=$this->_copy($v);
			}
			return $array;
		}elseif(is_object($src)){
			$obj = new stdClass();
			foreach(get_object_vars($src) as $k => $v){
				$obj->$k=$this->_copy($v);
			}
			return $obj;
		}else{
			return $src;
		}
	}
before the line:
function convertPrice(&$element,&$currencies,$currency_id,$main_currency){
in the file administrator/components/com_hikashop/classes/currency.php and that should fix the problem.

For the other issue, please try to create new threads for new questions. I tried to look at that other issue on your website but I wasn't able to access your HikaShop configuration with the user access you provided which is a requirement to be able to look at the problem.

The following user(s) said Thank You: sokartch

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

  • Posts: 73
  • Thank you received: 0
9 years 10 months ago #206870

Hi

> Please understand that such issues require time to debug as they are quite complex.
OK, I see.

The prices are now OK. Thank YOU!

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

Time to create page: 0.081 seconds
Powered by Kunena Forum