Help On Developing Get Product Id Data

Hello everybody,

I need help to develop this:

I have created a new feature with two values of type text that will contain the id of a product (prev_product_id, next_product_id)

I want to make a div inside the product view that when a product is loaded shows some features of the prev_id_product and next_id_product

I have created a block and two files related to it:

  • /web/design/themes/mythem/templates/blocks/list_templates/my_block.tpl
  • /web/design/themes/gigante/templates/blocks/products/myblock.tpl

I have changed the product design and add the block.

Inside this tpl I want to get the current product prev_product_id and with it get product data of this id (particulary I want to get it's features and price)

How can I get this info?

Where can I learn to do it for myself?

The whole task is not quite clear. But try the following code:

{$prev_product = $view_tools.prev_id|fn_get_product_data:$auth}
{$next_product = $view_tools.next_id|fn_get_product_data:$auth}

{$prev_product|fn_print_r}
{$next_product|fn_print_r}

Thanks for your reply ecomlabs. You help me to know how to load product data by its id.

But the solution you bring me is for take the default info of next and previous product.

I have created my own previous and next product id with features for every product that allows type in the id of my desired next and previous product.

How can I get the value of the custom feature of the current product?

Thanks for your reply ecomlabs. You help me to know how to load product data by its id.

But the solution you bring me is for take the default info of next and previous product.

I have created my own previous and next product id with features for every product that allows type in the id of my desired next and previous product.

How can I get the value of the custom feature of the current product?

Array with all features can be displayed in the following manner:

{$next_product = $view_tools.next_id|fn_get_product_data:$auth}
{$next_product.product_features|fn_print_r}

When just use foreach to find necessary element