Pair items from different lists - algorithm

I am trying to Pair objects from two different sites. They don't use Universal IDs so I need to do it all by hands.
One of those has also a weird way to identify items internally.
I don't know how to couple them together.
Right now I tried to use what it seems the way they both divide items:
- Category (For indoor use, For outdoor, Paper, Metal, Pens,Food Use..)
- Product ("Microsoft Widget A","MS Widget B")
- Item (10cm red, 200m blue made of paper..)
Item for example could be the different size of the same product (1.5cm,10cm,100cm) on one site (site A), while the other site
"split" differently. A Product can be divided in quantities/colors/size that are items. This means that I can have
Site a: Product Widget A, red
Items: 10cm,20cm, 100cm
Site b: Product Widget A,
Items: red 10cm,red 20cm,red 100cm, blue 10cm, blue 100cm
Another bad thing is that the categories are not defined the same way, Site A might say "Outdoor Widget for water",
while the other has "Outoor", and "Widget for water" in a subcategory. Or even worse it use different wordings.
Right now, to try to find a solution to this, I tried to couple the main categories of Site A with Site B by hand and consider all items of subcategories as item of the parent one.
This is sub optimal since some categories on Site B might be ordered differently (for example, there are subcategories like
"related" that basically links to other main categories. )
For the products, I just compare all names of the items with the Levenshtein algorithm and combine the products with higher ratio.
I am using Site A to define how to group products, with the bad result that I don't group all "Widget A" together, but instead I have pairs for "Widget A,red", "Widget A,blue", etc.
Has anyone an idea how to improve this?
Right now the only ideas I have are:
to create a big string with the product name and main item features
and use levenshtein again.
use Site B as main site to compare to.
I'm not an expert of AI, but I've seen algorithm that helps you define objects, but not one that pairs them.
I will probably need to write something that classify what is a feature of an item (red, 10cm). Maybe use the category name as well
(for example like: Site A : "Outdoor Widget for Water" and site B: Category: "outdoor", product: "Widget for water").

In case someone happens to read my question, I've finally built something using the cosine similarity.
see for example this:
Use sklearn to find string similarity between two texts with large group of documents

Related

PrestaShop: Creating a specialized supplier page

We are planning to develop furniture shop with PrestaShop. I am a newbie with PrestaShop and am interested to know more about it. The following is the scenario that we have:
In the shop, we would like the top navigation to list the areas in the house (e.g. dining, bedroom, etc). When we hover this, there will be a dropdown menu with a list of furniture type (e.g. dining chairs, dining tables, and so forth).
In addition to that, the left side will be a list of "collections". Each collection can contain items that are of different furniture types. E.g. Collection A can have a dining chair, living room chair, and so forth.
In the list of collections, there is a possibility to have a "special" collection. This collection will have a different layout page compared to the other collections.
Hence, I am wondering if:
Is this possible to use Prestashop? I can see that #1 is possible using the categories feature (1st level category as the areas in the house and 2nd level category as the furniture types). Also, #2 might be possible using "Suppliers" or "Manufacturers". What I am concerned, is there a way to actually separate "suppliers" / "manufactures" as "specials"?
If it is possible, can we actually create a specialized page for these?
Thank you so much for your help everyone! Any kind of suggestions would be great! I look forward to hear from you!
For each of your 3 needs:
You are correct that PS's categories will allow you to do this. The category system allows you to have a hierarchy of categories that is as deep as you need, and what you described is exactly how it's meant to be used.
As you hinted, you can use either suppliers or manufacturers for this by simply changing the name to "Collections" and associating products with the correct suppliers (if you choose supplier instead of collection). You can add a description to a supplier or manufacturer that will appear by default before the list of products.
You can add a custom description to each supplier or manufacturer page, but I think you're looking for even more variation. If the layout change you need for "special" collections isn't too extensive, you could achieve it by doing something tricky in the page template which checks what page is currently being displayed, and shows or hides HTML or executes Javascript based on the result. This would provide quite a bit of flexibility, even though it's "dirty" in the sense that you'd have to hardcode information in a template. A better way to achieve this would be to override the manufacturer controller (assuming you chose to use the manufacturer to represent collections) to use a different template for certain manufacturer IDs. I haven't tested this code, but I think it's pretty close to what you'd need to put in the override directoryalong with a new template called manufacturer-custom.tpl in your theme:
class ManufacturerController extends ManufacturerControllerCore {
// array with the selected manufacturers
private $customManufacturers = array(1, 2, 3);
public function init() {
parent::init();
if (in_array($this->manufacturer->id, $this->customManufacturers)) {
$this->setTemplate(_PS_THEME_DIR_.'manufacturer-custom.tpl');
}
}
}

display same configurable options on child product view page

I setup the configurable products using 4 options (color, size thickness, size width, size ball).
I want view color distinct items on the list.
When I click each items, the detail page will be same. (same color swatch and options views)
(please check my attached file.)
When I click a item has got blue color option, I want see the blue color selected on the product view page.
Please let me know the solution.
Thank you.
Interesting challenge you have there - the products are ideally suited for Magento, you should end up with a store vastly more convenient than the competitors where you cannot filter by gauge, colour etc.
As for the problem, don't put colour in the configurable product options, just the size options will do. For selecting colours the way you want, move the related product block to the main product page options area.
Your 'related products' will need thumbnails and some careful creation so they stay in the same sort order. To do this:
Presumably you are using SKU's that follow some pattern, e.g. SKU-SIZE1-SIZE2-COLOUR. Put together a module with an observer that runs on some sensible schedule, e.g. overnight. In that scheduled task get the product collection grouped by SKU and ordered by COLOUR. Put some sort order to your colours, e.g. spectrum, with Red = 100, Orange = 200 and everything sensible in between. The im of the task is to go through all the products, find 'related' products (same model code, sku). Then in that group create related product links. For the example above, with six colour variants you will need to put in 25 links (5^2) once you take all six configurable master products into consideration.
Now you will need some work on the template. Initially you may want to get anything to show, you will also need to put the currently selected product in the list in the correct place so that the colour thumbnails do not jump around when you go from one colour variant to the next.
This can be done by using an extension called Pre-Select Colors Plus Swatches. You can find a demo of said extension here:
http://preselectswatches.cjmcreativedesigns.com/products.html
There are 6 products shown in the demo. One is the configurable product and the other five are the simple products showing the various color options. Notice that each of the color options loads the parent product with the color option already selected. The configurable product can even be hidden from the category listings, if needed, so that you only show the color options on the category pages.

Proper solution to handle genders

i'm creating a big online clothing shop using magento and i was wondering - is there any good solution to handle genders in magento? I need to be able to add products to Male or Female gender but also to some categories like pants, hats or jackets. Categories are the same for both genders so using Gender as top-level category and clothing-categories as gender sub-categories would be a bit redundant i think.
Any ideas or tips would be appreciated, thanks in advance!
I've seen Magento stores where Male/Female are the top level categories, and it works well because generally the first thing customers would like to do is see only Male/Female items.
Another alternative is to create a new "Select" attribute for gender (Catalog > Attributes > Manage Attributes) and set a gender for all products. Then you could set up top level categories for Jackets, etc and allow customers to filter by gender using the layered navigation.
Given your category tree is the same, and gender is equally appropriate as an attribute of a product as it is a category - it would make sense simply to use attributes to facilitate it. Otherwise you will have a needless duplication of category tree.
Using a multiple select attribute for "gender" with two options "Male/Female" - you would be able to have the 1 to many, 1 to 1 relationship that you need for the products.
Then it is just a case of adapting your menu to suit. You could easily just append
&gender=male
to your menu URL and it would pre-select the appropriate filter from the layered navigation.
The better way
Would be to add a custom extension to "shop by X", gender in your case - then customise your top nav to reflect the shop by Male/Female options. Then you would have cleaner SEO urls to capture keyword phrases for "Mens suit jackets" by having a landing page for such.
Planning this element of your store is critical and the implementation even more so, to make it both scalable and a positive shopping experience for your customer.

How (& where) does Magento decide the order of list items in the configurable product view dropdown?

image #1: https://picasaweb.google.com/lh/photo/gDCgo_SHMbnAOmHCh0LQCtMTjNZETYmyPJy0liipFm0?feat=directlink
When examining a Magento configurable test product (ski goggles with a color option), I see that the colors of the dropdown list (see image #1) are ordered like this: White, Blue, Red, Silver. However, when I examine the product in the admin view and select the "Associated Products" tab, there seems to be no correlation between the frontend list organization and the product ID numbers, price, or anything else for that matter.
To demonstrate, if I connect the product ID numbers to the above list, I get: White (170), Blue (169), Red (168), Silver (175) - see image #2 below.
image #2: https://picasaweb.google.com/lh/photo/ES0i3_wZsdiU35w4_MGLrdMTjNZETYmyPJy0liipFm0?feat=directlink
At the time I initially created the configurable product, I had added three color options (168, 169, 170) and they appeared to be displaying in descending order by ID in the dropdown on the frontend. But I just now added another individual product (the color Silver), with an ID of 175, and it doesn't follow this trend.
Question: What logic does Magento use to order these lists, and what file is this function located in? I'm looking for a way to arrange the config. product dropdown list(s) in ASCENDING order, regardless of price or any other factor, ex. from 168-175.
Thanks.
B
Someone with more experience or knowledge may override me on this, but I believe the order the attribute values appear in the drop down list is based on the order they are given on the attribute label definitions when you create the attribute.
Sort order of the attributes is determined in the attribute. The furthest column on the right is called Sort Order.
Otherwise it should sort alphabetically.
I think what you are looking for is to sort dropdown values (i.e. small, medium, large, extra-large) by some value, and not by its label. If this were done, sorting would make more sense. We would be able so sort by increasing or decreasing size, rather than alphabetical (which does not make sense).
In order for this to happen, we would need magento to support enumerations or oordinal values (https://magento.stackexchange.com/questions/20985/get-option-value-by-id-or-attribute-in-magento, Magento - Sort by Position and Name?). There are NUMEROUS requests for this, which are being ignored.
Please be aware, dropdown values can already be re-ordered. In the admin pages, you can simply drag a dropdown value in M2 in order to change its position (M 1.9 calls this "Sort Orer"). However, the question then becomes how to use the position or sort order [s=1 m=2 l=3 xl=4] of the attribute-value for sorting, rather than its label.

Magento grouped product options

I want to show a set of products as a table inside one product with these attributes.
Dimensions Width x Gusset x Height Code Price/Case Bags/Case Weight
So i chosen grouped product option but it does not match the requirement. How can i design a table like format from the grouped product option with radio button to choose only one product from it. So using grouped product or configurable product or by any way how can i achieve this.
Here am attaching the screen-shot which i actually wanted
I can think of two ways to represent this in code. If the dimensions tend to be from a limited set of choices, you could use a configurable product to represent this choice, simply displaying all possible sub-products in the table. This would let you reuse the existing catalog product page with a little retrofitting.
If they do not fit well, you could place the items in a category hidden from the public categories and loop through each of the products in the category to display the table. This would require more work to tie back to putting into the cart, etc.
Importantly, it looks like each of your options has an entirely uncorrelated price, so it seems to me that you need to have a simple product underpinning these options at some point. (I'm sure you could get more clever, I'm just not sure that's a good idea.)
You can easily solve this with a plugin for Magento. There is a plugin here which will do exactly what you want. It will display product options in a grid: http://www.magemechanics.com/product-grid-options.html

Resources