I want to create an import from a CSV but i can't modify the CSV file.
So i need to define default values for a couple required fields in Magento (like "type" ( > Simple Product ) etc.
I'm looking at https://stackoverflow.com/a/7319214/2252078 to make a custom Adapter and that inject the missing required values in the array before saving.
But i already get an error that says:
Method "parse" not defined in adapter spaanproductions_basics/convert_adapter_product
So i can't even begin with my custom code.
Maybe someone has a beter idea how to create some default values, or how to fix this issue.
Magento version: 1.9.1.1
Thanks in advance.
Kind regards,
Sonny
Not sure what the problem is, your code does seem to be valid. You could try http://pastebin.com/vxewc0Zt . OR temporarily rename your app/code/local/Spaanproductions/Basics/Model/Covert/Adapter/Product.php to verify wetter the right class is actually being loaded although I highly doubt that's the problem
-- Edit (See comments) --
try changing spaanproductions_basics/convert_adapter_product to basics/convert_adapter_product your models are defined under basics, not under spaanproductions"
At the first you have to export products as a csv file to catch the structure and then modify that as you need.
Take a look at this answer, it could be useful:
Update Magento products with multiple images
Related
When trying to create a set using tableau public, I create the parameter with no problem but when I try to create the set, not only does it create the set in the dimension category instead of a separate sets category for some reason, it doesn't show an "In" option in the filter, only an "Out". Also yes I know you are supposed to have the set in the "Filters" section, but I was just trying other stuff to see if I could get it to work.
I have tried everything I can think of however I cannot get the "In" option to appear in the sets filter. I have also tried googling my problem and cannot find a single instance of someone experience the same problem that I am now. If anyone could provide some assistance as to why this may be that would be great.
I'm trying to create a second invoice template and add another print invoice link so I can print a standard invoice but also print a 'internal' invoice copy with an 'Official Use' table in which can be filled out by staff on the print out.
I've found the template invoice.tpl and print_invoice.tpl in /basic/mail/orders/
created two new files called invoice.dirty.tpl and print_invoice_dirty.tpl and pasted the content of the original files in the new ones, changed the path and added the table I wanted.
I've managed to locate the code for the 'Print Invoice' link and duplicated that changing the href by adding _dirty to the original 'orders.print_invoice?' but when I try the link it opens the popup ok but I get a 404 error, i've checked the permissions and changed them to full but still it won't play ball...
it seemed quite simple and I expected it to work but obviously i'm missing something, any guidance would be appreciated.
Check controllers that bring data to this files, maybe there is the main problem.
What cs-cart version are you using?
You need to create also the mode > invoice_dirty and this can be added with the help of file order.post.php but before i can give you some instructions i need to know you cs-cart version
I'm working on importing (on a regular basis) about 6,000 items into Magento using Magmi. I've got nearly everything configured the way I need it, but I have one issue.
I need to concatenate 3 columns from my .csv file to create a "category_ids" column. I'm using the Value Replacer plugin with the following value:
{item.departmentid},{item.classid},{item.subclassid}
This works well, however I need to then map this field to another field using the Generic Mapper plugin. Both functions work individually, however I need the Value Replacer to run BEFORE the Generic Mapper. As best as I can tell, it appears the Generic Mapper runs first. Is there a way I can alter the execute order for these two plugins?
Thanks for the help!
Update for Dweeves:
Doh! I totally overlooked that section while trying to figure this out. Now that I've gone through it, I might need a little more help. Right now I've using just the Value Replacer plugin with the following settings:
Replaced attributes: category_ids
New value for category_ids:
{{ ValueRemapper::use_csv('/var/www/magmi/category_ids.csv')->map({item.departmentid},{item.classid},{item.subclassid}) }}
It doesn't seem to be working as I intended it to, but I'm a systems guy and not a PHP programmer. Any help?
2nd Edit
I got it working by using the Value Replacer function to first concatenate everything into a new "test" column, then using the Value Replacer Value Mapper function to create the category_ids column with the mapped values. Confusing, but it's working well.
You can use the ValueRemapper helper of Value Replacer plugin for this kind of purpose.
See Value Replacer Plugin Documentation (ValueRemapper helper section)
To answer your original question (how to define the order the plugins run in).
From my experience, the plugins are loaded in order of their plugin filename.
For example, if you look at magmi/plugins/base/itemprocessors/importlimiter, you will notice that the filename for the plugin is 01_importlimiter.php.
If you look in the genericmapper plugin folder, you'll notice the plugin filename to be 02_genericmapper.php.
With this being said, 01_importlimiter.php will execute before 02_genericmapper.php.
Please can someone please show me real world example of when it would be advisable to override _setResourceModel to provide different name for collection.
I find it fascinating that magento have given the option of using a custom word for "_collection" but that there is absolutely no evidence of it ever being done.
You might want to have a different name for _collection if you are using multiple datastores
(for example: if you are using MySql and MongoDB).
Pesach
How can I simply add new simple products incrementally to configurable products?
or do I still need to retrieve the 2 original arrays of the pre-defined configurable product (getConfigurableAttributesData and getConfigurableProductsData) first, append the new arrays and set them again? Is it worked for my case just as the first-time creation?
And if the new simple product owns a new attribute / attribute options, do I also need to create /edit the attribute first before adding?
Thanks in advance!
The API as it stands does not have the functionality to do this.
Your options are:
Extend the API. (Hours of fun)
Do it with Magento methods in your own module or standalone code that includes Mage.php.
SQL script mixed in with your existing API code.
Buy someone's module - (Hope your German is good)
The approach you take also depends on your SKU naming scheme, if you have a simple BASECODE-SIZE-COLOUR type of scheme then the SQL option can work a treat, and in next to no time, but will be heavily scorned on by Magento evangelists.
That means you are probably going to have to write your own code. Here is a very useful site that should help get you started:
http://www.ayasoftware.com/
As well as being able to import configurables (by a variety of means including SQL) there are also snippets of code useful for updating superattribute price differentials. No readymade complete solution, but, you may need to roll your own anyway depending on your SKU naming scheme.
Whilst you are at it you may also want to write some code to find simple products that are not hooked up to anything when they should be, i,e. the ones with no visibility.