Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Show Product Option Variant Name Rate Topic   - - - - -

 
  • lsublimes
  • Newbie
  • Members
  • Join Date: 09-Jul 18
  • 11 posts

Posted 22 February 2019 - 11:08 AM #1

Hi good morning,

 

I try to put the product option variant name showing in the products categorie page, but so for I have only been able to put the option weight modifier.

 

That is the code that I use to capture the weight modifier:

{if $product.selected_options}
  <div class="grid-list__quantidade">
   {__("embalagem")} {$product.selected_options|fn_apply_options_modifiers:$product.weight:'W'} {$settings.General.weight_symbol}
  </div>
{/if}

Can someone tell me the code to catch de variant name.

 

Example of the final result that I want in attached images.Sem Título2.jpg



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 586 posts

Posted 22 February 2019 - 03:00 PM #2

Hello

 

Probably it will not be so easy because the options are not needed in the list so they probably are not taken from the database.

You would have to add support to the hook and retrieve this information when displaying the list.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18909 posts

Posted 25 February 2019 - 07:02 AM #3

Try the following code

{if $product.selected_options}
  <div class="grid-list__quantidade">
  {foreach from=$product.selected_options item=variant_id}
      {"SELECT variant_name FROM ?:product_option_variants_descriptions WHERE variant_id = ?i AND lang_code = ?s"|db_get_field:$variant_id:$smarty.const.CART_LANGUAGE}
  {/foreach}
  </div>
{/if}
 

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • lsublimes
  • Newbie
  • Members
  • Join Date: 09-Jul 18
  • 11 posts

Posted 25 February 2019 - 09:20 AM #4

Try the following code

{if $product.selected_options}
  <div class="grid-list__quantidade">
  {foreach from=$product.selected_options item=variant_id}
      {"SELECT variant_name FROM ?:product_option_variants_descriptions WHERE variant_id = ?i AND lang_code = ?s"|db_get_field:$variant_id:$smarty.const.CART_LANGUAGE}
  {/foreach}
  </div>
{/if}
 

(!) Not tested

 

Works perfectly!!!

 

Thanks you for your help