Product Data Scraping Magento - magento

The product uploading feature will be automated, so all you need to do is enter a product link through the back-end itself and that then add the product photo and description during the night preferably
Please let us know its possible in Magento

IMHO, the best way to achieve that is to create a csv uploader in the backend like you can find in Mage_ImportExport_Adminhtml_ImportController (the whole module can be source of inspiration). The csv feeds a special table that you create with during your module initialization. At the end, with a cron, at the desired time you check this table for the url and then retrieve the photo and description using curl or something similar.
Side considerations :
If you have a large amount of products to inject, you will prefer direct sql queries than the slow Magento ORM
Do not forget to deactivate the indexation during import process
If you need to update and references are different between your source and your Magento, create a special attribute to be sure to have a link between both
If you feel more confortable with other framework or language and you need to create a large amount of data, the importation process can be done with any language able to interact with mysql.

Related

Amazon Seller Inventory File – Where to get main image URLs?

I'm trying to update the inventory with more information on clothing sizes, material composition etc. by uploading the appropriate inventory file. Now, the template table that I got from here has loads and loads of required columns such as country_of_origin and target_gender that I need to fill out, as well as main_image_url. I'm not sure what to enter there, as the existing images are just fine.
After researching (see below), I'd like to know if I need to go through the trouble of somehow downloading and uploading all of the product images just for the sake of the inventory table, or if there is any other way to create an inventory file that will not mess up the product information.
Or am I maybe misguided in the way that I am trying to do the product updates?
Thanks for any help!
My Research
Can I just leave the field blank even though it is a required field?
 
On this Amazon help page, it says to include every piece of information for existing products into the table even it might seem redundant. Whether that is a recommendation or an absolute requirement, I cannot tell.
Is there an efficient way to retrieve all of the main image URLs for existing products?
Apparently, it is not possible to download the main_image_url in a inventory report like I did with most other required product data columns.
As our products are imported to Amazon by a Shopify app, we do not have all of the product images saved on a server by product ID or anything like that.
According to this StackOverflow answer, there are API calls for retrieving product images by ASIN, but those are scaled down, I cannot use those.

How to duplicate Magento CMS pages and content blocks for additional language scopes

I neeed to find out if it is possible to duplicate a content block or page in Magento much in the same way that you can with products?
For example, I can create a product in (English) and then select an alternative language scope (Italian) and paste the text in for the Italian version.
That is intuitive.
Is this possible for CMS pages and Blocks? It does not appear to be - but maybe I am missing something?
I navigate to CMS > Pages and select a page to edit, it just looks to offer the ability to change the language allocation (not duplicate it for alternative scopes).
It's not possible to duplicate CMS blocks within the Magento admin.
There are a number of extensions that will add this function or alternatively ones that allow you to export, amend in CSV and then import to create the duplicate pages or static blocks quickly.
The CMS Blocks in Magento 2.x are stored in 2 tables:
cms_block
cms_block_store
You can export the cms_block table directly from the mysql db and change what ever you want with an external editor like open-office calc (in my opinion better than excell for export to csv) delete teh column with the id and import again.
If you are implementing a multiple website/store magento then you will need to also export/import the cms_page_store with the correct id's of the block and the store

How to join tables in HMVC?

I used MVC before. Now I am a learning HMVC.
I have product, product_category, product_description and product_images tables in my database.
I want to display list of products in my website with basic product information. Clicking on a product will redirect to a different page and will display all the product related information.
What is the best way to achieve this according to HMVC(Modular MVC) pattern?
Should I create different modules for each table like product module, product category module etc..?(In this case I will have one model class in each module/model. I found this idea when searching internet)
Should I create one module called products and put all the files related to this in that module? (In this case I will be having all the product, product_category, product_description product_images model classes under products/models)
Should I follow a completely different implementation from the techniques I've mentioned above? (Please provide specific details to build this module)
(I'm using codeignitor for my development)
Thanks a lot!
Lets simplify the things for you.
If you have category as menu (Same as magento), i will recommend you to create new module for cateogry
Coming back to product, you can manage all things with the 1 product controller.
In category, category will have its own model to interact with database.
In your product model, you can manage all kind of transactions in one model because they are part of product only.
If you want to move bit advance, you can have a sql folder in each module so that you can install the and create tables when you just drop folder to modules. For this you can create a small script where, in regular interval of time, it will check the new modules, and if that script found some new modules, it will install the .sql file in the sql folder, which will update the database schema.
Hope this will help you

Magento import multiple product images with sort order

I am trying to import products using Magento 1.7 in built import/export dataflow profile function
So far I can import products details and multiple images as per this tutorial.
But problem here is I am not able to maintain store view and image sort order together.
How I can format CSV so that I can control image sort order and store view?
in short what is magento field name for image sort order?
( options tried but failed: position, image_position, media_gallery_position, gallery_position, gallery_position )
Scenario is:
We have three images per product out of which one image should have first sort order and store view thumbnail, small, base image active ie. this image should use as primary image of product and other two are just inner images only for display purpose on product page.
Magento importing exporting are always quirky problems. as far as I know for 1.7, there aren't much options.
http://devjuhong.com/web/magento-import-products-using-csv/
Check out above page it's pointing that problem too.
Store Manager for Magento does a pretty good job at importing products. For say a 100 products it takes a minute or two which includes time for RE-INDEXING product data. Benefits include -
Nice UI to deal with attributes, attribute sets, categories and products.
Provides column mapping functionality for CSV.
XLS/XLSX files are supported which is a nice touch since a lot of developers use functions to auto fill columns.
Connection manager can handle multiple database connections.
There are many more features. Above are just a subset of what I had tried.

What is a Magento "Backend" model?

After building some frontend stuff, I'm now exploring the internals of the admin side of Magento. I read Alan Storm's article on creating a simple model (as opposed to an EAV model, something which I am not yet ready for).
My main goal is to create a module that enables the user to upload and manage media to the Magento installation, so that it can be used in some templates I defined in the frontend. So I would create a model to keep track of the relations between certain media (pictures) and certain categories, pages, you name it. Just for the record: I don't like EAV models, they scare me, so unless it's absolutely necessary, don't push the conversation that way. Thank you :)
I've also skimmed through this article.
It's about backend models, and my question is about that:
What IS a backend model?
Is it a model that's used only in the backend (admin)? I wouldn't know what that would be good for. If someone could tell me something about it, or give me a hint on what to read to know more about it, it'd be great.
The reason I'm telling what goal I want to reach is so that someone can tell me if these "backend models" are significant to what I want.
Thanks!
Don't worry about EAV, don't worry about "backend models". You'll need some in the trenches programming experience before you can fully understand their significance. You can get a lot done with the plain-jane Magento model classes and SQL queries.
The light version: Backend models have nothing to do with the frontend-cart/backend-admin application split. A "backend model" handles loading, storing, and persisting information into a datastore (the database). A "frontend model" is PHP code that handles rendering a user interface element to display the attribute in the web browser. The terms are used in several different systems in Magento, including EAV and the System Configuration section.
The article you linked to is talking abou EAV backend models. Again, the light version: Each data property of an EAV model is, itself, an object. For example, in a simpler system you'd store the product's name as the string 'Bicycle'. In Magento you assign a product attribute object to the parent EAV model for name. This way, the code for saving "name" to the database can be kept separate from the other saving code.
Long story short, It's overkill for what you're after.
In Magento backend attribute models is used to prepare data before placing it in the database. This preparation is done by beforeSave method. A good exampe is Mage_Eav_Model_Entity_Attribute_Backend_Datetime

Resources