Set product status with magmi (product enabled/disbaled) - php

I used Value Replacer and Clumn Mapper to set product status (enabled/disabled) but i have no effect in my magento!
Here my settings. Somebody have the same problems?
CSV content is:
nr;rack;
10001-52;Yes;
10001-55;No;
To use magmi, first i need convert the data to this correct content:
sku;status;
10001-52;1;
10001-55;2;
I use this plugins settings to convert the data:
Column mapper
Mapped columns list:nr,rack
nr = sku
rack = status
Value Replacer
Replaced attributes: Yes,No
Yes=1
No=2
(For magento "product status" disabled or enabled)
Magmi settings
CSV separator is: ;
CSV Enclosure: i leave it blank
Multiselect value separator: ;
Thank you so much!
Tommy

Related

Woocommerce CSV Headers for categories not working properly

I'm trying importing product with Import feature woocommerce
Here the CSV data:
post_title, type, category_ids, regular_price
Intel - Pentium G3250,simple,intel|1155|processors,860000
The issues is products that are imported, do not fit the category that writed on CSV Data.
I tried tax:cat header and still not get the result that i wanted, is that header column documentation is out of date or something? documentation
This is the screenshot
I'm solved this issues with changing delimiter csv from comma( , ) sign to semicolon( ; )
I realized that to add multiple cat on product cat is use comma to separated cat like this: cat1,cat2,cat3
so My csv look like this:
post_title; type; category_ids; regular_price
tes produk;simple;car,red,machine;860000
Hope it helps :)

PHPExcel formula subtotal / teilergebnis - Excel2016 detected problems with content

I export data from database with dynamical columns and rows so I use R1R1 / $excel->setCellValueByColumnAndRow($col, $row, $value);
Row 2 is my title including autofilter and line 1 on some columns i want a =subtotal().
I tried as =SUBTOTAL() and =TEILERGEBNIS() as well as C1R1 and Standard:
$excel->setCellValueByColumnAndRow(12, 1, "=SUBTOTAL(9;C(2)S:R(".$i.")S)")");
$excel->setCellValue("M1", "=TEILERGEBNIS(9;M3:M".$i.")");
Excel will ask to restore and will set "M1" to 0.
If i copy this value of an echo to M1 it does what it should an is what the formula is as i do it in Excel itself: =TEILERGEBNIS(9;M3:M2315)
There's a couple of things wrong here
Commas (,), not semi-colons (;) for function argument separators (unless you've explicitly set a different locale for the calculation engine)
PHPExcel's calculation engine doesn't accept Column/Row addresses (like R1C1), just cell A1-style addresses
English names for functions (unless you've explicitly set a different locale for the calculation engine)

how to update array in crate

I would like to know how I can update a value stored in an array, in crate.io
I have a blog table - blog_tbl
A column, with data type array - tags
A id column
Inside the tags column I have - ["tag1","tag2","tag3"]
I would to know how I would go about changing 'tag1' to 'tag99'
I tried
update blog_tbl set tags['tag1'] = 'tag99' where id = '1';
Also how would I add one the the end? so making it -
["tag1","tag2","tag3","tag4"]
many thanks
Unfortunately it's not possible currently. Array elements can only be selected using the subscript notation (e.g. select tags[1] from blog_tbl;) but not updated. Maybe add a GH issue requesting that feature.
You can use the pattern found here: https://crate.io/docs/reference/sql/occ.html#optimistic-update
However, that requires you to perform the modification on client side. Pseudo code:
updated = False
while not updated:
cursor.execute('SELECT array_field, "_version" FROM table WHERE id=1')
row = cursor.fetchone()
current_array_field = row[array_field]
current_array_field.append('newtag')
cursor.execute('UPDATE array_field = current_array_field WHERE id=1 AND "_version" = row[version]')
if cursor.rowcount > 0:
updated = True
This will make your update semi safe for concurrent updates of the same field.

Iterating through FileMaker record set

I'm new at FileMaker and trying to get data out via the API.
The issue I'm having is when I create a newFindCommand and execute it the resulting record set contains as many rows as there are in the layout but each row is the same. More specifically, each row is a copy of the FIRST row in the database.
E.g. I'm looking for products with a product code like 'XXX', of which there should be 7. I get 7 rows back but each one is the same product.
I've looked a couple of tutorials online and they do exactly the same operations I do so I'm lost as to why my results come out this way.
This is my code for this problem. I haven't been able to track the cause myself yet.
$findCommand = $productsFM->newFindCommand($productsLayout);
$findCommand->addFindCriterion('Product Code', 'XX123');
$findCommand->addSortRule('Product Code', 1);
$result = $findCommand->execute();
if (FileMaker::isError($result)) {
echo "<p>Error: " . $result->getMessage() . "</p>";
exit;
}
$records = $result->getRecords();
foreach($records as $record) {
echo $record->getField('Product ID'); // get the same code for each iteration here
}
Any advice?
Edit:
The layout $productLayout mentioned above refers to the Items layout.
Here is a brief breakdown of the ER diagram for the Items table.
Table: Items
Family ID Item ID GUID
Table: Item Options
Item ID Description GUID
Table: Pricing ~ Item
Family ID Item ID Item Option Qty
Table: Quantity
Qty Item ID GUID
I fixed this be trying to add the api PHP files again, operating on the assumption I had something wrong. When I added the files and ran the code I got several errors about using deprecated operators at various lines in the FileMaker API.
It turns out several lines use the old =& when creating objects and this was the cause of the errors.
For all but one of those errors you can just remove the '&' and everything is OK.
But for one of the lines (I think it was around line 72), if you correct it by removing the '&' the API will start returning incorrect results. This is where I went wrong the first time around.
The only two options I could see were to drop down to an older version of PHP where the =& operator is not deprecated or suppress the warnings in the php.ini.
I opted for the latter:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

Currency Symbol in magento

I have created two Magento Store Views in two Different Languages:
English
Dutch
English (EURO) Currency symbol comes in proper manner like € 20.00 but for Dutch Language view it shows me like 20,00 EUR. I wants to setup by default symbol € for both views since the EURO is the same. How can i achieve it in Magento.
You can change your locale setting
here is example for English. For that you have to do Minor changes in your Language File. Following is the Directory Structure of File.
=> root/lib/Zend/Locale/Data/en.xml (For English Language)
=> around line 2611 you can see following code.
<currencyFormat>
<pattern>¤#,##0.00;(¤#,##0.00)</pattern>
</currencyFormat>
=> Now Change above code with Following code.
<currencyFormat>
<pattern>#,##0.00 ¤;(#,##0.00 ¤)</pattern>
</currencyFormat>
you can set it to for Dutch.
You can define currency symbol from admin.
Go to system->manage currency and select symbol.
Here you can define currency symbol.
For both store english and dutch select Default Config
system > configuration > general > currency setup > currency options >
change Base currency = Euro
default display currency = Euro
Allowed Currencies = Euro and US DOllar
only for dutch store admin-panel system > configuration
and select your dutch store.
After set your currency.
system > configuration > general > currency setup > currency options
Set this option
Default Display Currency = Euro
Allowed Currencies = Euro and US DOllar
You can change your locale setting
here is example for English. For that you have to do Minor changes in your Language File. >Following is the Directory Structure of File.
>=> root/lib/Zend/Locale/Data/en.xml (For English Language)
=> around line 2611 you can see following code.
> <currencyFormat>
> <pattern>¤#,##0.00;(¤#,##0.00)</pattern>
> </currencyFormat>
=> Now Change above code with Following code.
> <currencyFormat>
> <pattern>#,##0.00 ¤;(#,##0.00 ¤)</pattern>
> </currencyFormat>
you can set it to for Dutch.
To fix the comma form 1.000 to 1,000
add to the past post the following :
go to: => root/lib/Zend/Locale/Data/XX.xml (XX.xml For your Language)
for example : => root/lib/Zend/Locale/Data/en.xml (For English Language)
around line 2286 you can see following code :
<numbers>
<defaultNumberingSystem> xxx your Language xxx </defaultNumberingSystem>
<symbols>
<decimal>,</decimal>
<group>.</group>
to :
<numbers>
<defaultNumberingSystem> xxx your Language xxx </defaultNumberingSystem>
<symbols>
<decimal>.</decimal>
<group>,</group>
this wil change the comma form 1.000 to 1,000
You will have to change the file: /lib/Zend/Locale/Data/root.xml
Go to the row that contains <symbol>[Your currency]</symbol> and change [Your currency]
Ex: change <symbol>USD</symbol> to <symbol>XYZ</symbol>

Categories