How to show region specific products magento? -


how show products in magento based on selected state , city? there extension available feature? or how can achieve this?

you can add 1 (city) or 2 (state , city) attributes in product model (by back-office panel).

your news attributes can contain list (in example string delimiter commas) list of state/city product allowed sell.

for retrieve state/city allowed list can :

<?php   // id product 12345 // city allowed list attribute code 'city_list'  $id = 12345; $product = mage::getmodel('catalog/product')->load($id);  $citylist = $product->getattributetext('city_list');  var_dump($citylist); 

output :

string(38) "los angeles, new delhi, caen, etc, etc" 

it's possible may add ->getattributetoselect('city_list') after load($id) if attribute isn't retrieve catalog/product model.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -