1. Comenaranjas
  2. RO CSVI
  3. Sunday, 06 December 2015
  4.  Subscribe via email
Hello

I understand the "product attribute" field is the one we have to use in order to export custom fields.

However adding that field gives us numbers as results instead of the name: 115|101

No clue from where those numbers come in the order lines of the exported CSV where there are no product attributes it shows []

The custom field is of type "String".

We are using CSVIpro latest version and VM 3.0.12 on j 3.4.5

EDIT: I have checked database thinking table virtuemart_products_customfield maybe showed those numbers as ID of the custom fields but they are different.
Accepted Answer Pending Moderation
Hello,
Can you please send the debug log?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello,

The product_attribute field is a morph field :) Whatever is in there changes based on how you have setup your VirtueMart site.

The question is, which custom fields are you using? These numbers are database IDs and CSVI tries to get some usable information out of it but it won't always succeed.

If possible, take a look at the database for one ID and post here which value you find in the product_attribute field. So we can see the unchanged value.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hi guys

The custom field is of type String, from core VirtueMart.

Not sure where to check for that database ID, I found those numbers as VirtueMart product ID's but those ID's in database belong to normal products.

I checked the table virtuemart_products_customfields where this custom field values appear but can't find database ID's related.

I didnt even find the "product_attribute field" in the database tables.

DEBUG LOG


Detalles
Fecha 2015-12-08 17:24:01 UTC
Software Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
Fecha Tiempo Línea Acción Comentario
Procesadas 83 líneas
2015-12-08 17:24:01 0 [DEBUG] Clean up old logs. Found 25 logs and threshold is 25 logs
2015-12-08 17:24:01 0 [QUERY] SELECT csvi_log_id FROM u8713_csvi_logs ORDER BY csvi_log_id
2015-12-08 17:24:03 0 [DEBUG] Limpiar registros antiguos. 25 registros encontrados y umbral de 25 registros
2015-12-08 17:24:03 0 [QUERY] SELECT csvi_log_id FROM u8713_csvi_logs ORDER BY csvi_log_id
2015-12-08 17:24:03 0 [DEBUG] CSVI Pro Versión:@version@
2015-12-08 17:24:03 0 [DEBUG] COM_CSVI_JOOMLA_VERSION
2015-12-08 17:24:03 0 [DEBUG] Versión PHP: 5.5.30
2015-12-08 17:24:03 0 [DEBUG] =========================
2015-12-08 17:24:03 0 [DEBUG] action: export
2015-12-08 17:24:03 0 [DEBUG] component: com_virtuemart
2015-12-08 17:24:03 0 [DEBUG] operation: order
2015-12-08 17:24:03 0 [DEBUG] localpath: /home/comenara/public_html
2015-12-08 17:24:03 0 [DEBUG] ftphost:
2015-12-08 17:24:03 0 [DEBUG] ftpport:
2015-12-08 17:24:03 0 [DEBUG] ftproot:
2015-12-08 17:24:03 0 [DEBUG] ftpfile:
2015-12-08 17:24:03 0 [DEBUG] export_email_subject:
2015-12-08 17:24:03 0 [DEBUG] export_email_body:
2015-12-08 17:24:03 0 [DEBUG] export_filename: Pedidos almacén [d]-[m]-[Y].csv
2015-12-08 17:24:03 0 [DEBUG] export_file: csv
2015-12-08 17:24:03 0 [DEBUG] field_delimiter: ,
2015-12-08 17:24:03 0 [DEBUG] text_enclosure: "
2015-12-08 17:24:03 0 [DEBUG] include_column_headers: Sí
2015-12-08 17:24:03 0 [DEBUG] signature: No
2015-12-08 17:24:03 0 [DEBUG] publish_state:
2015-12-08 17:24:03 0 [DEBUG] recordstart:
2015-12-08 17:24:03 0 [DEBUG] recordend:
2015-12-08 17:24:03 0 [DEBUG] export_date_format: d/m/Y H:i:s
2015-12-08 17:24:03 0 [DEBUG] export_price_format_decimal: 2
2015-12-08 17:24:03 0 [DEBUG] export_price_format_decsep: .
2015-12-08 17:24:03 0 [DEBUG] export_price_format_thousep:
2015-12-08 17:24:03 0 [DEBUG] header:
2015-12-08 17:24:03 0 [DEBUG] body:
2015-12-08 17:24:03 0 [DEBUG] footer:
2015-12-08 17:24:03 0 [DEBUG] language: es-ES
2015-12-08 17:24:03 0 [DEBUG] splitorderline: Sí
2015-12-08 17:24:03 0 [DEBUG] ordernostart:
2015-12-08 17:24:03 0 [DEBUG] ordernoend:
2015-12-08 17:24:03 0 [DEBUG] orderlist:
2015-12-08 17:24:03 0 [DEBUG] orderdaterange:
2015-12-08 17:24:03 0 [DEBUG] orderdatestart:
2015-12-08 17:24:03 0 [DEBUG] orderdateend:
2015-12-08 17:24:03 0 [DEBUG] ordermdatestart:
2015-12-08 17:24:03 0 [DEBUG] ordermdateend:
2015-12-08 17:24:03 0 [DEBUG] order_address: BTST
2015-12-08 17:24:03 0 [DEBUG] orderpricestart:
2015-12-08 17:24:03 0 [DEBUG] orderpriceend:
2015-12-08 17:24:03 0 [DEBUG] groupbyfields:
2015-12-08 17:24:03 0 [DEBUG] sortfields:
2015-12-08 17:24:03 0 [DEBUG] use_system_limits: No
2015-12-08 17:24:03 0 [DEBUG] max_execution_time:
2015-12-08 17:24:03 0 [DEBUG] memory_limit:
2015-12-08 17:24:03 0 [DEBUG] =========================
2015-12-08 17:24:03 0 [DEBUG] Export field: País
2015-12-08 17:24:03 0 [DEBUG] Export field: Bultos
2015-12-08 17:24:03 0 [DEBUG] Export field: Nº Pedido
2015-12-08 17:24:03 0 [DEBUG] Export field: Nombre
2015-12-08 17:24:03 0 [DEBUG] Export field: Producto
2015-12-08 17:24:03 0 [DEBUG] Export field: Cantidad
2015-12-08 17:24:03 0 [DEBUG] Export field: product_attribute
2015-12-08 17:24:03 0 [DEBUG] Export query
SELECT COALESCE(`user_info2`.`virtuemart_country_id`, `user_info1`.`virtuemart_country_id`) AS `virtuemart_country_id`,
`#__virtuemart_shipmentmethods`.`shipment_element`,
`#__virtuemart_orders`.`virtuemart_order_id`,
`order_number`,
COALESCE(`user_info2`.`first_name`, `user_info1`.`first_name`) AS `first_name`,
COALESCE(`user_info2`.`last_name`, `user_info1`.`last_name`) AS `last_name`,
`order_item_name`,
`product_quantity`,
`product_attribute`
FROM `#__virtuemart_orders`
LEFT JOIN `#__virtuemart_order_items` ON `#__virtuemart_orders`.`virtuemart_order_id` = `#__virtuemart_order_items`.`virtuemart_order_id`
LEFT JOIN `#__virtuemart_order_userinfos` AS `user_info1` ON `#__virtuemart_orders`.`virtuemart_order_id` = `user_info1`.`virtuemart_order_id`
LEFT JOIN `#__virtuemart_order_userinfos` AS `user_info2` ON `#__virtuemart_orders`.`virtuemart_order_id` = `user_info2`.`virtuemart_order_id` AND `user_info2`.`address_type` = 'ST'
LEFT JOIN `#__virtuemart_orderstates` ON `#__virtuemart_orders`.`order_status` = `#__virtuemart_orderstates`.`order_status_code`
LEFT JOIN `#__virtuemart_product_manufacturers` ON `#__virtuemart_order_items`.`virtuemart_product_id` = `#__virtuemart_product_manufacturers`.`virtuemart_product_id`
LEFT JOIN `#__virtuemart_manufacturers` ON `#__virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` = `#__virtuemart_manufacturers`.`virtuemart_manufacturer_id`
LEFT JOIN `#__users` ON `#__users`.`id` = `user_info1`.`virtuemart_user_id`
LEFT JOIN `#__virtuemart_countries` ON `#__virtuemart_countries`.`virtuemart_country_id` = `user_info1`.`virtuemart_country_id`
LEFT JOIN `#__virtuemart_invoices` ON `#__virtuemart_orders`.`virtuemart_order_id` = `#__virtuemart_invoices`.`virtuemart_order_id`
LEFT JOIN `#__virtuemart_paymentmethods_es_es` ON `#__virtuemart_orders`.`virtuemart_paymentmethod_id` = `#__virtuemart_paymentmethods_es_es`.`virtuemart_paymentmethod_id`
LEFT JOIN `#__virtuemart_shipmentmethods` ON `#__virtuemart_orders`.`virtuemart_shipmentmethod_id` = `#__virtuemart_shipmentmethods`.`virtuemart_shipmentmethod_id`
WHERE `#__virtuemart_orders`.`order_status` IN ('Z') AND `user_info1`.`address_type` = 'BT'
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello,

I didnt even find the "product_attribute field" in the database tables.
The field is called product_attribute and is located in the virtuemart_order_items table.

Let me know if you can find it now and what is in that field.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Found it thanks and all values for column "product attributes" show [] except in the orders where custom fields were chosen which show like this:

{
"4": "115",
"5": "101"
}

I checked table virtuemart_custom_fields and "4" and "5" are the ids of 2 custom fields from the order, but the generic custom field without the options, I guess the 115 and 101 refer to those options but can't find those ids anywhere.

Regards
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
So we have 1 order item which has these IDs and values. What do you see when you edit this order? These values should also be translated and shown on the order edit page. At least we would know what values we are looking at.

With regular string fields VM used to store the values in the product_attribute field. If you can also post a screenshot of the custom field itself and how it is setup, it will help in understanding.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hi Roland

I upload 3 images, one of the custom field propierties, another of the edit order and the custom fields tab inside the product details in backend.

All the keys are translated in frontend and backend.

Regards
Attachments (3)
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hello,

So I had a look at this by creating my own product with your setup and order it. The numbers you see are the custom field IDs. The first number is the ID of the virtuemart_customs table and the second number is the ID of the virtuemart_product_customfields. Can you find your IDs in that table?

It would have been better if VirtueMart stored the real value with the order ;) If something changes in the table, you might lose the values alltogether.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello,

Yes you are right I see those ID's now.

So what can I do to export the custom field name instead of the custom field ID?

Cause the only solution I can think for it now is to do replacement rules changing the ID's in to the value names.

CSVIpro exports

{
"4": "115",
"5": "101"
}

As 115 | 101

Exporting only ID of the virtuemart_product_customfields which are the values we need but as readable names.

Regards

Regards
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello,

I found that VirtueMart has more than one way of storing these ID's. Life is great :whistle:

Attached is a patch file that should fix the issue, at least it did for me. Give it a try and let me know how it goes.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hi Roland

That worked perfectly for us, it exports the key used in the value (Title of value without translation) but that is great, we will use replace rules to show it exactly as we want.

Regards
  1. more than a month ago
  2. RO CSVI
  3. # 11
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!