Can we map product category to Customer/Store in Magento - magento

In Magento, We can able to map the customers to the website. Is it possible to map the customers to the product category or the particular store ?
Note: Each product category has to be mapped with certain group of customer. All the products should not be visible to all the customer.
How can we achieve this.

I have the same requirement on my current project ended up going with this
https://github.com/Vinai/groupscatalog2
It seems like the solution is pretty heavy but, this was the most no fuss solution and it does the trick

Related

How do you query the category id or name in Opencart 1.5.5.1 Joomla 3.3.0

So I am modifying a module and I've successfully queried the product ID. So if I am browsing products and go into the product details page, I can see my product ID using
JRequest::getInt('product_id');
but for some reason I cannot get the category ID. I've tried.
JRequest::getInt('category_id');
and it always comes out to zero no matter what category I go to. Anyone else experience this? I could get it from the nonSEF url but there's gotta be another way. My goal is to basically query the category ID when I am browsing that category or if I am in the product details of a product.
I assume, you're using some OpenCart component for Joomla. In this case, you have to look into controller and model files for OpenCart. It's not THAT easy to get certain values sometimes, because these are 2 different engines.
In short, you may have to use VQMod for OpenCart, add category_id to data array and only then JRequest it. Solely depends on task.

How to get product collection of given main category id?

In my website I have several stores available. One particular store contains both the simple and configurable products. This is a huge collection of products. What is the fastest way to get all enabled products (including child products of configurable products) collection of this store by store id?
Note: I tried this lot of different ways. But it takes loo much time. Sometimes cause to crash the server even.
Note : I'm using Magento CE 1.3
Any suggestions will be appreciated.
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect(array('name', 'url_key','price','lowest_price','service_id','description','short_description'));
$collection->addStoreFilter();
instead of use addAttributeToSelect('*') use only specific attributes which you needed because it effect performance of site
hope this will help you

Using Magento Like Ebay

I want to use magento's multi store system like ebay.
I want to use stores on one domain and using the same root category but every store can have different price on every single product and I want every store to be multilingual.
Before I start I appreciate some direction, which way would be best practise to achieve this?
This cannot (reasonably) be done in Magento, mainly because pricing cannot be set at the store level AND each scope (website/store) comes with a not-insignificant performance hit. MANY have tried what you are proposing. None have succeeded. Sorry.
Actually there has many Magento extension can extend one Magento site into one Marketplace, which can let customer apply to be as one seller to sell their products as vendor on this common market.
Like:
https://www.magentocommerce.com/magento-connect/marketplace.html
https://www.magentocommerce.com/magento-connect/medma-marketplace.html
...

How to weave retail outlets info into Magento site

We are trying to do something interesting but challenging:
We have a couple thousand products listed on our B2C site (non-Magento), & are considering moving the site to Magento for a variety of reasons. The product pages provide detailed information about these products. Our user base would now like us to provide local information about retail stores where they can buy these products; the information required would be Retail outlet name, address, zip, phone, & a Google-map display (this last is optional).
In the front-end, each product detail page will display relevant retailers depending on the product AS WELL AS depending on the user's zip. Each user will see upto 5 nearby retailers.
My question is: how best can we set up this in Magento so that we can:
map products to retail_outlets, the way magento allows for mapping of products to categories. Products & outlets will have a many-to-many relationship, & we are looking for something that will be easy to maintain.
Map user's zips to the retailer info.
We are open to using magento 1.7, if that is a better fit.
Thanks in advance.
-TM
This is not the right place for this question as it is not related to programming and does not have code samples and is too general :( read the FAQ please
but in general you need:
add a product attribute (multiselect) with all your retail_outlets and add a possible retailers to a product
ask user to input a zip if he has not jet . you can get this from quote->getShippingAddress()->getPostcode(); if your user is
registered or something
on detail page query out your retailers by zip. This will need you to implement Geo/Spatial Search with MySQL.

Magento: Add a "fake" product to cart/quote

I understand how to programmatically create a product and also add to cart. I know this might sound dumb but is it is possible to generate a product on the fly and add that to the cart/quote but never actually save it in the database.
We want to create a made to order interface and I was thinking at the end it could add a bundle product with all the selections but that bundle product wouldn't actually exist in the backend.
I figured as long as you can make sure the quote and order has what it needs in terms of the product it would be ok, but obviously there is probably a lot that is tied to looking up stuff in the db on a specific sku or ID. I know that if you delete a product and then look at an order in the admin that causes issues, at least it did for this one scenario I was dealing with.
I was thinking of creating a giant bundle product that had like 6 different bundle items and each item could potentially have like 500 products and then based on what the user selects I programmatically add the bundle to cart. But then I wasn't sure if there would be a negative affect with having a gigantic bundle product like that as well.
UPDATE:
I don't think this will work, obviously there are a lot of information tied to the product in the database and we setup a test and right away we get an error for $item->getProduct(). We are moving forward with creating a giant bundle product and also the generic product with adding custom options on the fly, which Anda pointed out below. Any other suggestions will be greatly appreciated.
I'm not sure that clockworkgeek's approach is going to work. On every page load, Magento loads the items from the cart to make sure that they are still valid (in-stock, prices correct, etc), and amends the cart to reflect those values. My understanding of the system in the past has been that a product in the cart needs to have a corresponding database value to survive this process.
The "giant bundle product" approach is a pain, but in the past has been the best approach I have found. Attempting to change the values of the product (such as price or attributes) will be overridden by the cart checks, so you need a product w/ maximal flexibility, such as an overly-customized bundle product or configurable product.
Hope that helps!
Thanks,
Joe
Why not create a generic product in db and then set the product customization as custom options (additional_options) on the fly depending on the user selection. You can add custom options to the product (actually to the quote item) without having to save them in the database. I did this once for a website that sells glasses with prescription. The prescription was added as an option.
You can programmatically create Mage_Sales_Model_Quote_Items and add them to the cart. You've noticed it needs a product to match it's product ID but it needn't be a useful one. It could be a blank, disabled product, also created in code. All that's needed is a stub.
The necessary stuff for the cart is stored in the quote item - fields like name, value and quantity. Those fields are then copied directly to the order without using a product.
Mage::getModel('catalog/product')
creates a new product. you can add it to a cart, by doing something like this:
$cart = Mage::getSingleton('checkout/cart');
$product = Mage::getModel('catalog/product')
->setStoreId($storeid)
->setTypeId($type_id)
->setQty($quantyty)
->setWhatAttributYouWant($attribute);
$cart->addProduct($product);
product attributes you can find in the DB in tables that start like catalog_product_... or take an already created product, and see what attributes it has in the _data array (with debugger or just print_r($product->getData))

Resources