Post by Mosstyn » Sun Jul 05, 2020 4:28 am

Hi,

Using OC Version 3.0.3.3, and I'm looking to display the model name on the product grid/list rather than the product name. Reason being that it's shorter, and will look neater, staying on one line without truncation. With OC 2.x it was just a case of some 'if' 'else' statements and some new variables, but this new 'twig' setup has got me stumped. Can someone point me in the right direction of where to start? Thanks in advance.

New member

Posts

Joined
Tue Aug 01, 2017 7:02 am

Post by letxobnav » Sun Jul 05, 2020 7:09 am

in the category controller add:

Code: Select all

'model'        => $result['model'],
after:

Code: Select all

'name'        => $result['name'],
in the category view change:

Code: Select all

<h4><a href="{{ product.href }}">{{ product.name }}</a></h4>
to:

Code: Select all

<h4><a href="{{ product.href }}">{{ product.model }}</a></h4>

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Mosstyn » Sun Jul 05, 2020 3:19 pm

Hi, Thanks for your answer. That made perfect sense, but the result was no name at all, just the price. But that's given me a place to start.

New member

Posts

Joined
Tue Aug 01, 2017 7:02 am
Who is online

Users browsing this forum: nonnedelectari and 400 guests