Created
December 14, 2016 22:04
-
-
Save tessguefen/6cc589c63285b6a984de2b9f17f98473 to your computer and use it in GitHub Desktop.
Get Categories with Parent Categories in list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <mvt:do file="g.Module_Library_DB" name="l.success" value="CategoryList_Load_Offset_Product_Assigned( l.settings:product:id, 0, '', '', 999, l.next, l.settings:product:categories )" /> | |
| <mvt:assign name="l.settings:product:category_list" value="''" /> | |
| <mvt:foreach iterator="cat" array="product:categories"> | |
| <mvt:assign name="l.temp_category_string" value="''" /> | |
| <mvt:assign name="l.parent_id" value="l.settings:cat:parent_id" /> | |
| <mvt:while expr="l.parent_id NE 0"> | |
| <mvt:do file="g.Module_Library_DB" name="l.success" value="Category_Load_ID( l.parent_id, l.loaded_category )" /> | |
| <mvt:assign name="l.parent_id" value="l.loaded_category:parent_id" /> | |
| <mvt:assign name="l.temp_category_string" value="l.temp_category_string $ '/' $ l.loaded_category:name" /> | |
| </mvt:while> | |
| <mvt:if expr="l.temp_category_string"> | |
| <mvt:assign name="l.temp_category_string" value="l.settings:cat:name $ '/' $ l.temp_category_string" /> | |
| <mvt:else> | |
| <mvt:assign name="l.temp_category_string" value="l.settings:cat:name" /> | |
| </mvt:if> | |
| <mvt:assign name="l.success" value="miva_array_insert_var( l.settings:product:category_list, l.temp_category_string, 1 )" /> | |
| </mvt:foreach> | |
| <mvt:eval expr="glosub(miva_array_serialize(l.settings:product:category_list), ',', '<br />')" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment