Amazon API get browse nodes categories only by search - php

I am looking for a way to do a search with the Amazon Product API such as for "cats" and have the api return just the browse nodes that contain products pertaining to the keyword. My intention is to be able to specify a keyword for the website and have it generate the categories that contain related products. I know that I can do an item search with the API and have it return the browseNodes for each given product, but the item search function only returns 10 products at a time and the multiple requests and looping required would be insufficient. Does anyone else know of a way I can just get the categories with available products based off a keyword search?

Getting browsenodes by searching for a keyword search might be difficult as amazon Product API won't provide that information.
You might have already know this however the only way might be uploading all the products and its category in your website DB & relate category and products, and if you search for product it should query in category table and can get the category information.

Related

relation schema for dealer locator mysql and php

I have a project where there is a dealer locator which is supposed to locate the dealers in the area.
The dealers supply multiple brands of different items(example: cement bricks etc.).
These items have subcategories and may also have a variable length sub categories.
Under the sub categories are the brands. Brands are lowest level of that product , meaning there is no end product, all these put together is the product
These dealers have a location which is used to map them on google maps.
The locator must have filters where one can select the category and then a sub category and if exists a sub sub category . Also one can select the brand and quantity of the product.
I have tried different ways to create the database , but have failed.
I am having difficulty in accessing products which have to be displayed after selecting each filter option.
My questions:
Should I create a table for every product , if so what will be the
attribute?
How to handle the variable length sub categories ?
How can I access each product based on category or sub category or brand.
Sample schema:
table:categories(Parent_ID | Category_ID | Category_Name);
table:product (Dealer_ID| Brand_ID|Quantity); - table for each product
table:brands(brand_ID|Category_ID|Brand_Name);
table:Dealer(dealer_ID|lat|long|name ...etc.);
When the page loads all dealers are shown in the map based on location.
On selecting each option the page reloads and displays the dealers based on the selection.
With my current schema I am unable to access them based on selection.
I would create a single products table, and create an entry for each unique product (not one for each categorical permutation). So Cement Brick, Shovel, Hammer, etc.
For the categories, I would create a category map table that would have the following fields:
product_id(int), parent_category_id(int), child_category_id(int)
Both of those fields would map to a category table that would look something like: id(int), name(text), status_id(int), created_at(timestamp), updated_at(timestamp), deleted_at(timestamp)
This implementation would allow you to have as many sub-categories as you wish, and would allow for easy lookups since you'd just need to see if the child_category_id matched one in the requested filter.
As for the brand question, it really depends on how detailed you need to be concerning brand. If you don't need anything other than .. say a name, you could use First Normal Form and put the brand on the product entry itself (as a column on your products table). If you need some more details, and / or need to associate a single brand with multiple products.. you could use a basic xref.

Filter out posts using custom Post Query

I am trying to use the categories to make some sort of taxonomy picker. I have a site, which I’m running locally for event planning; I have 6 categories with sub categories within them. For example if someone is looking for a band, they go into the band category and then it displays all the posts within that category.
I want to use the sub categories to narrow the search down so people searching for bands but want classical will find just those posts. But I want to do it by asking them a question, like “What sort of band are you looking for?” then they select from a drop down of sub categories for the bands. They will do this for each category, make a selection or none so that it gives them a list of only what they are looking for.
Maybe after each selection, it adds that category into an array which is then used for a wp post query?
If you are going to post it then you can just build your query based on the posted variables
e.g.
myql_query("select * from table where catogory = '{$_POST['Cat']}' and subcat = '{$_POST['subcat']}');
However if you want it down when they pick it with out refreshing the page then you need to look at AJAX

Mass import custom attributes Magento

I was wondering if anybody has ever tried to mass import custom attributes into a Magento Database before? My client has a Magento store that specialises in selling musical instruments, and wishes to add a Google Shopping Feed (using the extension of that name by Rocket Web) to sell the products on Google Shopping. The problem is that i need both an MPN (Manufacturer Product Number) and a Brand (so for instance Gibson) for the shopping feed to work, both of which are not automatically uploaded by the stores POS system.
The way that the POS system currently works is when a product is added, the title / SKU number / description / price etc are all uploaded to the Magento store, which means the client does not need to add the product twice. The problem is that as MPN and Brand aren't necessarily out of the box attributes, the POS system does not upload either of these to Magento, and therefore I now have 1,000 products without them and they are apparently crucial to the Google Shopping Feed extension.
I'm currently working on getting a table of each of the products SKU, MPN and Brands from the local database of the POS system (of which each of the products has all 3), but once i have it my question is this: is there a simple way for me to reference the products currently in the Magento database (most likely by SKU, as both databases contain the same SKU for each of the items) and apply two custom fields to each of the products: MPN and Brand? I've created custom 'MPN' and 'cat-brand' attributes (which i can use the Google Shopping Feed to map to the custom attributes) and looked inside the Magento database but i cant find them anywhere, but i found a table called 'catalog_product_flat_1', which i imagine is a flat DB used for indexing or something, but it looks perfect for achieving what i want, in that i could easily search for SKU and apply two custom attributes as columns for each product. Something tells me it isn't going to be that easy though.
Any thoughts would be a great help, thanks for your time.
Magento uses an EAV data model, which means your attributes are broken up into multiple tables. Take a look at any tables with 'entity', 'eav', 'attribute', or 'value' in their name if you want an idea of how it all works.
What you're probably looking for is catalog_product_entity_varchar or catalog_product_entity_text. In those tables, entity_id is your product ID number (different from SKU, but you can link a product_id to a SKU) and attribute_id corresponds to the eav_attribute table.
In short, what you want to do is look at your eav_attribute table, pull the entity_type_id, attribute_id fields for your MPN and cat-brand attributes you made, and then you can insert your data into catalog_product_entity_varchar. (or _text if your attributes use that instead)

Selecting Categories to display products using PHP and MySQL

Hi is there a tutorial or some sort of resource that can help me work out how to actually select products from a database based on the category i selected, mind you the category is not just 1 tier, it will consist of a 3 tier category navigation.
meaning it should only load the page for a list of products that i have selected if i click on the third tier in that particular category, not the first or second tier, all i have the first and second tier doing is displaying a list of the child categories in that tier.
I have my categories sorted by using parent_id's in a database and i list them using PHP, i just don't know how i would go about selecting the products for a particular category, and i was wondering if i could get some resources that could assist me or help with the database side using MySQL and PHP side of things. thanks.

Camouflage product id's on website

I'm currently building a retail e-shop for a jewellery manufacturer which also sells wholesale to other shops and I'm looking for an efficient way to "hide"/"camouflage" the product id's for all products so that other competitors wont be able to see the product's barcodes and find out that the manufacturer is doing direct sales at lower prices.
All products on the website have a 4-5 digit id which is also the name of the products' images, ie for Product #1234 image filename is 1234.jpg
One thought was to add a 3-digit random int before and after the product ID that would make it quite hard for someone to figure out the product id. Another thought would be to reverse the id's or perform some sort of scrambling. This would work fine for all the links within the site and all i'd have to do would be to strip off the first and last 3 digits off the product id's or de-scramble before using in the queries but what can I do when it comes to displaying product images? I don't want visitors to be able to see the filenames, that would completely blow the cover for a ll product id's.
Suggestions and ideas are very welcome.
You shouldn't allow direct access to your images like that. Instead, use a php wrapper which translates your fake product id to the actual image file and return that.
Ie http://.../getimage.php?fakeid=1337 which translates that into the actual product id 123 and then readfile("/path/to/123.png");
The products don't need to be identified by barcode - you could use a meaningless identifier for the products, and only look up the barcode when you actually need it. Example:
product_barcode | product_identifier
7310791268002 | deadbeef01234cafe
Then, you'd use deadbeef01234cafe both for identifying the product in the store, and for the image name.

Categories