Okko Posted April 25, 2014 Share Posted April 25, 2014 (edited) I'm newbie at Prestashop I have product Blouse from manufacturer (brand) Zara with 2 suppliers: Distributor 1 and Distributor 2 How to display all suppliers on product page? Like: Blouse Supplier: - Distributor 1 - Distributor 2 I'm using Prestashop 1.6.0.6 thanks a lot for your help Edited April 25, 2014 by Okko (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 25, 2014 Share Posted April 25, 2014 prestashop doesnt allow to associate more than 1 manufacturer with product. you can achieve it only with modifications of core (and database) or with some module to display custom contents on product pages. Link to comment Share on other sites More sharing options...
Okko Posted April 26, 2014 Author Share Posted April 26, 2014 thanks Vekia.. I mean supplier not manufacturer... In my case, manufacturer: Zara, supplier: Distributor 1 and Distributor 2 at BO we can add more than 1 supplier for product Link to comment Share on other sites More sharing options...
IndiaLinkers Posted April 30, 2014 Share Posted April 30, 2014 Hi Okko, You do have interesting point. Already Presta support multiple suppliers for each product along with their own prices. I'm also searching for a way to display all suppliers on a product page to let customer choose any of supplier to buy from. Did you got success in this? Please share the solution to it. @vekia Sir please look into it as you know it can help us use Presta in many ways. Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted April 30, 2014 Share Posted April 30, 2014 You can't do this by default, as it's like a multiple seller option. You can only use suppliers to define your purchase price, to check your real income on a product's sale Link to comment Share on other sites More sharing options...
IndiaLinkers Posted May 7, 2014 Share Posted May 7, 2014 (edited) ok. I thought we could use it that way.. wait.. 'You can't do this by default' that's all I wanted, a direction Edited May 7, 2014 by IndiaLinkers (see edit history) Link to comment Share on other sites More sharing options...
tooy Posted November 11, 2014 Share Posted November 11, 2014 Hello, I wanna share with you the solution i use for list all suppliers : in file /override/controllers/front/ProductController.php something like : class ProductController extends ProductControllerCore { public function initContent() { parent::initContent(); foreach (ProductSupplier::getSupplierCollection($this->product->id, true)->getResults() as $productSupplier) { $suppliers[] = new Supplier($productSupplier->id_supplier, $this->context->language->id); } $this->context->smarty->assign('suppliers' , $suppliers ); } } in product.tpl in my theme directory : <p id="supplier"> <label for="product_supplier">{l s='Les mamies qui tricotent cet article :'} </label> <span class="editable"> {if isset($suppliers)} {foreach from=$suppliers item='supplier' name='supplier_list'} {if {$supplier->id_supplier} !=0} <a href="{$link->getsupplierLink($supplier->id_supplier, $supplier->link_rewrite)|escape:'html':'UTF-8'}" title="{l s='More about' mod='blocksupplier'} {$supplier->name}"> <img src="{$img_ps_dir}/su/{$supplier->id_supplier}-small_default.jpg" alt="{l s='une image de '} {$supplier->name}" /> </a> {/if} {/foreach} {/if} </span> </p> This work and it's not too crappy But i wonder, is it better to create a module rather than override core class like this ? Especially if you want to distribute a theme ! i'm not sure but it's seems impossible to distribute an override in theme without a module. isn't it ? Or maybe there is an easier way adding a smarty variable ? 3 Link to comment Share on other sites More sharing options...
NemoPS Posted November 12, 2014 Share Posted November 12, 2014 Well, depending on how many suppliers you have, creating a new instance of the class for each of them might take down performance a bit. Why not, instead, using a module, as you mentioned, that 1- retrieves only necessary data for supplies and assigns it to an available hook 2- use that very same hook to show the table in the product page? If not the second, you could add a further custom hook, that only involves writing a small snippet, and use that in the position you prefer, instead Lastly, I believe product has both id_supplier and supplier_name assigned as variables to the object, so it would only be missing link_rewrite (which is in any case optional to grab the link) Link to comment Share on other sites More sharing options...
Recommended Posts