CSV export error notice / Import problems

  • Posts: 56
  • Thank you received: 0
12 years 3 weeks ago #72387

In HS > Products > Products, when I choose to export all items (Root/Product category and All sub-elements), the CSV file that comes out now has error notices in it which it did not before. I suspect this may have something to do with import problems I'm having.

(I will create a separate thread re my import problems just to keep things clear.)

The errors come out in the product_id column of the file and are as follows:

<br />
<b>Notice</b>:  Undefined index:  0 in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />
<br />
<b>Notice</b>:  Trying to get property of non-object in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />
<br />
<b>Notice</b>:  Undefined index:  0 in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />
<br />
<b>Notice</b>:  Trying to get property of non-object in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />
<br />
<b>Notice</b>:  Undefined index:  0 in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />
<br />
<b>Notice</b>:  Trying to get property of non-object in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />
<br />
<b>Notice</b>:  Undefined index:  0 in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />
<br />
<b>Notice</b>:  Trying to get property of non-object in <b>/home/sites/urdapilleta.eu/public_html/administrator/components/com_hikashop/views/product/tmpl/export.php</b> on line <b>74</b><br />

Since they all have to do with the same line of code in the export.php file I thought I would investigate even though I don't know PHP. Here are lines 71-74, so the one of interest is the last one:
if(!empty($this->products)){
	foreach($this->products as $k => $product){
		if($product->product_type=="variant"){
			$this->products[$k]->product_parent_id = str_replace('"','""',$this->products[$product->product_parent_id]->product_code);

I suppose I should fix this but don't know how... suggestions?

I imagine this may have something to do with import problems I am having now. I took an exported CSV file, modified some values like prices, etc. and am now trying to upload it again and it is not having the desired effect. More details in the other thread I will create shortly.

Thanks for any suggestions re this.


HikaShop Business 2.3.2 on Joomla 1.5.26 + JoomFish 2.1.6 - Multilingual site
Last edit: 12 years 3 weeks ago by dforrest. Reason: put in code tags

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 3 weeks ago #72710

That's because you have variants without main product associated in the database.
That should normally not be possible when using the interface to add your products but would be possible if you don't import valid CSVs and screw the products/variants data in the database.

To remove the notices, you can add a @ just before that code:
$this->products[$product->product_parent_id]->product_code

The following user(s) said Thank You: dforrest

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

  • Posts: 56
  • Thank you received: 0
12 years 3 weeks ago #72861

Hi Nicolas,

Thanks for this advice. Precisely a problem I've had on importing is that some variants become unlinked from their product. Or only partically linked (see my CSV import problems thread).

I've turned off the visible error by just setting System Error Reporting to default.

Which columns do I need to look at carefully and match up to make sure the products and their variants stay linked? I thought I was doing this correctly but maybe not. :S


HikaShop Business 2.3.2 on Joomla 1.5.26 + JoomFish 2.1.6 - Multilingual site

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 3 weeks ago #73210

Hi,

you should look at the columns product_type (which must contain the type either main or variant), the characteristic(s) column(s) (which has to be filled for each variants and the main product for the default values), the product_code (which must be unique) and the product_parent_id (which moust contain the product code of the main product for the variante).

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

  • Posts: 1
  • Thank you received: 0
11 years 11 months ago #81467

Thank you

Last edit: 11 years 11 months ago by espcctv.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum