bilusunny Posted August 8, 2016 Share Posted August 8, 2016 I need to have the products manufacturer name added in the order page as well. Please see the screenshot where it says description and has the product name, I need a column for the manufacturer name as well. Please assist! Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 Try changing line 38 of admin/themes/default/template/controllers/orders/_product-line.tpl from: <span class="productName">{$product['product_name']}</span><br /> to: <span class="productName">{if $product['id_manufacturer'] > 0}{Manufacturer::getNameById($product['id_manufacturer'])} {/if}{$product['product_name']}</span><br /> This will add the manufacturer name in front of the product name. Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 (edited) That didnt work I m using a theme, supershop, do you think that could alter your solution?? Thanks though for your response Do I have to flush the cache or something? Edited August 8, 2016 by bilusunny (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 Your theme shouldn't make a difference, since this is for the Back Office, not the Front Office. It worked on my PrestaShop v1.6.1.6 test site. What version of PrestaShop are you using? Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 Also, make sure you don't have "Never compile" selected on the Advanced Parameters > Performance tab. Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 PrestaShop v1.6.1.6 , I just turned off never recompile and selected Force compilation. Reloaded the browser, still no go. Should wait a while?? Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 Assuming you've edited the file correctly, it should work instantly after refreshing the page. Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 One question, this is supposed to change in the front office right, After you add the product to the cart and then click on checkout, yourdomain.com/order page???? Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 No, this will change the Orders tab in the Back Office. To change the Front Office, you'll need to modify files such as shopping-cart.tpl in your custom theme. Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 You can make a similar change in shopping-cart.tpl in your theme's directory by changing: <p class="product-name"><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute, false, false, true)|escape:'html':'UTF-8'}">{$product.name|escape:'html':'UTF-8'}</a></p> to: <p class="product-name"><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute, false, false, true)|escape:'html':'UTF-8'}">">{if $product.id_manufacturer > 0}{Manufacturer::getNameById($product.id_manufacturer])} {/if}{$product.name|escape:'html':'UTF-8'}</a></p> Though your custom theme may have different code. You may want to change order-detail.tpl too. Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 where I back office do I see the change? Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 I see it in Orders tab, im looking at the shopping cart tpl now. I need that come up there as well Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 On the Orders > Orders tab when you click on an order, scroll down to the order products and you should see the change. Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 i see this in backoffice but how do I get it in the frontoffice?? Is this the code that I should be editing:line 119 <a href="{$link->getProductLink($lastProductAdded.id_product, $lastProductAdded.link_rewrite, $lastProductAdded.category, null, null, null, $lastProductAdded.id_product_attribute)|escape:'html':'UTF-8'}"> Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 No, you need to find the product name, then you can add the manufacturer name code in front. Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 <th class="cart_product first_item">{l s='Product'}</th> <th class="cart_description item">{l s='Description'}</th> Description is the product name? Is this what you were referring too. Sorry for many questions.. Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 Yes, but it should be the <td>, not the <th>. Make sure you're editing shopping-cart-product-line.tpl, not shopping-cart.tpl. You should see a line like this under it: <p class="product-name"><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute, false, false, true)|escape:'html':'UTF-8'}">{$product.name|escape:'html':'UTF-8'}</a></p> Link to comment Share on other sites More sharing options...
bilusunny Posted August 8, 2016 Author Share Posted August 8, 2016 td class="cart_description"> <p class="product-name"><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}">{$product.name|escape:'html':'UTF-8'}</a></p> {if $product.reference}<small class="cart_ref">{l s='SKU'} : {$product.reference|escape:'html':'UTF-8'}</small>{/if} {if isset($product.attributes) && $product.attributes}<small><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}">{$product.attributes|escape:'html':'UTF-8'}</a></small>{/if} </td> Is this the one?? Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 That's it. Change: <p class="product-name"><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}">{$product.name|escape:'html':'UTF-8'}</a></p> to: <p class="product-name"><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}">{if $product.id_manufacturer > 0}{Manufacturer::getNameById($product.id_manufacturer)} {/if}{$product.name|escape:'html':'UTF-8'}</a></p> Link to comment Share on other sites More sharing options...
bilusunny Posted August 9, 2016 Author Share Posted August 9, 2016 this didnt work rocky. I got a white page, I didnt have my error reporting, Do you need me to turn the error reporting to check for the error message Link to comment Share on other sites More sharing options...
rocky Posted August 9, 2016 Share Posted August 9, 2016 Sorry, I'm not sure how that error got in the code. I've updated my post above. Try again. Link to comment Share on other sites More sharing options...
bilusunny Posted August 9, 2016 Author Share Posted August 9, 2016 You are a genius. Thank you so much....... :) Link to comment Share on other sites More sharing options...
rocky Posted August 9, 2016 Share Posted August 9, 2016 Thank you. I'm happy it works now. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now