Re: Database I/O Manager (DbIo) Plugin [Support Thread]
It is the way the attribute prices were/are displayed. Setup in 154 displayed attribute price, usually blank for nocharge attributes and sometimes a 5-10% adder. When updated to 156, the displayed attribute price iincluded the attribute price PLUS base price giving the appearance that total product price would be base plus attribute plus base.
The setting (or unsettings) of the priced by attributes flag corrected the issue but the functionality of that flag somehow got changed between versions.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Got a question, not sure if its what I'm trying to do or something in the code but I'm getting a blank attribute id..
So, history..
ZC1.5.6c
PHP7.3.11
DBIO 1.6.1 from ZC download
Each product gets three file download attributes.
Error log:
Code:
[07-Apr-2020 07:02:45 America/Phoenix] Request URI: /ADMIN/dbio_manager.php?action=file, IP address: 0.0.0.0
#1 trigger_error() called at [/************/cbgshop/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/***********/cbgshop/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/************/cbgshop/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [ADMIN/includes/classes/dbio/DbIoProductsAttribsRawHandler.php:333]
#5 DbIoProductsAttribsRawHandler->importBuildSqlQuery() called at [ADMIN/includes/classes/dbio/DbIoHandler.php:937]
#6 DbIoHandler->importCsvRecord() called at [ADMIN/includes/classes/dbio/DbIo.php:265]
#7 DbIo->dbioImport() called at [ADMIN/dbio_manager.php:240]
--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 1' at line 4 :: SELECT *
FROM zen_products_attributes_download
WHERE products_attributes_id =
LIMIT 1 ==> (as called by) ADMIN/includes/classes/dbio/DbIoProductsAttribsRawHandler.php on line 333 <== in /*********/cbgshop/includes/classes/db/mysql/query_factory.php on line 171.
part of the attribute csv file.. 49 products, 3 each for 149 attributes..
Code:
v_products_attributes_id,v_products_id,v_products_model,v_manufacturers_name,v_options_id,v_products_options_name,v_options_values_id,v_products_options_values_name,v_options_values_price,v_price_prefix,v_products_options_sort_order,v_product_attribute_is_free,v_products_attributes_weight,v_products_attributes_weight_prefix,v_attributes_display_only,v_attributes_default,v_attributes_discounted,v_attributes_image,v_attributes_price_base_included,v_attributes_price_onetime,v_attributes_price_factor,v_attributes_price_factor_offset,v_attributes_price_factor_onetime,v_attributes_price_factor_onetime_offset,v_attributes_qty_prices,v_attributes_qty_prices_onetime,v_attributes_price_words,v_attributes_price_words_free,v_attributes_price_letters,v_attributes_price_letters_free,v_attributes_required,v_products_attributes_filename,v_products_attributes_maxdays,v_products_attributes_maxcount,v_dbio_command
107,78,Q1149,,13,Topo-NIAP,29,NAIP Quad,1,+,2,1,0,+,0,0,1,maps/NAIP_DIAMOND_POINT.jpg,1,0,0,0,0,0,,,0,0,0,0,0,NAIP_DIAMOND POINT.pdf,7,1,
108,78,Q1149,,13,Topo-NIAP,28,Topo Quad,0,+,1,1,0,+,0,1,1,maps/Quad_DIAMOND_POINT.jpg,1,0,0,0,0,0,,,0,0,0,0,1,Quad_DIAMOND POINT.pdf,7,1,
124,78,Q1149,,13,Topo-NIAP,30,Both Quads,4.65,+,3,1,0,+,0,0,1,maps/Both_DIAMOND_POINT.jpg,1,0,0,0,0,0,,,0,0,0,0,0,Both_DIAMOND_POINT.zip,7,1,
110,80,Q0149,,13,Topo-NIAP,29,NAIP Quad,1,+,2,1,0,+,0,0,1,maps/NAIP_STRAWBERRY.jpg,1,0,0,0,0,0,,,0,0,0,0,0,NAIP_STRAWBERRY.pdf,7,1,
111,80,Q0149,,13,Topo-NIAP,28,Topo Quad,0,+,1,1,0,+,0,1,1,maps/Quad_STRAWBERRY.jpg,1,0,0,0,0,0,,,0,0,0,0,1,Quad_STRAWBERRY.pdf,7,1,
125,80,Q0149,,13,Topo-NIAP,30,Both Quads,4.65,+,3,1,0,+,0,0,1,maps/Both_STRAWBERRY.jpg,1,0,0,0,0,0,,,0,0,0,0,0,Both_STRAWBERRY.zip,7,1,
From some debugging I see that line 324 of DbioProductsAttribsRawHandler.php is creating a empty attribute id
Code:
die('attributes id is: ' . $products_attributes_id . ' -2- ' . $table_fields['products_attributes_id']['value'] . ' -3- ' . $this->key_fields['products_attributes_id']);
I was thinking of doing one attribute at a time and see what happens..
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Thanks for the report, @davewest. I'm in the middle of some "stuff" right now so it'll take me a while to see what's going on.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
To late to edit... Some attributes exist all products exist.. link to one product with all attributes...
OK.. no rush..
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Dave, would you run that import with the DbIo debug enabled? It'll be a pretty large file; you can send it to me via direct email (PM me and I'll send the email address to you).
If you keep the size of the import CSV to the minimum required to cause the issue, that'll be a big help.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Dave, would you run that import with the DbIo debug enabled? It'll be a pretty large file; you can send it to me via direct email (PM me and I'll send the email address to you).
If you keep the size of the import CSV to the minimum required to cause the issue, that'll be a big help.
Thanks, @davewest, those logs and additional information helped to pinpoint the root cause.
The issue arises when using the DbIo's "Import (Check-only)" operation for the ProductsAttribsRaw handler when the to-be-imported .csv will result in a new download attribute being created for a given product. I've created the following issue on the DbIo GitHub repository to track the associated change: https://github.com/lat9/dbio/issues/166
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Thanks, @davewest, those logs and additional information helped to pinpoint the root cause.
The issue arises when using the DbIo's "Import (Check-only)" operation for the ProductsAttribsRaw handler when the to-be-imported .csv will result in a new download attribute being created for a given product. I've created the following issue on the DbIo GitHub repository to track the associated change:
https://github.com/lat9/dbio/issues/166
Noting that the above GitHub issue has been updated with the required correction.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Importing prices
The products handler can import prices...as the base product price.
The productsAttribsRaw handler can import prices for attributes.
Within a single product range I have products with attributes/colours.
Sometimes all the colours are the same price: I use the product base price and the attributes are at 0.
Sometimes there is a price difference between the attributes: I use a base product price of 0 and each attribute holds the full price.
Currently I have my own frankenfileimporter which finds a way through this from one source file, but I was wondering if
a) is my method the best way?
b) as far as I see, I would need to use/make up two handler files for import using DBIO, based on one price file, to do an update of all these prices.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
torvista
Importing prices
The products handler can import prices...as the base product price.
The productsAttribsRaw handler can import prices for attributes.
Within a single product range I have products with attributes/colours.
Sometimes all the colours are the same price: I use the product base price and the attributes are at 0.
Sometimes there is a price difference between the attributes: I use a base product price of 0 and each attribute holds the full price.
Currently I have my own frankenfileimporter which finds a way through this from one source file, but I was wondering if
a) is my method the best way?
b) as far as I see, I would need to use/make up two handler files for import using DBIO, based on one price file, to do an update of all these prices.
That's pretty much where it stands right now -- one CSV for the product-related pricing and one for the attribute-related price adjustments.
That said, DbIo can be fairly adjustable (when it wants to be). You could create a common .csv import, containing those fields that you need from both the products and the products_attributes tables and copy that common file to both DbIoProducts.pricing.csv and DbIoProductsAttribsRaw.pricing.csv (it'll take two imports, but one file).
DbIo (silently) ignores any header-columns that don't apply to the to-be-run import-type.
Re: Database I/O Manager (DbIo) Plugin [Support Thread]
Quote:
Originally Posted by
lat9
Noting that the above GitHub issue has been updated with the required correction.
Tested with a new product and works grate... thanks.