RodgerFox Posted November 27, 2012 Report Share Posted November 27, 2012 Доброй ночи, не как не могу додумать, как взять мне бренд? Вызвать его в products.tpl, ну или для отдельного товара. Вывести бренд, к которому товар относится. В таблице продукта есть поле brand_id и у бренда есть ид, не как не могу ими воспользоватся. Кто ни будь встречался с этим уже? Quote Link to post Share on other sites
Kosjak76 Posted November 28, 2012 Report Share Posted November 28, 2012 Ошибся, писал по памяти...В списке должно работать так:{$product->brand} - имя бренда{$product->brand_url} - ссылка на страницу бренда Quote Link to post Share on other sites
RodgerFox Posted November 28, 2012 Author Report Share Posted November 28, 2012 ммм, кажется чую конец, и решение проблемы) Quote Link to post Share on other sites
RodgerFox Posted November 28, 2012 Author Report Share Posted November 28, 2012 И еще раз спасибо вам +) Quote Link to post Share on other sites
RodgerFox Posted January 30, 2013 Author Report Share Posted January 30, 2013 не пойму, не получается взять картинку бренда, что я делаю не так? <img src="{$config->brands_images_dir}{$product->brand_image}" /> Quote Link to post Share on other sites
JustDavali Posted January 30, 2013 Report Share Posted January 30, 2013 в каком шаблоне вставляешь? Quote Link to post Share on other sites
RodgerFox Posted January 30, 2013 Author Report Share Posted January 30, 2013 productsи условие что то не нравится ему, не пойму как из продуктов обращаться к бренду его. {if $product->brand->image} Quote Link to post Share on other sites
JustDavali Posted January 30, 2013 Report Share Posted January 30, 2013 в продуктс по умолчанию не выводиться картинка бренда, только название брендасам на днях столкнулсянадо в productsView.php запрос слегка поправить Quote Link to post Share on other sites
RodgerFox Posted January 30, 2013 Author Report Share Posted January 30, 2013 ох, придется лезть в код =( вот бред полный... такие вещи и сразу в код =\ Quote Link to post Share on other sites
JustDavali Posted January 30, 2013 Report Share Posted January 30, 2013 сам в шоке был, но тем не менее надо Quote Link to post Share on other sites
ololosha Posted February 10, 2013 Report Share Posted February 10, 2013 А как вывести в описании товара, в product.tpl изображение категории, где этот товар находиться и чтоб это изображение было ссылкой на эту категорию?Выручайте =) Quote Link to post Share on other sites
JustDavali Posted February 11, 2013 Report Share Posted February 11, 2013 в api/Products.phpчто-то в районе 160-х строк идет запрос в базу, добавляем в него новую строчкуb.image as brandimage,в product.tpl вызываем так<img src="{$config->brands_images_dir}{$product->brandimage}" alt="" /> Quote Link to post Share on other sites
neo-2000 Posted June 17, 2013 Report Share Posted June 17, 2013 в api/Products.phpчто-то в районе 160-х строк идет запрос в базу, добавляем в него новую строчку b.image as brandimage,в product.tpl вызываем так <img src="{$config->brands_images_dir}{$product->brandimage}" alt="" />в api добавил, в produkt.tpl не понял куда прописать, Quote Link to post Share on other sites
neo-2000 Posted June 17, 2013 Report Share Posted June 17, 2013 JustDavali если у тебя все получилось, и картинка бренда выводится, помоги плизззз... Quote Link to post Share on other sites
Kpoxa Posted June 17, 2013 Report Share Posted June 17, 2013 Ребята, что вы велосипед изобретаете?А не проще будет так вывести в product.tpl <img src="{$config->brands_images_dir}{$brand->image}" alt="" /> и не надо в API править Quote Link to post Share on other sites
neo-2000 Posted June 18, 2013 Report Share Posted June 18, 2013 можно и так, у меня вопрос в какую строчку вывести <img src="{$config->brands_images_dir}{$brand->image}" alt="" /> Quote Link to post Share on other sites
Kpoxa Posted June 18, 2013 Report Share Posted June 18, 2013 в то место, где хотите увидеть лого бренда. Quote Link to post Share on other sites
neo-2000 Posted June 18, 2013 Report Share Posted June 18, 2013 спасибо, сейчас попробую Quote Link to post Share on other sites
neo-2000 Posted June 18, 2013 Report Share Posted June 18, 2013 не а не отображается картинка, текст описание бренда есть а картинки нет Quote Link to post Share on other sites
Kpoxa Posted June 18, 2013 Report Share Posted June 18, 2013 Дайте, кусок кода где Вы выводите название бренда. Quote Link to post Share on other sites
neo-2000 Posted June 18, 2013 Report Share Posted June 18, 2013 {get_brands var=all_brands} {if $category->brands} <select class="selects" name="brand"> <img src="{$config->brands_images_dir}{$brand->image}" alt="" /> <option value="">Производитель</option> {foreach name=brands item=b from=$category->brands} <option value="{$b->url}"{if $b->id == $brand->id} selected="selected"{/if}>{$b->name|escape}</option> {/foreach} </select> {elseif $all_brands} <select class="selects" name="brand"> <option value="">Производитель</option> {foreach $all_brands as $b} <option value="{$b->url}"{if $brand->id == $b->id} selected="selected"{/if}>{$b->name}</option> {/foreach} </select> {/if} Quote Link to post Share on other sites
neo-2000 Posted June 18, 2013 Report Share Posted June 18, 2013 у меня работает скрипт на вывод бренда в выпадающем списке, мож в этом конфликт??? Quote Link to post Share on other sites
neo-2000 Posted June 18, 2013 Report Share Posted June 18, 2013 хотя это разные вещи... Quote Link to post Share on other sites
Kpoxa Posted June 18, 2013 Report Share Posted June 18, 2013 А зачем в product.tpl список брендов? Quote Link to post Share on other sites
neo-2000 Posted June 18, 2013 Report Share Posted June 18, 2013 да не, список брендов не в product.tpl , это я к слову что были доработки, мож конфликт какой... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.