TaxCloud Error on Products w/Characteristics

  • Posts: 229
  • Thank you received: 21
  • Hikashop Business Hikashop Essential
9 years 10 months ago #157779

-- url of the page with the problem -- : new.littleapplewoodenpuzzles.com/handmad...em/wooden-stool.html
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3.0
-- PHP version -- : 5.4.27
-- Browser(s) name and version -- : Any
-- Error-message(debug-mod must be tuned on) -- : TaxCloud error : (see attached)

I just added a Characteristic to a products (simple "Colors" with 2 choices) and now I get a generic "TaxCloud: error" any after an address/login is entered during checkout. It just starts appearing any where on the site that com_hikashop is displayed.

I've tried even the default ProtoStar template and it gives me the same error. I find nothing in the web server logs.

I checked to make sure that the variant items and they do have the Product Taxability Code set.

I tried add just an Option to the original product (without any Characteristics) and there was no issue. So this appears to be specific to something with Characteristics. I tried adding price to the variant (just to see) and no help.

All other products work fine and if I remove the Colors Characteristic, the product is fine.

Not sure exactly what it could be.

I upgraded to 2.3.1 on my internal test server and it has the same issue if I add a Characteristic.

Attachments:
Last edit: 9 years 10 months ago by jazzmang. Reason: Add additional info

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

  • Posts: 12953
  • Thank you received: 1778
9 years 10 months ago #158050

Hello,
Firstly can you show me some screenshots of how did you configured the "Hikashop TaxCloud Plugin" ?

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

  • Posts: 229
  • Thank you received: 21
  • Hikashop Business Hikashop Essential
9 years 10 months ago #158086

See attached.

Remember, TaxCloud works perfectly when there is no characteristics.

Attachments:

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

  • Posts: 229
  • Thank you received: 21
  • Hikashop Business Hikashop Essential
9 years 10 months ago #158087

Note that my test server is a completely different Linux build and physical server in a different network/location than production.

The test server is a fresh install of Joomla with no other extensions besides Hikashop.

The test server also uses a different TaxCloud account than the production site so it isn't not TaxCloud account specific.

I have tried this without the custom name fields on the product too. The result is the same error.

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

  • Posts: 12953
  • Thank you received: 1778
9 years 10 months ago #158402

Hello,
Can you edit the "\plugins\hikashop\taxcloud\taxcloud.php" file, and change these lines :

			$cart_items[] = array(
				'Index' => $i,
				'ItemID' => $product->product_code,
				'TIC' => $tic,
				'Price' => $product->prices[0]->unit_price->price_value,
				'Qty' => $product->cart_product_quantity
			);
By :
			if($product->product_type == 'variant')
				$price = $product->prices[0]->unit_price->price_value;
			else
				$price = $product->prices[0]->price_value;
				
			$cart_items[] = array(
				'Index' => $i,
				'ItemID' => $product->product_code,
				'TIC' => $tic,
				'Price' => $price,
				'Qty' => $product->cart_product_quantity
			);

The following user(s) said Thank You: jazzmang

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

  • Posts: 229
  • Thank you received: 21
  • Hikashop Business Hikashop Essential
9 years 10 months ago #158473

That appears to fixed it. My quick tests show it is working.

Thank you!

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

  • Posts: 26
  • Thank you received: 0
9 years 10 months ago #159632

I've applied the above fix and it's not working. Perhaps the issue on my side is that we have multiple characteristics

product w/ no characteristics is fine: ownthenight.aurorastudios.tv/shop/produc...or-2010-ach-arc-rail

product with multiple is not: ownthenight.aurorastudios.tv/shop/produc...-helmet#.U5cY8pRdWVM

we also have complex products (custom) - which pulls in a variety of different options (some w/ multiple characteristics): ownthenight.aurorastudios.tv/helmets/custom-helmets

Note our nexus is NY

Thoughts...?

Thank you!
-kb

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

  • Posts: 229
  • Thank you received: 21
  • Hikashop Business Hikashop Essential
9 years 10 months ago #159637

You might wan to pull the patched version (with another fix in it as well) from this thread:
www.hikashop.com/forum/taxes/868807-taxc...celed-restarted.html

I made a mistake the first time I tried the patch in this tread however.
There are several arrays in the taxcloud.php that look similar so you have to be careful.

Also I found another bug on Sunday which now has a patch as well:
www.hikashop.com/forum/taxes/868855-taxc...s-errors.html#159580

My recommendation is to get the .zip file that Nicolas posted and try it first.
Then try patching the second thread patch after that.

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

  • Posts: 26
  • Thank you received: 0
9 years 10 months ago #159640

Thanks for the quick reply...
I've tried the zip. However still seeing the errors.
In server logs there's a PHP Notice: Trying to get property of non-object in /home/ownthenight/public_html/plugins/hikashop/taxcloud/taxcloud.php on line 1075

ln 1075 is: "$price = $product->prices[0]->unit_price->price_value;" in

			if($product->product_type == 'variant')
				$price = $product->prices[0]->unit_price->price_value;
			else
				$price = $product->prices[0]->price_value;

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

  • Posts: 229
  • Thank you received: 21
  • Hikashop Business Hikashop Essential
9 years 10 months ago #159649

To try and replicate your issue, I added another characteristics to a product one of our sites that was having the issue (before the patch).

The item had two characteristics but I don't have any problems (no tax cloud errors) during checkout.

I didn't try anything fancy, say with price changes on the variants or adding in options with characteristics.
My guess is it more than just simply multiple characteristics but some other combination within.

Sorry I don't have time to help isolate it further for a few days but that I what I would try isolating (the exact combination) for HikaShop support.

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

  • Posts: 2
  • Thank you received: 2
9 years 10 months ago #159747

Hi,

I also tried to add multiple characteristics but i didn't get the error. What you can try is to replace this line

			if($product->product_type == 'variant')

By this one
			if(isset($product->prices[0]->unit_price->price_value))

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

  • Posts: 26
  • Thank you received: 0
9 years 10 months ago #159782

Hi yeso - that did make a small change, but I went from two errors to one... then somehow back to 2, just be refreshing.

That said I've echo'd the $cart_items array on the cart page to see what the differences might be.

a) Working product
ownthenight.aurorastudios.tv/shop/produc...-helmet-liner-system

Array
(
    [0] => Array
        (
            [Index] => -1
            [ItemID] => tic_rate_0
            [TIC] => 0
            [Price] => 1
            [Qty] => 1
        )

    [1] => Array
        (
            [Index] => 1
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [2] => Array
        (
            [Index] => 2
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [3] => Array
        (
            [Index] => 3
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [4] => Array
        (
            [Index] => 4
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [5] => Array
        (
            [Index] => 5
            [ItemID] => Team_Wendy_REVOLVE_Helmet_Liner_System_20_17
            [TIC] => 0
            [Price] => 99
            [Qty] => 1
        )

)
Array
(
    [0] => Array
        (
            [Index] => -1
            [ItemID] => tic_rate_0
            [TIC] => 0
            [Price] => 1
            [Qty] => 1
        )

    [1] => Array
        (
            [Index] => 1
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [2] => Array
        (
            [Index] => 2
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [3] => Array
        (
            [Index] => 3
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [4] => Array
        (
            [Index] => 4
            [ItemID] => Team_Wendy_REVOLVE
            [TIC] => 0
            [Price] => 99.00000
            [Qty] => 0
        )

    [5] => Array
        (
            [Index] => 5
            [ItemID] => Team_Wendy_REVOLVE_Helmet_Liner_System_20_17
            [TIC] => 0
            [Price] => 99
            [Qty] => 1
        )

)

b) Error-ing product
ownthenight.aurorastudios.tv/shop/produc...ach-ballistic-helmet
Array
(
    [0] => Array
        (
            [Index] => -1
            [ItemID] => tic_rate_0
            [TIC] => 0
            [Price] => 1
            [Qty] => 1
        )

    [1] => Array
        (
            [Index] => 1
            [ItemID] => Size
            [TIC] => 0
            [Price] => 
            [Qty] => 0
        )

    [2] => Array
        (
            [Index] => 2
            [ItemID] => TBHII__
            [TIC] => 0
            [Price] => 415
            [Qty] => 1
        )

    [3] => Array
        (
            [Index] => 3
            [ItemID] => Color
            [TIC] => 0
            [Price] => 
            [Qty] => 0
        )

    [4] => Array
        (
            [Index] => 4
            [ItemID] => Color_9
            [TIC] => 0
            [Price] => 
            [Qty] => 1
        )

    [5] => Array
        (
            [Index] => 5
            [ItemID] => Size_16
            [TIC] => 0
            [Price] => 
            [Qty] => 1
        )

)
Array
(
    [0] => Array
        (
            [Index] => -1
            [ItemID] => tic_rate_0
            [TIC] => 0
            [Price] => 1
            [Qty] => 1
        )

    [1] => Array
        (
            [Index] => 1
            [ItemID] => Size
            [TIC] => 0
            [Price] => 
            [Qty] => 0
        )

    [2] => Array
        (
            [Index] => 2
            [ItemID] => TBHII__
            [TIC] => 0
            [Price] => 415
            [Qty] => 1
        )

    [3] => Array
        (
            [Index] => 3
            [ItemID] => Color
            [TIC] => 0
            [Price] => 
            [Qty] => 0
        )

    [4] => Array
        (
            [Index] => 4
            [ItemID] => Color_9
            [TIC] => 0
            [Price] => 
            [Qty] => 1
        )

    [5] => Array
        (
            [Index] => 5
            [ItemID] => Size_16
            [TIC] => 0
            [Price] => 
            [Qty] => 1
        )

)

The only thing that I can think of here is that the working product does not have value that changes the price - even though a "price change" value was NOT selected in the non-working product. I also tried to get the working product to break by adding 2 characteristics and also making some variants different prices. Also tried adding options to the working product and could not break by that either.

any thoughts..?

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

  • Posts: 26
  • Thank you received: 0
9 years 10 months ago #159784

Looking at these arrays side by side - I think I see the problem. In the "broken" one several prices are missing.

after the if/else statement I've added (around ln 1075)

if (!$price) $price = '0';

Don't know if I'm missing out on calculating some values here though... but at least the error messages are gone...

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
9 years 10 months ago #159797

From what I can see the notice message comes from the fact that there are no prices for one of the products/variants/options in the cart.
It's just a small check missing. Your fix will do but we'll do something a bit more involved for next version to make sure that this doesn't happen.
Another easy solution to avoid that is to turn off the "error reporting" option of the Joomla configuration.

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

Time to create page: 0.129 seconds
Powered by Kunena Forum