Support is online

This same value for different Customfilesforall #8152

Open superidea opened this topic Friday, 01 April 2016 · 5 replies
Author

Hi. I have a problem with import product that has different name customfieldsforall with the same value for exampe height and widht. I found in debug log that the csvi adds value by customsforall_value_name and adds me 3 value to one customfields, can You change to also check by virtuemart_custom_id.

  • 1.jpg
Support

Hello,

Can you give me a better example of where you have duplicate values in your setup? This way I can understand what you are working with and where the issue is you have.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

From what I could observe your component during the upgrade first clears all related customfileds based on all possible values ​​for a given`virtuemart_custom_id:

Load cf4all values for custom ID 95
SELECT customsforall_value_id FROM gz_virtuemart_custom_plg_customsforall_values WHERE virtuemart_custom_id = 95
Delete existing cf4all values for product ID 27376
DELETE FROM gz_virtuemart_product_custom_plg_customsforall WHERE virtuemart_product_id = 27376 AND customsforall_value_id IN (125,126,…)

And then adds new / revised on the basis of the same values:

COM_CSVI_DEBUG_CUSTOMFIELD_VALUE_QUERY
SELECT customsforall_value_id FROM gz_virtuemart_custom_plg_customsforall_values WHERE customsforall_value_name IN ('1220')
COM_CSVI_DEBUG_CUSTOMFIELD_PARAM_QUERY
INSERT INTO gz_virtuemart_product_custom_plg_customsforall (customsforall_value_id,virtuemart_product_id,customfield_id) VALUES (1344,27376,2213146),(6345,27376,2213146),(14347,27376,2213146)

as you can see above it adds three values on one product . The problem is that I have a different customfileds ( height, width and power) with the same values ​​. The best solution is to check further component virtuemart_custom_id based on custom_title from a csv file.

Adds a sample file to import .

Support

Hello,

I see what you are telling me but I don't understand it, blame it on my lack of understanding :)

Can you post some screenshots of the fields and values as you have them setup?

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Hi.
I solved the problem by myslef. In plugin customfiledsforall I changed line 156 to:

->where($this->db->quoteName('customsforall_value_name') . ' IN (' . implode(',', $param_entries) . ')' . ' AND virtuemart_custom_id = ' . $virtuemart_custom_id);

Can You add this modification in next release.

Support

Hello,

I won't put in a modification without knowing the full extend as to why. As long as you can't provide more detailed information, the change will just be yours.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Log in to reply to this topic.