Jump to content

[SOLVED]Better way of checking if product default category is one of selected :


mitzayapa

Recommended Posts

Hey guys , i know theres a better way of checking a products default category , right now im using :

 

{if $product->id_category_default == 38 ||
$product->id_category_default == 107 ||
$product->id_category_default == 89 ||
$product->id_category_default == 106 ||
$product->id_category_default == 172 ||
$product->id_category_default == 174 ||
$product->id_category_default == 153 ||
$product->id_category_default == 156 ||
$product->id_category_default == 29 ||
$product->id_category_default == 35 ||
$product->id_category_default == 135 ||
$product->id_category_default == 165 ||
$product->id_category_default == 166 ||
$product->id_category_default == 155 ||
$product->id_category_default == 167 ||
$product->id_category_default == 173 ||
$product->id_category_default == 157 ||
$product->id_category_default == 158 ||
$product->id_category_default == 105 ||
$product->id_category_default == 30 ||
$product->id_category_default == 159 ||
$product->id_category_default == 42 ||
$product->id_category_default == 65 ||
$product->id_category_default == 39}

it works , but i don't think its a good option.

 

i've tried :

{assign var=categoriaceptada value=[38,107,89,106,172,174,153,156,29,35,135,165,166,155,167,173,157,158,105,30,159,42,65,39,63]}
{if $product->id_category_default == is_array($categoriaceptada)}
do something bla bla
{/if}

but it doesn't work.

Edited by mitzayapa (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...